libdrm: add missing caps from kernel to drm.h

This just moves over some missing caps from the kernel.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
libdrm: add prime fd->handle and handle->fd interfaces

These are just basic ioctl wrappers around the prime ioctls,
along with the capability reporting.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
libdrm/nouveau: add prime handle->bo and bo->handle support.

This adds prime support to nouveau libdrm.

Signed-off-by: Dave Airlie <airlied@redhat.com>
intel: add prime interface for getting/setting a prime bo. (v4)

This adds interfaces for the X driver to use to create a
prime handle from a buffer, and create a bo from a handle.

v2: use Chris's suggested naming (well from at least for consistency)
v3: git commit --amend fail
v4: fix as per Chris's suggestions, group assignments, add get tiling

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
intel: fix build error

  CCLD   test_decode
./.libs/libdrm_intel.so: undefined reference to `drmPrimeHandleToFD'
./.libs/libdrm_intel.so: undefined reference to `drmPrimeFDToHandle'
collect2: ld returned 1 exit status

From Adam Jackson's explaination:

  most distros have changed it so ld defaults to --no-copy-dt-needed-entries,
  so if you use something from libdrm you can't just assume libdrm_intel
  will bring it in for you, you have to be explicit

Signed-off-by: Rob Clark <rob@ti.com>
modetest: Unify buffer allocation

Merge the create_test_buffer() and create_grey_buffer() functions into a
single buffer allocation function that takes the pixel format and fill
pattern as parameters.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
modetest: Add SMPTE test pattern

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
modetest: Add test pattern support for missing packed YUV formats

Implement tiles and SMPTE test pattern generation for the UYVY, VYUY and
YVYU formats.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
modetest: Add test pattern support for missing planar YUV formats

Implement tiles and SMPTE test pattern generation for the NV12, NV21,
NV16 and NV61 formats.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
modetest: Add test pattern support for missing RGB formats

Implement tiles and SMPTE test pattern generation for the RGB565,
BGR888, RGB888, ARGB8888, BGRA8888 and BGRX8888 formats.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
modetest: Move connector and plane parsing to separate functions

This will make it easier to add additional parameters to the connector
and plane arguments.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
modetest: Make frame buffer format configurable on the command line

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
modeset: Split buffer allocation to a separate file

As the modeset test application is often referred to as an example of
the KMS API usage, move test pattern generation and buffer allocation to
a separate file to keep it simple and clear.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
modetest: fix uninitialized fourcc

If color format for CRTC layer is not specified on commandline, then
c->fourcc is unintialized resulting in addfb call failing.

Signed-off-by: Rob Clark <rob@ti.com>