platform/upstream/libdrm.git
7 years agoAndroid's major/minor/makedev live in <sys/sysmacros.h>
Elliott Hughes [Sat, 20 May 2017 18:24:29 +0000 (11:24 -0700)]
Android's major/minor/makedev live in <sys/sysmacros.h>

Bug: https://github.com/android-ndk/ndk/issues/398

Signed-off-by: Rob Herring <robh@kernel.org>
7 years agoBump version to 2.4.81 libdrm-2.4.81
Marek Olšák [Wed, 24 May 2017 15:01:36 +0000 (17:01 +0200)]
Bump version to 2.4.81

7 years agoamdgpu/drm: add AMDGPU_HW_IP_VCN_ENC
Leo Liu [Tue, 21 Feb 2017 16:14:09 +0000 (11:14 -0500)]
amdgpu/drm: add AMDGPU_HW_IP_VCN_ENC

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
7 years agoamdgpu/drm: add AMDGPU_HW_IP_VCN_DEC
Leo Liu [Tue, 7 Feb 2017 16:10:48 +0000 (11:10 -0500)]
amdgpu/drm: add AMDGPU_HW_IP_VCN_DEC

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
7 years agoamdgpu: add raven family id
Hawking Zhang [Wed, 4 Jan 2017 18:24:53 +0000 (02:24 +0800)]
amdgpu: add raven family id

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
7 years agoamdgpu: add missing extern "C" headers
Nicolai Hähnle [Sat, 13 May 2017 21:03:55 +0000 (23:03 +0200)]
amdgpu: add missing extern "C" headers

Signed-off-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Xie <AlexBin.Xie@amd.com>
7 years agoFix stray caller of drmCompareDevices
Adam Jackson [Thu, 4 May 2017 19:57:14 +0000 (15:57 -0400)]
Fix stray caller of drmCompareDevices

Signed-off-by: Adam Jackson <ajax@redhat.com>
7 years agoconfigure: Fix the <sys/sysmacros.h> check
Adam Jackson [Thu, 4 May 2017 16:25:01 +0000 (12:25 -0400)]
configure: Fix the <sys/sysmacros.h> check

AC_HEADER_MAJOR only defines MAJOR_IN_SYSMACROS if major() is _not_
defined by <sys/types.h> alone. It is, but it warns, and that's ugly.
To fix this, push -Werror into CFLAGS when invoking AC_HEADER_MAJOR so
the warning makes the compilation test fail.

Reviewed-by: Emil Velikov <emil.velilkov@collabora.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
7 years agoExport drmDevicesEqual
Adam Jackson [Thu, 4 May 2017 14:48:56 +0000 (10:48 -0400)]
Export drmDevicesEqual

drmCompareBusInfo was almost this already, but it wasn't exported, its
name didn't match its functionality, and while it almost looks like it
was usable for sorting due to memcmp it wouldn't work if you had
multiple bus types. I don't really want to think about defining a
sensible sort order for bus types, so let's at least make it less of a
trap for the caller.

Invert its boolean sense to be 'true if equal', rename it to describe
the types it actually operates on, and export.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velilkov@collabora.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
7 years agoamdgpu: Use the canonical form in branch predicate
Edward O'Callaghan [Sat, 22 Apr 2017 06:47:40 +0000 (16:47 +1000)]
amdgpu: Use the canonical form in branch predicate

Suggested-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoAdd the DPI encoder/connector types to KMS utils.
Eric Anholt [Tue, 25 Apr 2017 18:31:27 +0000 (11:31 -0700)]
Add the DPI encoder/connector types to KMS utils.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
7 years agoAdd pl111 as a KMS driver for utils.
Eric Anholt [Tue, 25 Apr 2017 18:29:33 +0000 (11:29 -0700)]
Add pl111 as a KMS driver for utils.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
7 years agomodetest: fix printing of fourcc on BE machines
Ilia Mirkin [Tue, 18 Apr 2017 12:54:11 +0000 (08:54 -0400)]
modetest: fix printing of fourcc on BE machines

fourcc is not a string, it's a packed integer. This happens to work out
on LE, but gets reversed on BE.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
7 years agoamdgpu/: concisely && consistently check null ptrs in canonical form
Edward O'Callaghan [Tue, 18 Apr 2017 16:13:19 +0000 (02:13 +1000)]
amdgpu/: concisely && consistently check null ptrs in canonical form

Be consistent and use the canonical form while sanity checking
null pointers, also combine a few branches for brevity.

v2: rebase on top of 'add amdgpu_cs_wait_fences' series.

Signed-off-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoamdgpu: add a test for amdgpu_cs_wait_fences
Nicolai Hähnle [Thu, 13 Apr 2017 14:43:58 +0000 (16:43 +0200)]
amdgpu: add a test for amdgpu_cs_wait_fences

Signed-off-by: monk.liu <Monk.Liu@amd.com>
[v2: actually hook up the test case]
Signed-off-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
7 years agoamdgpu: add the interface of waiting multiple fences
Nicolai Hähnle [Thu, 13 Apr 2017 14:43:14 +0000 (16:43 +0200)]
amdgpu: add the interface of waiting multiple fences

Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com>
[v2: allow returning the first signaled fence index]
Signed-off-by: monk.liu <Monk.Liu@amd.com>
[v3:
 - cleanup *status setting
 - fix amdgpu symbols check
v4: simplify return from amdgpu_cs_wait_fences (suggested
    by Edward O'Callaghan)]
Signed-off-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com> (v1)
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com> (v1)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
7 years agofreedreno: fix double-free on exit
Rob Clark [Sat, 15 Apr 2017 18:43:17 +0000 (14:43 -0400)]
freedreno: fix double-free on exit

Fixes: a07ae97 ("freedreno: fix device close issues")
Signed-off-by: Rob Clark <robclark@freedesktop.org>
7 years agoconfigure.ac: bump version for release libdrm-2.4.80
Christian Gmeiner [Fri, 14 Apr 2017 22:45:57 +0000 (00:45 +0200)]
configure.ac: bump version for release

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
7 years agoetnaviv: add fence fd support
Philipp Zabel [Mon, 10 Apr 2017 09:15:53 +0000 (11:15 +0200)]
etnaviv: add fence fd support

Add etna_cmd_stream_flush2 with in-fence fd and out-fence fd support for
explicit fencing.

v3: added etna_cmd_stream_flush2 to etnaviv/etnaviv-symbol-check

v2: renamed etna_cmd_stream_flush_explicit to etna_cmd_stream_flush2

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
7 years agoetnaviv: sync uapi header
Philipp Zabel [Mon, 10 Apr 2017 09:15:52 +0000 (11:15 +0200)]
etnaviv: sync uapi header

Import the etnaviv header changes from kernel commits 9ad59fea162c
("drm/etnaviv: submit support for in-fences") and 78ec187f64fa
("drm/etnaviv: submit support for out-fences") for fence fd support.

The drm_etnaviv_gem_submit structure was extended to include a flags
field, new flags for in-fence and out-fence fds and an input/output
fence fd field.

This is one-way backwards compatible because old userspace code passing
a short structure not including the flags field to new kernels will
cause the remaining fields to be zero-filled. New userspace code must
make sure to only pass the short structure to old kernels, though.

Not generated using make headers_install, since the drm/etnaviv_drm.h
uapi header is not installed yet by the kernel.
Copied from the airlied/drm-next commit 78ec187f64fa.

v2: improved commit message

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
7 years agointel: remove dead code
Eric Engestrom [Sun, 9 Apr 2017 21:48:46 +0000 (22:48 +0100)]
intel: remove dead code

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
7 years agoexynos: add C++ support to exynos_drmif header
Tobias Jakobi [Wed, 5 Apr 2017 14:22:24 +0000 (16:22 +0200)]
exynos: add C++ support to exynos_drmif header

Add the usual extern "C" when compiling in C++ mode.

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
7 years agoconfigure.ac: bump version for release libdrm-2.4.79
Marek Olšák [Sat, 8 Apr 2017 19:58:46 +0000 (21:58 +0200)]
configure.ac: bump version for release

7 years agoamdgpu: allow to query GPU sensor related information
Samuel Pitoiset [Tue, 4 Apr 2017 14:34:56 +0000 (16:34 +0200)]
amdgpu: allow to query GPU sensor related information

This exposes amdgpu_query_sensor_info().

v2: - add amdgpu_query_sensor_info() to the symbols list

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agoconfigure.ac: bump version for release libdrm-2.4.78
Daniel Stone [Fri, 7 Apr 2017 08:10:15 +0000 (09:10 +0100)]
configure.ac: bump version for release

7 years agoAdd CRTC ID to vblank event
Ander Conselvan de Oliveira [Mon, 17 Aug 2015 13:21:24 +0000 (16:21 +0300)]
Add CRTC ID to vblank event

When using the atomic API, one request can span multiple CRTCs, however
one event is generated per CRTC. As we cannot disambiguate the CRTC with
user data (since we only have one piece of user data to pass in), newer
kernels can include the CRTC ID in the page flip event.

Add a new vfunc to dispatch vblank events carrying a CRTC ID to clients
who negotiate a higher interface version.

[daniels: Rebased, include new cap, call page_flip_handler if it is set
          but page_flip_handler2 isn't even on newer contexts, write a
  commit message.]

v2: Split into separate commit.

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@intel.com>
7 years agoHeaders: Sync drm{,_mode}.h with the kernel
Daniel Stone [Tue, 4 Apr 2017 20:38:56 +0000 (21:38 +0100)]
Headers: Sync drm{,_mode}.h with the kernel

Generated using make headers_install, based on drm-misc-next commit
5db06a8a98f515f67446a69c57577c4c363ec65d.

This clarifies the comments around modifiers such that they are
per-framebuffer rather than per-plane, adds the beginnings of aspect
ratio mode flags, link status properties, and updates the 'reserved'
field from vblank events to include the CRTC ID.

v2: Split into separate patch, pull in full kernel changes.
v3: Undo revert of connector-type enums, since it is not actually
    harmful.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoconfigure.ac: pthread-stubs is not a thing on GNU/kFreeBSD
Emil Velikov [Wed, 5 Apr 2017 16:21:29 +0000 (17:21 +0100)]
configure.ac: pthread-stubs is not a thing on GNU/kFreeBSD

As mentioned on the xcb mailing list, the platform uses the GLIBC
forwarding mechanism.

https://lists.freedesktop.org/archives/xcb/2016-November/010896.html

Reported-by: Andreas Boll <andreas.boll.dev@gmail.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
7 years agoman: fix bug report instructions (third time's the charm)
Eric Engestrom [Tue, 4 Apr 2017 17:05:53 +0000 (18:05 +0100)]
man: fix bug report instructions (third time's the charm)

Compile- and run-tested this time.

Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agoman: fix bug report instructions (for real this time)
Eric Engestrom [Tue, 4 Apr 2017 16:37:02 +0000 (17:37 +0100)]
man: fix bug report instructions (for real this time)

/me derped, component libdrm doesn't exist under Mesa because it's in DRI.
While at it, give the full URL and make it https.

Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agoman: fix bug report instruction
Eric Engestrom [Tue, 4 Apr 2017 16:09:01 +0000 (17:09 +0100)]
man: fix bug report instruction

Component "libdrm" doesn't exist (anymore?)

Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agoman/drm(7): fix typo
Eric Engestrom [Tue, 4 Apr 2017 15:58:46 +0000 (16:58 +0100)]
man/drm(7): fix typo

Reported-by: Oliver Kisielius <oliver.kisielius@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100559
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agoconfigure.ac: bump the version to 2.4.77 libdrm-2.4.77
Marek Olšák [Tue, 4 Apr 2017 09:36:00 +0000 (11:36 +0200)]
configure.ac: bump the version to 2.4.77

7 years agoconfigure.ac: bring back pthread-stubs check
Emil Velikov [Thu, 30 Mar 2017 17:01:12 +0000 (18:01 +0100)]
configure.ac: bring back pthread-stubs check

Accidentally removed with earlier commit. Although rather than simply
adding the check for all platforms, use the same heuristics as we do in
mesa.

Namely: pthread-stubs is a thing only for BSD platforms. Everyone else
should have lightweight pthread API in their C runtime library.

Fixes: 4ecd1ef010b ("xf86drm: fix null termination of string buffer")
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
7 years agotests/etnaviv: link against libdrm
Bernd Kuhls [Mon, 3 Apr 2017 16:57:22 +0000 (17:57 +0100)]
tests/etnaviv: link against libdrm

Fixes link errors detected by buildroot autobuilders:

http://autobuild.buildroot.net/results/68a/68af62f4ab6944d326468818562c05fd5cc55b03/build-end.log

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100530
Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
7 years agotegra: update symbol-check
Erik Faye-Lund [Wed, 29 Mar 2017 22:24:24 +0000 (22:24 +0000)]
tegra: update symbol-check

I get a few more symbols in my build tegra-libraries, so let's
include these in the whitelist as well.

While we're at it, update the comment at the top.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoAndroid: disable pointer-arith and enum-conversion
Rob Herring [Wed, 22 Mar 2017 19:05:25 +0000 (14:05 -0500)]
Android: disable pointer-arith and enum-conversion

Disable some more warnings from clang. These don't appear to be warnings
worth fixing.

Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoAndroid: fix building of modetest and proptest
Rob Herring [Wed, 22 Mar 2017 19:05:24 +0000 (14:05 -0500)]
Android: fix building of modetest and proptest

These tests depend on tests/util/ headers, but expect the include path
to be tests/.

Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoxf86drm: remove memory leaks in drmGetBusid/drmGetReservedContextList
Seung-Woo Kim [Mon, 27 Mar 2017 02:09:29 +0000 (11:09 +0900)]
xf86drm: remove memory leaks in drmGetBusid/drmGetReservedContextList

In error path of drmGetBusid() and drmGetReservedContextList(),
there are memory leaks for error path. So this removes them.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
7 years agotests/exynos: fix invalid code of error path in g2d test
Seung-Woo Kim [Mon, 20 Mar 2017 00:52:49 +0000 (09:52 +0900)]
tests/exynos: fix invalid code of error path in g2d test

This patch fixes invalid code of error path including NULL
deference and leak in g2d test.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
7 years agotests/exynos: remove unused-function build warning
Seung-Woo Kim [Fri, 31 Mar 2017 03:30:57 +0000 (12:30 +0900)]
tests/exynos: remove unused-function build warning

The function g2d_blend_test() is blocked to call because of
feature unsafety. This patch blocks with proper feature name
and also blocks the function itself to remove build warning.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoexynos/fimg2d: remove unused-function build warning
Seung-Woo Kim [Fri, 31 Mar 2017 03:30:56 +0000 (12:30 +0900)]
exynos/fimg2d: remove unused-function build warning

The function g2d_reset() is not anymore used after the commit
e3c97d1a2473 ("exynos/fimg2d: add g2d_validate_xyz() functions"),
so it should be removed.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Reviewed-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoexynos: fix type-punned pointer build warning
Seung-Woo Kim [Fri, 31 Mar 2017 03:30:55 +0000 (12:30 +0900)]
exynos: fix type-punned pointer build warning

As like the commit ecc2a097294d ("xf86drm: Fix type-punned pointer
build warning"), this fixes following build warning.

   exynos_drm.c: In function 'exynos_handle_event':
   exynos_drm.c:420:15: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
      e = (struct drm_event *) &buffer[i];
                  ^

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Reviewed-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoamdgpu: add amdgpu_bo_va_op_raw to the symbol check
Emil Velikov [Mon, 3 Apr 2017 16:40:59 +0000 (17:40 +0100)]
amdgpu: add amdgpu_bo_va_op_raw to the symbol check

Otherwise the make check will rightfully fail.

Fixes: 4e369f25a94 ("amdgpu: add amdgpu_bo_va_op_raw")
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoamdgpu: add REPLACE and CLEAR checking for VA op (v2)
Junwei Zhang [Wed, 22 Mar 2017 03:14:00 +0000 (11:14 +0800)]
amdgpu: add REPLACE and CLEAR checking for VA op (v2)

v2: fix indent

Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoheaders: the uint*_t vs. __u* discrepancy in amdgpu_drm is fixed
Nicolai Hähnle [Mon, 3 Apr 2017 08:23:03 +0000 (10:23 +0200)]
headers: the uint*_t vs. __u* discrepancy in amdgpu_drm is fixed

This was already done in commit 3dc002df3e5 ("amdgpu: sync amdgpu_drm.h
with kernel 4.11-rc2"), now update the README accordingly.

Signed-off-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoheaders: sync amdgpu_drm.h from airlied/drm-next
Nicolai Hähnle [Mon, 3 Apr 2017 08:22:59 +0000 (10:22 +0200)]
headers: sync amdgpu_drm.h from airlied/drm-next

Changes include: PRT and preemption flags, sensor info, and some more
changes for Vega10.

Generated using make headers_install from airlied/drm-next commit
320d8c3d38739fa8e31a076b86cbdafcf8897d5e.

Signed-off-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoamdgpu: add amdgpu_bo_va_op_raw
Nicolai Hähnle [Wed, 8 Feb 2017 12:02:56 +0000 (13:02 +0100)]
amdgpu: add amdgpu_bo_va_op_raw

This variant allows the caller full control over flags and size, and
allows passing a NULL bo (for PRT support).

Cc: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Cc: Jerry Zhang <Jerry.Zhang@amd.com>
Signed-off-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
7 years agoetnaviv: remove struct etna_specs
Christian Gmeiner [Sun, 26 Mar 2017 13:57:28 +0000 (15:57 +0200)]
etnaviv: remove struct etna_specs

There is no need to cache spec values directly as library
users will cache them anyway.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
7 years agoconfigure.ac: bump version for release libdrm-2.4.76
Marek Olšák [Wed, 29 Mar 2017 18:06:22 +0000 (20:06 +0200)]
configure.ac: bump version for release

7 years agoamdgpu_drm: add AMDGPU_HW_IP_UVD_ENC
Leo Liu [Thu, 23 Mar 2017 14:43:40 +0000 (10:43 -0400)]
amdgpu_drm: add AMDGPU_HW_IP_UVD_ENC

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
7 years agoamdgpu: stop reading CC_RB_BACKEND_DISABLE on Vega10
Christian König [Mon, 27 Mar 2017 13:44:14 +0000 (15:44 +0200)]
amdgpu: stop reading CC_RB_BACKEND_DISABLE on Vega10

Follow up to 'drm: don't access deprecated register on Vega10'.

The same information is available in enabled_rb_pipes_mask and reading that
register can cause GRBM bus problems.

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
7 years agotests/amdgpu: add Polaris12 support for cs test
Junwei Zhang [Tue, 20 Dec 2016 01:52:32 +0000 (09:52 +0800)]
tests/amdgpu: add Polaris12 support for cs test

Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com>
Reviewed-by: Ken Wang <Qingqing.Wang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
7 years agotests/amdgpu: add vce unit test support for vega10
Leo Liu [Tue, 13 Dec 2016 20:24:05 +0000 (15:24 -0500)]
tests/amdgpu: add vce unit test support for vega10

swizzle mode needs reference and input picture luma and
chroma pitch aligned with 256

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
7 years agotests/amdgpu: add uvd unit test support for vega10
Leo Liu [Mon, 5 Dec 2016 16:18:09 +0000 (11:18 -0500)]
tests/amdgpu: add uvd unit test support for vega10

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
7 years agotests/amdgpu: fix the count number for vega10
Huang Rui [Wed, 9 Nov 2016 03:28:45 +0000 (11:28 +0800)]
tests/amdgpu: fix the count number for vega10

Signed-off-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Ken Wang <Qingqing.Wang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
7 years agoamdgpu: don't read registers not present on Vega10
Huang Rui [Tue, 8 Nov 2016 06:00:45 +0000 (14:00 +0800)]
amdgpu: don't read registers not present on Vega10

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
7 years agoamdgpu: update amdgpu_drm.h for Vega10
Marek Olšák [Tue, 21 Mar 2017 19:14:45 +0000 (20:14 +0100)]
amdgpu: update amdgpu_drm.h for Vega10

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
7 years agoamdgpu: sync amdgpu_drm.h with kernel 4.11-rc2
Marek Olšák [Tue, 21 Mar 2017 19:31:53 +0000 (20:31 +0100)]
amdgpu: sync amdgpu_drm.h with kernel 4.11-rc2

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
7 years agofreedreno: fix device close issues
Rob Clark [Thu, 23 Mar 2017 18:58:38 +0000 (14:58 -0400)]
freedreno: fix device close issues

Move closing the fd to after subclass ->destroy() (since it might want
to delete gem bo's, etc), and actually free() the fd_device object.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
7 years agofreedreno: valgrind support
Rob Clark [Tue, 21 Mar 2017 23:44:57 +0000 (19:44 -0400)]
freedreno: valgrind support

Signed-off-by: Rob Clark <robclark@freedesktop.org>
7 years agoconfigure: Explicitly check for pkg-config at the top level
Adam Jackson [Thu, 23 Mar 2017 16:07:03 +0000 (12:07 -0400)]
configure: Explicitly check for pkg-config at the top level

If you don't, then the first place the m4 expands is:

    if test "x$INTEL" != "xno"; then
    PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10])
    fi

So on non-Intel architectures we never find it in the path, and all
subsequent PKG_CHECK_MODULESes fail. Boo autoconf.

Signed-off-by: Adam Jackson <ajax@redhat.com>
7 years agofreedreno: fix potential use-after-free on a5xx+
Rob Clark [Tue, 21 Mar 2017 14:01:02 +0000 (10:01 -0400)]
freedreno: fix potential use-after-free on a5xx+

Something that valgrind spotted:

==8441== Invalid read of size 4
==8441==    at 0x5DEE168: msm_ringbuffer_emit_reloc (msm_ringbuffer.c:506)
==8441==    by 0x5B48F0F: OUT_RELOCW (freedreno_util.h:241)
==8441==    by 0x5B48F0F: fd5_emit_blit (fd5_emit.h:131)
==8441==    by 0x5B48F0F: emit_gmem2mem_surf.isra.12 (fd5_gmem.c:450)
==8441==    by 0x5B4910F: fd5_emit_tile_gmem2mem (fd5_gmem.c:477)
==8441==    by 0x5B14943: render_tiles (freedreno_gmem.c:342)
==8441==    by 0x5B14943: fd_gmem_render_tiles (freedreno_gmem.c:416)
==8441==    by 0x5B0FBA7: batch_flush (freedreno_batch.c:281)
==8441==    by 0x5B0FBA7: fd_batch_flush (freedreno_batch.c:306)
==8441==    by 0x5B11FE7: fd_context_flush (freedreno_context.c:52)
==8441==    by 0x58AD783: st_glFlush (st_cb_flush.c:121)
==8441==    by 0x5751EE7: _mesa_make_current (context.c:1652)
==8441==    by 0x58E6A97: st_api_make_current (st_manager.c:811)
==8441==    by 0x5A2CE43: dri_unbind_context (dri_context.c:207)
==8441==    by 0x5A2C77F: driUnbindContext (dri_util.c:589)
==8441==    by 0x4AC8A67: MakeContextCurrent (glxcurrent.c:214)
==8441==  Address 0x6f5eb1c is 204 bytes inside a block of size 240 free'd
==8441==    at 0x4868F44: realloc (vg_replace_malloc.c:785)
==8441==    by 0x5DEE143: msm_ringbuffer_emit_reloc (msm_ringbuffer.c:502)
==8441==    by 0x5B48F0F: OUT_RELOCW (freedreno_util.h:241)
==8441==    by 0x5B48F0F: fd5_emit_blit (fd5_emit.h:131)
==8441==    by 0x5B48F0F: emit_gmem2mem_surf.isra.12 (fd5_gmem.c:450)
==8441==    by 0x5B4910F: fd5_emit_tile_gmem2mem (fd5_gmem.c:477)
==8441==    by 0x5B14943: render_tiles (freedreno_gmem.c:342)
==8441==    by 0x5B14943: fd_gmem_render_tiles (freedreno_gmem.c:416)
==8441==    by 0x5B0FBA7: batch_flush (freedreno_batch.c:281)
==8441==    by 0x5B0FBA7: fd_batch_flush (freedreno_batch.c:306)
==8441==    by 0x5B11FE7: fd_context_flush (freedreno_context.c:52)
==8441==    by 0x58AD783: st_glFlush (st_cb_flush.c:121)
==8441==    by 0x5751EE7: _mesa_make_current (context.c:1652)
==8441==    by 0x58E6A97: st_api_make_current (st_manager.c:811)
==8441==    by 0x5A2CE43: dri_unbind_context (dri_context.c:207)
==8441==    by 0x5A2C77F: driUnbindContext (dri_util.c:589)
==8441==  Block was alloc'd at
==8441==    at 0x4868F44: realloc (vg_replace_malloc.c:785)
==8441==    by 0x5DEE08B: msm_ringbuffer_emit_reloc (msm_ringbuffer.c:481)
==8441==    by 0x5B48F0F: OUT_RELOCW (freedreno_util.h:241)
==8441==    by 0x5B48F0F: fd5_emit_blit (fd5_emit.h:131)
==8441==    by 0x5B48F0F: emit_gmem2mem_surf.isra.12 (fd5_gmem.c:450)
==8441==    by 0x5B4909F: fd5_emit_tile_gmem2mem (fd5_gmem.c:465)
==8441==    by 0x5B14943: render_tiles (freedreno_gmem.c:342)
==8441==    by 0x5B14943: fd_gmem_render_tiles (freedreno_gmem.c:416)
==8441==    by 0x5B0FBA7: batch_flush (freedreno_batch.c:281)
==8441==    by 0x5B0FBA7: fd_batch_flush (freedreno_batch.c:306)
==8441==    by 0x5B11FE7: fd_context_flush (freedreno_context.c:52)
==8441==    by 0x58AD783: st_glFlush (st_cb_flush.c:121)
==8441==    by 0x5751EE7: _mesa_make_current (context.c:1652)
==8441==    by 0x58E6A97: st_api_make_current (st_manager.c:811)
==8441==    by 0x5A2CE43: dri_unbind_context (dri_context.c:207)
==8441==    by 0x5A2C77F: driUnbindContext (dri_util.c:589)

Signed-off-by: Rob Clark <robclark@freedesktop.org>
7 years agointel: Add handle to hashtable before freeing along an error path
Chris Wilson [Wed, 8 Mar 2017 21:00:59 +0000 (21:00 +0000)]
intel: Add handle to hashtable before freeing along an error path

drm_intel_gem_bo_free() unconditionally attempts to remove the handle
from the hashtable. This goes horribly wrong if we haven't already added
the bo to the hashtable.

Reported-by: Michael Thayer <michael.thayer@oracle.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
7 years agointel: avoid null pointer dereference
Thomas Hindoe Paaboel Andersen [Thu, 2 Feb 2017 22:57:29 +0000 (23:57 +0100)]
intel: avoid null pointer dereference

Move the dereference after the null check.
Fixes: 028715ee707469189505 ("intel: Avoid the need for most overflow
                              checks by using a scratch page.")
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agoautogen.sh: run git commands in the (potentially) git dir
Eric Engestrom [Fri, 3 Feb 2017 18:21:10 +0000 (18:21 +0000)]
autogen.sh: run git commands in the (potentially) git dir

If the build dir is outside of the git dir, the order matters :)

Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoautogen.sh: don't print old git-config values
Eric Engestrom [Fri, 3 Feb 2017 18:21:09 +0000 (18:21 +0000)]
autogen.sh: don't print old git-config values

Old values are of no interest to the user, so let's reduce the spam
a bit by hiding those.

Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoheaders: add explicit note against local changes in the README
Emil Velikov [Tue, 14 Feb 2017 01:34:14 +0000 (01:34 +0000)]
headers: add explicit note against local changes in the README

Even with the step by step guide people sometimes get confused.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
7 years agointel: Move 48b support to bo_gem->kflags
Chris Wilson [Sat, 11 Feb 2017 11:04:50 +0000 (11:04 +0000)]
intel: Move 48b support to bo_gem->kflags

Another boolean that can be set and used along side the other execobject
flags.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
7 years agointel: Move is_softpin to obj->kflags
Chris Wilson [Sat, 28 Jan 2017 16:32:23 +0000 (16:32 +0000)]
intel: Move is_softpin to obj->kflags

Use obj->kflags to set EXEC_OBJECT_PINNED when the object is softpinned,
and so remember to clear the softpin status when the object is freed
(and reused).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
7 years agoamdgpu: vamgr can be a struct instead of a pointer
Alex Xie [Sat, 28 Jan 2017 19:50:44 +0000 (21:50 +0200)]
amdgpu: vamgr can be a struct instead of a pointer

vamgr is an integral part of amdgpu_device. We don't need to calloc and free it.
This can save CPU time, reduce heap fragmentation.

Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Alex Xie <AlexBin.Xie@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
[Grazvydas Ignotas: rebase, correct a typo in commit message]
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agoamdgpu: vamgr_32 can be a struct instead of a pointer
Alex Xie [Sat, 28 Jan 2017 19:50:36 +0000 (21:50 +0200)]
amdgpu: vamgr_32 can be a struct instead of a pointer

vamgr_32 is an integral part of amdgpu_device. We don't need to calloc and free it.
This can save CPU time, reduce heap fragmentation.

Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Alex Xie <AlexBin.Xie@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
[Grazvydas Ignotas: rebase, correct a typo in commit message]
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agoamdgpu: Free/uninit vamgr_32 in theoretically correct order
Alex Xie [Sat, 28 Jan 2017 19:49:30 +0000 (21:49 +0200)]
amdgpu: Free/uninit vamgr_32 in theoretically correct order

vamgr_32 is a region inside general VAM range. It is better to free and
deinitialize it before general VAM range.

Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Alex Xie <AlexBin.Xie@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agoRemove unused tests/drmstat.c
Emil Velikov [Wed, 1 Feb 2017 15:29:38 +0000 (15:29 +0000)]
Remove unused tests/drmstat.c

Earlier commit removed all the legacy 'tests' but a file was left
danglig.

Fixes: 0c80fddd1d0 "tests: remove useless legacy tests"
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reported-by: Andreas Boll <andreas.boll.dev@gmail.com>
Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
7 years agoBump version for 2.4.75 release libdrm-2.4.75
Chad Versace [Fri, 27 Jan 2017 20:18:00 +0000 (12:18 -0800)]
Bump version for 2.4.75 release

For Intel explicit fencing.

Signed-off-by: Chad Versace <chadversary@chromium.org>
7 years agointel: fix make distcheck
Dave Airlie [Sat, 28 Jan 2017 01:13:52 +0000 (11:13 +1000)]
intel: fix make distcheck

Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agoRevert "Bump version for 2.4.75 release"
Dave Airlie [Sat, 28 Jan 2017 01:13:40 +0000 (11:13 +1000)]
Revert "Bump version for 2.4.75 release"

This reverts commit 736970c49beb9de7ab549f076069d52f4e7bc6f2.

7 years agoBump version for 2.4.75 release
Chad Versace [Fri, 27 Jan 2017 20:18:00 +0000 (12:18 -0800)]
Bump version for 2.4.75 release

For Intel explicit fencing.

Signed-off-by: Chad Versace <chadversary@chromium.org>
7 years agointel: Export a function to re-enable implicit synchronisation
Chris Wilson [Fri, 27 Jan 2017 20:25:04 +0000 (20:25 +0000)]
intel: Export a function to re-enable implicit synchronisation

Implicit synchronisation is the default behaviour of the kernel when
rendering with an execobject. It may be disabled with
drm_intel_gem_bo_disable_implicit_sync(), and then to restore it use
drm_intel_gem_bo_enable_implicit_sync().

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
7 years agointel: Clear execobject flags before preserving object in reuse cache
Chris Wilson [Fri, 27 Jan 2017 20:20:30 +0000 (20:20 +0000)]
intel: Clear execobject flags before preserving object in reuse cache

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
7 years agointel: Support passing of explicit fencing from execbuf
Chris Wilson [Sat, 20 Aug 2016 11:38:46 +0000 (12:38 +0100)]
intel: Support passing of explicit fencing from execbuf

Allow the caller to pass in an fd to an array of fences to control
serialisation of the execbuf in the kernel and on the GPU, and in return
allow creation of a fence fd for signaling the completion (and flushing)
of the batch. When the returned fence is signaled, all writes to the
buffers inside the batch will be complete and coherent from the cpu, or
other consumers. The return fence is a sync_file object and can be
passed to other users (such as atomic modesetting, or other drivers).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
7 years agointel: Allow the client to control implicit synchronisation
Chris Wilson [Sat, 20 Aug 2016 17:36:42 +0000 (18:36 +0100)]
intel: Allow the client to control implicit synchronisation

The kernel allows implicit synchronisation to be disabled on individual
buffers. Use at your own risk.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
7 years agoImport uapi/i915_drm.h from v4.10-rc5-950-g152d5750dda9
Chris Wilson [Fri, 27 Jan 2017 10:39:10 +0000 (10:39 +0000)]
Import uapi/i915_drm.h from v4.10-rc5-950-g152d5750dda9

To sync with "drm/i915: Support explicit fencing for execbuf"

7 years agoamdgpu: A new option to run tests on render node
Alex Xie [Tue, 24 Jan 2017 22:29:52 +0000 (17:29 -0500)]
amdgpu: A new option to run tests on render node

Tested:
1. As root, tests passed on primary.
2. As root, tests passed on render node.
   BO export/import test was skipped
3. As non-privileged user, tests failed on primary as expected.
4. As non-privileged user, tests passed on render node.
   BO export/import test was skipped

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Alex Xie <AlexBin.Xie@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agoamdgpu: A new option to choose which device to run most tests
Alex Xie [Tue, 24 Jan 2017 22:29:51 +0000 (17:29 -0500)]
amdgpu: A new option to choose which device to run most tests

This can be used to test multiple GPUs

v2: Use PCI bus ID and optional PCI device ID to choose device
    Add an option to display information of AMDGPU devices

Tested:
   ./amdgpu_test -p
   ./amdgpu_test
   ./amdgpu_test -b 1 #fail as expected
   ./amdgpu_test -b 6 #pass
   ./amdgpu_test -b -d 1 #fail as expected
   ./amdgpu_test -b -d 0 #pass

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Alex Xie <AlexBin.Xie@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agoamdgpu: verify the tested device
Alex Xie [Tue, 24 Jan 2017 22:29:50 +0000 (17:29 -0500)]
amdgpu: verify the tested device

Verify the vender ID and driver name.
Open all AMDGPU devices.
Provide an option to open render node.

Tested as root: PASS
Tested as non-privileged user:
All tests failed as expected

v2: Return value in the ene of function amdgpu_open_devices.
    Check the return value of amdgpu_open_devices.
    amdgpu_test is not for USB device for the time being.
    Get the name of node from function drmGetDevices2.
    Drop the legacy drmAvailable() from the test.

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Alex Xie <AlexBin.Xie@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
7 years agotests: Use -pthread in CFLAGS instead of -lpthread
Tomasz Figa [Fri, 27 Jan 2017 07:21:19 +0000 (16:21 +0900)]
tests: Use -pthread in CFLAGS instead of -lpthread

-lpthread is not always a valid flag to pull pthread support, especially
on Android it will fail to link due to a missing libpthread.so. The more
generic way to build-in pthread support is to use the -pthread CFLAG, so
let's use it instead.

Signed-off-by: Tomasz Figa <tfiga@chromium.org>
[Emil Velikov: rebase on top of previous commit]
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
7 years agotests/nouveau: automake: fold C and CPP flags
Emil Velikov [Fri, 27 Jan 2017 16:15:45 +0000 (16:15 +0000)]
tests/nouveau: automake: fold C and CPP flags

Since we don't have any C++ souces this should be a no-op. Folding the
two seems to be the common practise throughout the repo.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
7 years agoandroid: silence ~550 warnings
Emil Velikov [Sun, 22 Jan 2017 17:43:13 +0000 (17:43 +0000)]
android: silence ~550 warnings

Analogous to the autoconf build add the following to the build

   -Wno-unused-parameter
   -Wno-missing-field-initializers

Cc: Chih-Wei Huang <cwhuang@android-x86.org>
Cc: Rob Herring <robh@kernel.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Rob Herring <robh@kernel.org>
7 years agoandroid: add note about command line defines and config.h
Emil Velikov [Sun, 22 Jan 2017 17:06:05 +0000 (17:06 +0000)]
android: add note about command line defines and config.h

Cc: Chih-Wei Huang <cwhuang@android-x86.org>
Cc: Rob Herring <robh@kernel.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Rob Herring <robh@kernel.org>
7 years agoandroid: add HAVE_VISIBILITY to Android.common.mk
Emil Velikov [Sun, 22 Jan 2017 17:03:07 +0000 (17:03 +0000)]
android: add HAVE_VISIBILITY to Android.common.mk

Currently only libdrm.so properly annotates its internal/private
symbols. By setting the macro every binary produced will be in the same
boat. This should give is smaller and more secure files

Cc: Chih-Wei Huang <cwhuang@android-x86.org>
Cc: Rob Herring <robh@kernel.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Rob Herring <robh@kernel.org>
7 years agoandroid: introduce Android.common.mk to reduce boilerplate
Emil Velikov [Sun, 22 Jan 2017 16:59:42 +0000 (16:59 +0000)]
android: introduce Android.common.mk to reduce boilerplate

... across the makefiles. Currently this isn't much but that will change
shortly.

As an added bonus this fixes all present and future cases where we've
forgotten to strip out the headers from LOCAL_SRC_FILES.

In a couple of cases (the tests) we start setting
LOCAL_EXPORT_C_INCLUDE_DIRS, which shouldn't be an issue.

Cc: Chih-Wei Huang <cwhuang@android-x86.org>
Cc: Rob Herring <robh@kernel.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Rob Herring <robh@kernel.org>
7 years agoandroid: remove LOCAL_MODULE_TAGS := optional tag
Emil Velikov [Sun, 22 Jan 2017 16:16:27 +0000 (16:16 +0000)]
android: remove LOCAL_MODULE_TAGS := optional tag

Seems to be the default option since ~2009 with commit 2f31293ba78 "auto
import from //branches/cupcake/...@137197". Fleshed out from a larger
commit in the AOSP repo/fork.

Cc: Dan Willemsen <dwillemsen@google.com>
Cc: Chih-Wei Huang <cwhuang@android-x86.org>
Cc: Rob Herring <robh@kernel.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Rob Herring <robh@kernel.org>
7 years agoxf86drm: Reuse sysfs_uevent_get()
Thierry Reding [Wed, 18 Jan 2017 07:29:23 +0000 (08:29 +0100)]
xf86drm: Reuse sysfs_uevent_get()

Recent patches for USB, platform and host1x bus support introduced the
sysfs_uevent_get() function that provides a generic way of parsing the
sysfs uevent file that is associated with each device in Linux.

Open-coded variants of this still exist in other places, so make those
reuse the new function to remove some code duplication.

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
7 years agotests/drmdevice: Add USB, platform and host1x support
Thierry Reding [Thu, 12 Jan 2017 21:07:28 +0000 (22:07 +0100)]
tests/drmdevice: Add USB, platform and host1x support

Extend the drmdevice test with support for the newly added USB, platform
and host1x busses.

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
7 years agoxf86drm: Add platform and host1x bus support
Thierry Reding [Wed, 21 Dec 2016 16:59:04 +0000 (17:59 +0100)]
xf86drm: Add platform and host1x bus support

ARM SoCs usually have their DRM/KMS devices on the platform bus, so add
support for that to enable these devices to be used with the drmDevice
infrastructure.

NVIDIA Tegra SoCs have an additional level in the hierarchy and DRM/KMS
devices can also be on the host1x bus. This is mostly equivalent to the
platform bus.

v4:
- continue on error to process platform or host1x device

v3:
- guard Linux-specific sysfs parsing code with #ifdef __linux__

v2:
- be careful not to overflow the full name
- read compatible strings into device info

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
7 years agoxf86drm: Add USB support
Thierry Reding [Wed, 21 Dec 2016 23:39:36 +0000 (00:39 +0100)]
xf86drm: Add USB support

Allow DRM/KMS devices hosted on USB to be detected by the drmDevice
infrastructure.

v4:
- continue on error to process USB devices

v3:
- guard Linux-specific sysfs parsing code with #ifdef __linux__

v2:
- make sysfs_uevent_get() more flexible using a format string

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
7 years agoxf86drm: Factor out drmDeviceAlloc()
Thierry Reding [Wed, 21 Dec 2016 16:54:48 +0000 (17:54 +0100)]
xf86drm: Factor out drmDeviceAlloc()

Subsequent patches will add support for other bus types to drmDevice and
they will duplicate a lot of the code to allocate a drmDevice. Factor
out the common code so it can be reused.

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
7 years agotests/util: Add support for meson module
Neil Armstrong [Wed, 18 Jan 2017 13:59:21 +0000 (14:59 +0100)]
tests/util: Add support for meson module

Add support for Amlogic Meson DRM driver merged for Linux 4.10.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
7 years agoxf86drm: Fix type-punned pointer build warning
Thierry Reding [Mon, 13 Apr 2015 09:36:59 +0000 (11:36 +0200)]
xf86drm: Fix type-punned pointer build warning

      CC       libdrm_la-xf86drmMode.lo
    ../xf86drmMode.c: In function 'drmHandleEvent':
    ../xf86drmMode.c:854:15: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
       e = (struct drm_event *)(&buffer[i]);
                   ^

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99350
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>