freedreno: support either kgsl or msm

Split out common code and backend.  Current backend is for 'kgsl'
android driver, but a new backend will provide support for the
upstream msm drm/kms driver.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
freedreno: add support for msm drm

This adds support for the "msm" backend, using the upstream msm drm/kms
driver.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
tests: add msm

Signed-off-by: Rob Clark <robclark@freedesktop.org>
tests/*version: add missing string.h header

Prodives memset() and strlen(), used in tests/setversion
tests/getversion respectively.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
tests/modetest: silence compiler warning about uninitialised variables

The compiler is unaware of that we have at least one crts/connector/plane
thus it complains that some of our variables will be used uninitialised.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
freedreno: use local drm.h over the system one

Otherwise build will fail, as drm/drm.h is not available.

Cc: Rob Clark <robclark@freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
freedreno: set automake options to include subdir-objects

Handles automake complains about lack of forward-compatibility, due to the
source files in the kgsl and msm backends/folders.

Cc: Rob Clark <robclark@freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
intel: Update package name and description in libdrm_intel.pc

Currently the package name and description duplicate that of the
core libdrm. Update those to reflect reality.

Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
radeon: add berlin pci ids

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
radeon: pad CS to 8 DW

Aligns the IB to 8 DWs.  The aligns the IB to the
CP fetch size.  r6xx also require at least 4 DW
alignment to avoid a hw bug.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
modetest: add a -D option to specify a device to be used

This is helpful for differentiating between multiple devices that use
the same module.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Rob Clark <robdclark@gmail.com>
modetest: allow setting a scaling factor when showing plane

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Rob Clark <robdclark@gmail.com>
freedreno: add missing NOSYNC flag

Signed-off-by: Rob Clark <robclark@freedesktop.org>
radeon: Fix tiling mode index for 1D tiled depth/stencil surfaces on CIK

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
libdrm: Make some drm headers compatible with gcc -std=c89 -pedantic

The following minor changes were needed to these headers:
 * Convert // comments to /* */
 * No , after final member of enum

With these changes, these header files can be included by a program that
is built with gcc options:
  -std=c89 -Werror -pedantic

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
configure: add AC_LANG_SOURCE call within AC_COMPILE_IFELSE

Documentation states that AC_*_IFELSE has to use AC_LANG_SOURCE or
friends in order to generate the source code to compile.
AC_LINK_IFELSE already handles this, thus convert AC_COMPILE_IFELSE
to silence the final autoconf warnings.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
radeon: fix pitch alignment for non-power-of-two mipmaps on SI

This fixes VM protection faults.

I have a new piglit test which can iterate over all possible widths, heights,
and depths (including NPOT) and tests mipmapping with various texture targets.

After this is committed, I'll make a new release of libdrm and bump
the libdrm version requirement in Mesa.
drm: Synchronize the stereo 3D mode flags from the kernel headers

v2: stereo layouts are now an enum (Daniel Vetter)

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
drm: Sync the DRM_SET_CLIENT_CAP ioctl definition

v2: SET_CAP -> SET_CLIENT_CAP renaming

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
drm: Introduce a drmSetClientCap() wrapper

That wraps around the new DRM_SET_CLIENT_CAP ioctl.

v2: SET_CAP -> SET_CLIENT_CAP renaming

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>