freedreno: sync kernel header

Signed-off-by: Rob Clark <robclark@freedesktop.org>
freedreno: add chip-id property

Userspace needs to know the patch-revision in addition to just the
gpu-id (ie. 320, 305, etc).

Signed-off-by: Rob Clark <robclark@freedesktop.org>
intel: Sync the command parser version parameter from kernel

Cc: Bradley Volkin <bradley.d.volkin@intel.com>
Reviewed-by: Brad Volkin <bradley.d.volkin@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
intel: Sync typo fix from the kernel sources.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
intel: Add new userptr ioctl

Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
exynos: fix coordinate computation in g2d_copy

The right-bottom register isn't set correctly.
Looks like a copy-and-paste error.

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
exynos: fix G2D_DOUBLE_TO_FIXED for non-integer input

The hardware accepts scaling factors formatted in a
fixed-point format. The current macro casts to integer
first, then multiplies by the fp conversion factor.

This does not make any sense. In particular, truly
'fractional' inputs, like 1.5, won't work that way.

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
exynos: fix scaling factor computation in g2d_copy_with_scale

When division of source and destination width yields the
scaling factor for the x-coordinate, then it should be
source/destination _height_ for y.

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
tests/exynos: fimg2d: add a checkerboard test

This makes it easier to see corruption which e.g. occurs when
using the userptr functionality to copy buffers allocated
via plain malloc.
exynos: replace G2D_DOUBLE_TO_FIXED macro with documented function

This also avoids the floating point conversion steps and just
uses pure integer arithmetic. Also the G2D hardware scaling
factor is a bit unintuitive, so explain it in the function.
tests/exynos: fix typos and change wording

No functional changes.
debug: disable the blend test

The blend test uses the userptr functionality, and, probably
because the IOMMU isn't enabled on this system, this fails
badly (screen corruption, weird kernel behaviour, etc.)
So just disable it for now.
exynos: add g2d_scale_and_blend

This is a combination of g2d_copy_with_scale and
g2d_scale. I think it's a pretty common operation
to scale one buffer and then blend it on top
of another.
tests/exynos: introduce wait_for_user_input

Currently getchar() is used to pause execution after
each test. The user isn't informed if he's supposed to
do anything for the tests to continue, so just
print a simple message to make this more clear.
exynos: honor the repeat mode in g2d_copy_with_scale

This is useful when the default repeat mode, which is 'repeat'
produces artifacts at the borders of the copied image.
I choose 'pad' mode to use the color of the destination
image.

In my usage case the destination is the framebuffer, which is
solid filled with a background color. Scaling with 'pad' mode
would then just do the right thing and also produces nice
borders on the output.
exynos: introduce g2d_add_base_addr helper function

In almost all functions the base address register is
written, so it makes sense to have a helper function
for this.