OSDN Git Service

android-x86/external-libdrm.git
5 years agolibdrm: Fix issue about differrent domainID but same BDF
Emily Deng [Thu, 14 Feb 2019 07:53:38 +0000 (15:53 +0800)]
libdrm: Fix issue about differrent domainID but same BDF

For multiple GPUs which has the same BDF, but has different domain ID,
the drmOpenByBusid will return the wrong fd when startx.

The reproduce sequence as below:
1. Call drmOpenByBusid to open Card0, then will return the right fd0, and the
fd0 is master privilege;
2. Call drmOpenByBusid to open Card1. In function drmOpenByBusid, it will
open Card0 first, this time, the fd1 for opening Card0 is not master
privilege, and will call drmSetInterfaceVersion to identify the
domain ID feature, as the fd1 is not master privilege, then drmSetInterfaceVersion
will fail, and then won't compare domain ID, then return the wrong fd for Card1.

Solution:
First loop search the best match fd about drm 1.4.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Emily Deng <Emily.Deng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agogitlab-ci: fix archlinux builds
Eric Engestrom [Tue, 19 Feb 2019 11:49:28 +0000 (11:49 +0000)]
gitlab-ci: fix archlinux builds

base/archlinux has been replaced with archlinux/base, which is
maintained directly by the archlinux community.

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agofreedreno: revert bad freedreno/atomic_ops commits
Eric Engestrom [Tue, 19 Feb 2019 09:39:43 +0000 (09:39 +0000)]
freedreno: revert bad freedreno/atomic_ops commits

This reverts 6d2379857b6fccc1cade "xf86atomic: #undef internal define"
and b541d21a0a908bf98d44 "freedreno: remove always-defined #ifdef".

I didn't realise at the time that freedreno/freedreno_ringbuffer.h gets
installed, and then used by Mesa for instance. These two commits were
fine in libdrm, but broke Mesa which needs to use struct fd_ringbuffer
but doesn't need to access ::refcnt. The hack that I removed serves to
keep the struct at the correct size while only exposing the ::refcnt
member within libdrm.

Fixes: 6d2379857b6fccc1cade "xf86atomic: #undef internal define"
Fixes: b541d21a0a908bf98d44 "freedreno: remove always-defined #ifdef"
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agoxf86drm: fix return type for drmIsMaster()
Eric Engestrom [Fri, 8 Feb 2019 14:46:07 +0000 (14:46 +0000)]
xf86drm: fix return type for drmIsMaster()

Xserver has struct members named `bool`, which means the last commit
breaks its build with errors like this:

  error: two or more data types in declaration specifiers
  Bool bool;
       ^

Fix this by making it return a 0/1 integer, with the same semantic as
the boolean it was before.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=109587
Fixes: 17dfe3ac93217b43f93b "xf86drm: Add drmIsMaster()"
Cc: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
5 years agoxf86drm: Add drmIsMaster()
Christopher James Halse Rogers [Wed, 23 Jan 2019 04:38:45 +0000 (15:38 +1100)]
xf86drm: Add drmIsMaster()

We can't use drmSetMaster to query whether or not a drm fd is master
because it requires CAP_SYS_ADMIN, even if the fd *is* a master fd.

Pick DRM_IOCTL_MODE_ATTACHMODE as a long-deprecated ioctl that is
DRM_MASTER but not DRM_ROOT_ONLY as the probe by which we can detect
whether or not the fd is master.

This is useful for code that might get master by open()ing the drm device
while no other master exists, but can't call drmSetMaster itself because
it's not running as root or is in a container, where container-root isn't
real-root.

v2: Use the AUTH_MAGIC request rather than MODE_ATTACHMODE, as it's more
    clearly related to master status.

v3: [Emil] Don't expose internals, check for -EACCES.

Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> (v2)
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
5 years agointel: sync i915_pciids.h with kernel
Rodrigo Vivi [Sat, 2 Feb 2019 07:43:01 +0000 (23:43 -0800)]
intel: sync i915_pciids.h with kernel

Straight copy from the kernel file.

Add more PCI Device IDs for Coffee Lake, Ice Lake,
and Amber Lake. It also include a reorg on Whiskey Lake IDs.

Align with kernel commits:

5e0f5a58b167 ("drm/i915/cfl: Adding another PCI Device ID.")
03ca3cf8e9aa ("drm/i915/icl: Adding few more device IDs for Ice Lake")
c0c46ca461f1 ("drm/i915/aml: Add new Amber Lake PCI ID")
c1c8f6fa731b ("drm/i915: Redefine some Whiskey Lake SKUs")

Cc: José Roberto de Souza <jose.souza@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
5 years agoxf85drm: de-duplicate drmParse{Platform.Host1x}{Bus,Device}Info
Emil Velikov [Wed, 23 Jan 2019 10:39:12 +0000 (10:39 +0000)]
xf85drm: de-duplicate drmParse{Platform.Host1x}{Bus,Device}Info

The functions are virtually identical, fold them up.

v2: foo -> tmp_name (Eric)

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agoxf86drm: fallback to MODALIAS for OF less platform devices
Emil Velikov [Wed, 23 Jan 2019 09:44:07 +0000 (09:44 +0000)]
xf86drm: fallback to MODALIAS for OF less platform devices

Some devices can lack OF data or it may not be available in the uevent
file. Fallback to the MODALIAS data in those cases.

We strip any leading "MODALIAS=.*:" thus the resulting information is
compatible with existing code in Mesa.

v2: foo -> tmp_name

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Tested-by: Lucas Stach <l.stach@pengutronix.de> (v1)
5 years agoamdgpu: add some raven marketing names
Alex Deucher [Wed, 30 Jan 2019 16:32:03 +0000 (11:32 -0500)]
amdgpu: add some raven marketing names

Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agoBump the version to 2.4.97
Marek Olšák [Tue, 22 Jan 2019 16:18:47 +0000 (11:18 -0500)]
Bump the version to 2.4.97

5 years agoamdgpu: add a faster BO list API
Marek Olšák [Mon, 7 Jan 2019 18:28:12 +0000 (13:28 -0500)]
amdgpu: add a faster BO list API

Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
5 years agoamdgpu: update amdgpu_drm.h
Marek Olšák [Tue, 15 Jan 2019 19:15:22 +0000 (14:15 -0500)]
amdgpu: update amdgpu_drm.h

it's in kernel 5.0

Reviewed-by: Christian König <christian.koenig@amd.com>
5 years agoamdgpu: update to latest marketing names from 18.50
Alex Deucher [Fri, 14 Dec 2018 20:39:11 +0000 (15:39 -0500)]
amdgpu: update to latest marketing names from 18.50

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agoREADME: reflow the project description to improve readability
Eric Engestrom [Wed, 7 Nov 2018 16:15:32 +0000 (16:15 +0000)]
README: reflow the project description to improve readability

Also, move the sentence about "who would use libdrm" into its own paragraph,
as it is something people discovering libdrm will want to know.

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
5 years agoxf86atomic: #undef internal define
Eric Engestrom [Wed, 7 Nov 2018 17:57:02 +0000 (17:57 +0000)]
xf86atomic: #undef internal define

Thanks to the #error just above, any file including this header can only
see one state for this macro: defined, with the value `1`.
Let's just #undef it once we're done using it in here so that other
files don't misconstrue any meaning to it.

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
5 years agofreedreno: remove always-defined #ifdef
Eric Engestrom [Wed, 7 Nov 2018 17:23:55 +0000 (17:23 +0000)]
freedreno: remove always-defined #ifdef

While at it, let's include xf86atomic.h explicitly, instead of relying
on some other file accidentally including it before including this file.

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
5 years agoandroid: Fix 32-bit app crashing in 64-bit Android
Mauro Rossi [Tue, 11 Dec 2018 22:22:35 +0000 (23:22 +0100)]
android: Fix 32-bit app crashing in 64-bit Android

Seemingly the 64-bit int is always aligned to 8 in LP64.
But this is not hold in LP32.

Consequently sizeof(gralloc_drm_handle_t) are different
between LP64 (which is 18 ints) and LP32 (which is 16 ints).
As a result, 32-bit apps will crash in 64-bit OS since the
checking handle->base.numInts != GRALLOC_GBM_HANDLE_NUM_INTS
is true.

Fix it by always aligning 64-bit int to 8. Besides, to avoid
additional padding, just exchange the order of data_owner
and modifier. It aligns modifier to 8 natually.
This makes gralloc_drm_handle_t fit in 16 ints perfectly.

(v2) gralloc_drm_handle.h patch now applied in gralloc_handle.h
     and GRALLOC_HANDLE_VERSION updated to 4

Reported-by: Mauro Rossi <issor.oruam@gmail.com>
Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
Reviewed-by: Robert Foss <robert.foss@collabora.com>
5 years agogitignore: add _build
Lucas De Marchi [Thu, 27 Sep 2018 19:09:31 +0000 (12:09 -0700)]
gitignore: add _build

This is the directory used by meson/autotools (at least in the
.gitlab-ci configuration) so ignore the whole dir.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Acked-by: Emil Velikov <emil.velikov@collabora.com>
5 years agogitignore: sort file
Lucas De Marchi [Thu, 27 Sep 2018 19:08:22 +0000 (12:08 -0700)]
gitignore: sort file

LANG=C sort -u .gitignore | sponge .gitignore

This way it's easier to keep track of the entries.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Acked-by: Emil Velikov <emil.velikov@collabora.com>
5 years agotests/amdgpu/vcn: fix the nop command in IBs
Leo Liu [Tue, 11 Dec 2018 20:52:58 +0000 (15:52 -0500)]
tests/amdgpu/vcn: fix the nop command in IBs

Just make them properly i.e. put 0 to the Nop reg

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
5 years agolibdrm: Use DRM_IOCTL_GET_PCIINFO on DragonFly
François Tigeot [Wed, 12 Dec 2018 19:48:36 +0000 (20:48 +0100)]
libdrm: Use DRM_IOCTL_GET_PCIINFO on DragonFly

It is a cleaner and less fragile way to get PCI IDs than the one
currently used by local DPorts patches.

Signed-off-by: François Tigeot <ftigeot@wolfpond.org>
5 years agoxf86drm: implement drmParseSubsystemType for DragonFly
François Tigeot [Wed, 12 Dec 2018 19:48:35 +0000 (20:48 +0100)]
xf86drm: implement drmParseSubsystemType for DragonFly

Like on OpenBSD, the DragonFly BSD kernel only contains
pci drm drivers.

Signed-off-by: François Tigeot <ftigeot@wolfpond.org>
5 years agoamdgpu/test: Enable deadlock test for CI family (gfx7)
Andrey Grodzovsky [Tue, 11 Dec 2018 20:10:10 +0000 (15:10 -0500)]
amdgpu/test: Enable deadlock test for CI family (gfx7)

I retested GPU recovery with  Bonaire ASIC and it works.

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
5 years agoamdgpu: add VM test to exercise max/min address space
Christian König [Thu, 25 Oct 2018 14:32:39 +0000 (16:32 +0200)]
amdgpu: add VM test to exercise max/min address space

Make sure the kernel doesn't crash if we map something at the minimum/maximum address.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
5 years agodrm: Attempt to parse SPI devices as platform bus devices.
Eric Anholt [Fri, 16 Nov 2018 01:52:19 +0000 (17:52 -0800)]
drm: Attempt to parse SPI devices as platform bus devices.

For ARM systems with tinydrm displays attached to SPI, the bus name is
/spi but we have platform device info for the rest.  Fixes
eglInitialize() failures on hx8357d since the EGL_EXT_device_drm
changes.

Acked-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agoAvoid hardcoded strlens in drmParseSubsystemType().
Eric Anholt [Fri, 16 Nov 2018 01:48:53 +0000 (17:48 -0800)]
Avoid hardcoded strlens in drmParseSubsystemType().

Having people count characters is error-prone, when we could just have
a computer do it.

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agotests: skip drmdevice test if the machine doesn't have any drm device
Eric Engestrom [Fri, 9 Nov 2018 19:00:35 +0000 (19:00 +0000)]
tests: skip drmdevice test if the machine doesn't have any drm device

Error message was invalid too, negative values aren't the number of
devices, they're errno error codes.

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
5 years agomeson: fix typo in compiler flag
Eric Engestrom [Wed, 7 Nov 2018 16:50:06 +0000 (16:50 +0000)]
meson: fix typo in compiler flag

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
5 years agoxf86drmHash: remove unused loop variable
Eric Engestrom [Wed, 7 Nov 2018 14:30:29 +0000 (14:30 +0000)]
xf86drmHash: remove unused loop variable

Reported-by: Jan Vesely <jano.vesely@gmail.com>
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
5 years agoamdgpu/test: Disable deadlock tests for all non gfx8/9 ASICs.
Andrey Grodzovsky [Fri, 2 Nov 2018 16:11:49 +0000 (12:11 -0400)]
amdgpu/test: Disable deadlock tests for all non gfx8/9 ASICs.

Since only for those ASICs gpu reset is enabled by deafult.
Also update disable message and fix identation .

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
5 years agoamdgpu/test: Add illegal register and memory access test v2
Andrey Grodzovsky [Wed, 31 Oct 2018 18:01:44 +0000 (14:01 -0400)]
amdgpu/test: Add illegal register and memory access test v2

Illegal access will cause CP hang followed by job timeout and
recovery kicking in.
Also, disable the suite for all APU ASICs until GPU
reset issues for them will be resolved and GPU reset recovery
will be enabled by default.

v2:
Add KV to deasbled APUs list and add comments regarding
necessary kernel amdgpu paramteres to run the tests.

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodoc: Rename README&CONTRIBUTING to .rst
Daniel Vetter [Tue, 4 Sep 2018 12:47:31 +0000 (14:47 +0200)]
doc: Rename README&CONTRIBUTING to .rst

Looks much neater on the gitlab UI, e.g. on my personal libdrm fork:

https://gitlab.freedesktop.org/danvet/drm

Acked-by: Eric Engestrom <eric.engestrom@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
5 years agoBump to version 2.4.96
Rob Clark [Tue, 16 Oct 2018 14:32:43 +0000 (10:32 -0400)]
Bump to version 2.4.96

Signed-off-by: Rob Clark <robclark@freedesktop.org>
5 years agofreedreno/msm: fix c90 warning
Rob Clark [Sun, 14 Oct 2018 15:23:17 +0000 (11:23 -0400)]
freedreno/msm: fix c90 warning

Wasn't really sure how to switch the silly -Wdeclaration-after-statement
flag off on a per directory basis.  So make the code uglier instead.

5 years agofreedreno/kgsl: fix build
Rob Clark [Sun, 14 Oct 2018 15:23:03 +0000 (11:23 -0400)]
freedreno/kgsl: fix build

Signed-off-by: Rob Clark <robclark@freedesktop.org>
5 years agofreedreno/msm: handle ring-reloc to other stateobjs
Rob Clark [Thu, 11 Oct 2018 13:55:03 +0000 (09:55 -0400)]
freedreno/msm: handle ring-reloc to other stateobjs

Signed-off-by: Rob Clark <robclark@freedesktop.org>
5 years agofreedreno/msm: simplify msm_ringbuffer_flush()
Rob Clark [Thu, 11 Oct 2018 13:43:58 +0000 (09:43 -0400)]
freedreno/msm: simplify msm_ringbuffer_flush()

Now that it doesn't have to deal with ringmarkers we can simplify the
reloc handling.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
5 years agofreedreno/msm: use hashtable to track submit.cmds table
Rob Clark [Wed, 10 Oct 2018 16:51:33 +0000 (12:51 -0400)]
freedreno/msm: use hashtable to track submit.cmds table

With streaming stateobjs to upload uniforms, the submit.cmds table gets
much larger, and iterating over it for each ring to ring reloc starts
getting expensive.

TODO if we have flag to pass when constructing parent rb, we could
avoid dynamically allocating this and bo_table in get_cmd() or bo2idx

Signed-off-by: Rob Clark <robclark@freedesktop.org>
5 years agofreedreno/msm: simplify emit_reloc_ring() vfunc
Rob Clark [Wed, 10 Oct 2018 15:10:39 +0000 (11:10 -0400)]
freedreno/msm: simplify emit_reloc_ring() vfunc

Now that it doesn't have to deal with the ringmarker case, we can make
some simplifications.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
5 years agofreedreno/msm: remove reset of linked rings
Rob Clark [Thu, 11 Oct 2018 17:51:14 +0000 (13:51 -0400)]
freedreno/msm: remove reset of linked rings

The msm_cmd isn't refcount'd, so with stateobj rb's that have
independent lifecycle, this is no longer a safe thing to do.
Really, now that there is a bo-cache for rb's, fd_ringbuffer_reset()
should be deprecated because it adds a bunch of pointless complexity.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
5 years agofreedreno: remove deprecated ringmarker API
Rob Clark [Wed, 10 Oct 2018 14:47:17 +0000 (10:47 -0400)]
freedreno: remove deprecated ringmarker API

It's usage in mesa was removed more than two years ago.  And it stands
in the way of some optimizations needed to reduce the overhead of hw
stateobjs (ie. CP_SET_DRAW_STATE, where the # of cmds in the submit
ioctl goes up significantly).

Signed-off-by: Rob Clark <robclark@freedesktop.org>
5 years agofreedreno/msm: support suballocation for stateobj rb's
Rob Clark [Mon, 8 Oct 2018 19:33:02 +0000 (15:33 -0400)]
freedreno/msm: support suballocation for stateobj rb's

Signed-off-by: Rob Clark <robclark@freedesktop.org>
5 years agofreedreno: add flags param for rb creation
Rob Clark [Wed, 10 Oct 2018 12:37:23 +0000 (08:37 -0400)]
freedreno: add flags param for rb creation

For now, we want a way for gallium to be able to provide hints for the
upcoming rb suballocation.  But could be useful for other things down
the road.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
5 years agofreedreno: expose refcnt'ing on ringbuffers
Rob Clark [Tue, 9 Oct 2018 19:33:39 +0000 (15:33 -0400)]
freedreno: expose refcnt'ing on ringbuffers

Move this out of msm_ringbuffer backend so that the gallium driver can
refcnt rb's

Signed-off-by: Rob Clark <robclark@freedesktop.org>
5 years agofreedreno/msm: get rid of ring_bo unref hack
Rob Clark [Tue, 9 Oct 2018 12:24:06 +0000 (08:24 -0400)]
freedreno/msm: get rid of ring_bo unref hack

Since 28328298 'freedreno: move ring_cache behind fd_bo_del()' this hack
is no longer necessary.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
5 years agoxf86drmHash: remove redundant zero init
Rob Clark [Thu, 11 Oct 2018 23:18:10 +0000 (19:18 -0400)]
xf86drmHash: remove redundant zero init

drmMalloc() is already calloc()

Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
5 years agoamdgpu/test: Fix deadlock tests for AI and RV v2
Andrey Grodzovsky [Thu, 27 Sep 2018 17:12:57 +0000 (13:12 -0400)]
amdgpu/test: Fix deadlock tests for AI and RV v2

Seems like AI and RV requires uncashed memory mapping to be able
to pickup value written to memory by CPU after the WAIT_REG_MEM
command was already launched.
.
Enable the test for AI and RV.

v2:
Update commit description.

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
5 years agoamdgpu/test: Allow BO mapping flags to be passed in tests
Andrey Grodzovsky [Thu, 27 Sep 2018 17:10:55 +0000 (13:10 -0400)]
amdgpu/test: Allow BO mapping flags to be passed in tests

v2:
Call amdgpu_bo_va_op_raw directly in amdgpu_bo_alloc_and_map_raw
Move amdgpu_bo_alloc_and_map_raw into C file to avoid including
unistd.h in amdgpu_test.h

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
5 years agolibdrm: Allow dynamic drm majors on linux
Thomas Hellstrom [Fri, 31 Aug 2018 11:47:05 +0000 (13:47 +0200)]
libdrm: Allow dynamic drm majors on linux

To determine whether a device node is a drm device node or not, the code
currently compares the node's major number to the static drm major device
number.

This breaks the standalone vmwgfx driver on XWayland dri clients,
https://cgit.freedesktop.org/mesa/vmwgfx
and any future attempt to introduce dynamic device numbers for drm.

So instead of checking for the device major, instead check for the presence
of the /sys/dev/char/<major>:<minor>/device/drm directory.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Acked-by: Dave Airlie <airlied@redhat.com>
5 years agoBump to version 2.4.95
Emil Velikov [Thu, 4 Oct 2018 14:08:17 +0000 (15:08 +0100)]
Bump to version 2.4.95

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
5 years agointel: include i915_pciids.h in the tarball
Emil Velikov [Thu, 4 Oct 2018 14:16:22 +0000 (15:16 +0100)]
intel: include i915_pciids.h in the tarball

Fixes: 4e81d4f9c9b ("intel: add generic functions to check PCI ID")
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
5 years agoRevert "Bump to version 2.4.95"
Emil Velikov [Thu, 4 Oct 2018 14:22:18 +0000 (15:22 +0100)]
Revert "Bump to version 2.4.95"

This reverts commit 6e50a309afb340088d7da762f4434d409216caf2.

5 years agoBump to version 2.4.95
Emil Velikov [Thu, 4 Oct 2018 14:08:17 +0000 (15:08 +0100)]
Bump to version 2.4.95

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
5 years agolibdrm: headers: Sync with drm-next
Ayan Kumar Halder [Mon, 1 Oct 2018 15:09:18 +0000 (16:09 +0100)]
libdrm: headers: Sync with drm-next

Generated using make headers_install from the drm-next
tree - git://anongit.freedesktop.org/drm/drm
branch - drm-next
commit - 2dc7bad71cd310dc94d1c9907909324dd2b0618f

The changes were as follows :-

  core: (drm.h, drm_fourcc.h, drm_mode.h)
    - Added client capabilities for ASPECT_RATIO and WRITEBACK_CONNECTORS
    - Added Arm AFBC modifiers
    - Added BROADCOM's SAND and UIF modifiers
    - Added Qualcomm's modifiers
    - Added some picture aspect ratio and content type options
    - Added some drm mode flags
    - Added writeback connector id

  amdgpu:
    - Added GEM domain mask
    - Added some GEM flags
    - Added some hardware ip flags
    - Added chunk id and IB fence.
    - Added some query ids

  i915:
    -Added an IOCTL (I915_PARAM_MMAP_GTT_COHERENT)

  qxl:
    - Minor changes

  tegra:
    - Added some comments about struct drm_tegra* members
    - Modified DRM_IOCTL_TEGRA_CLOSE_CHANNEL

  vc4:
    - Added some members for 'struct drm_vc4_submit_cl'

Changes in v2:
    - Mentioned 'libdrm' in the commit header.

Changes in v3:
    - Removed the changes to radeon_drm.h, sis_drm.h and via_drm.h as suggested by
      Emil Velikov <emil.l.velikov@gmail.com>

Changes in v4:
    - Removed the changes to vmwgfx_drm.h as it caused a build break ie
      'make check' failed.

Change-Id: I018a06f65bf4a6a68400ab252b9cd05d041299b3
Signed-off-by: Ayan Kumar halder <ayan.halder@arm.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
5 years agogitlab-ci: pass the correct toggles to configure
Emil Velikov [Tue, 25 Sep 2018 15:15:18 +0000 (16:15 +0100)]
gitlab-ci: pass the correct toggles to configure

Trivial typos - s/admgpu/amdgpu/;s/vmwfgx/vmwgfx/

Fixes: 4a9030dc8b7 ("add gitlab-ci builds of libdrm")
Cc: Brian Starkey <brian.starkey@arm.com>
Reported-by: Brian Starkey <brian.starkey@arm.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agotests/util: Add support for sun4i-drm driver
Ezequiel Garcia [Sat, 22 Sep 2018 13:28:39 +0000 (10:28 -0300)]
tests/util: Add support for sun4i-drm driver

This is the DRM driver for all Allwinner (sunxi) platforms.

Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
5 years agoandroid: make symbols hidden by default
Lucas De Marchi [Thu, 20 Sep 2018 06:05:48 +0000 (23:05 -0700)]
android: make symbols hidden by default

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
5 years ago*-symbols-check: error out when using unset variables
Emil Velikov [Thu, 6 Sep 2018 14:50:59 +0000 (15:50 +0100)]
*-symbols-check: error out when using unset variables

It will make bugs like the one fixed with previous patch dead obvious.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agoautomake: set NM before running the tests
Emil Velikov [Thu, 6 Sep 2018 14:46:16 +0000 (15:46 +0100)]
automake: set NM before running the tests

Set/export the NM variable since it may not be set already.

Fixes: 4f08bfe96da ("*-symbol-check: Don't hard-code nm executable")
Cc: Heiko Becker <heirecka@exherbo.org>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agoCI: Capture test logs as GitLab artifacts
Daniel Stone [Thu, 6 Sep 2018 10:01:17 +0000 (11:01 +0100)]
CI: Capture test logs as GitLab artifacts

GitLab CI already captures all the stdout/stderr output from the build
process as the log. However, some other important information is hidden
in other log files.

Taken from Wayland, capture logs from the configuration process as well
as from every check.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Cc: Rodrigo Vivi <rodrigo.vivi@gmail.com>
Cc: Lucas De Marchi <lucas.de.marchi@gmail.com>
Cc: Eric Engeström <eric.engestrom@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Eric Engestrom <eric.engestrom@intel.com>
[Emil: use wildcard to match the artefacts]
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
5 years agomodeprint: print encoder type
Stefan Agner [Wed, 5 Sep 2018 18:00:21 +0000 (11:00 -0700)]
modeprint: print encoder type

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
5 years agomodeprint: use libutil to lookup strings
Stefan Agner [Wed, 5 Sep 2018 18:00:19 +0000 (11:00 -0700)]
modeprint: use libutil to lookup strings

Use libutil to lookup connector type names and state. This also
makes sure that the latest connector type addition "DPI" gets
printed correctly.

Signed-off-by: Stefan Agner <stefan@agner.ch>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
5 years agofreedreno: add missing drm_public
Eric Engestrom [Thu, 20 Sep 2018 18:24:10 +0000 (19:24 +0100)]
freedreno: add missing drm_public

Fixes: 9a1470fb410bbc840459 "freedreno: annotate public functions"
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agoomap: fix symbol annotations
Eric Engestrom [Thu, 20 Sep 2018 17:27:18 +0000 (18:27 +0100)]
omap: fix symbol annotations

Fixes: f3f7266d94e0354bfd97 "omap: annotate public functions"
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
5 years agoradeon: add missing drm_public exports
Eric Engestrom [Thu, 20 Sep 2018 15:53:08 +0000 (16:53 +0100)]
radeon: add missing drm_public exports

Fixes: 9f45264815eff6ebeba3 "radeon: annotate public functions"
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Mark Janes <mark.a.janes@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108006
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
5 years agonouveau: add missing drm_public exports
Eric Engestrom [Thu, 20 Sep 2018 15:52:30 +0000 (16:52 +0100)]
nouveau: add missing drm_public exports

Fixes: d7320bfcddc596f23fa2 "nouveau: annotate public functions"
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Mark Janes <mark.a.janes@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108006
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Tested-by: Dylan Baker <dylan@pnwbakers.com>
5 years agointel: add missing drm_public exports
Eric Engestrom [Thu, 20 Sep 2018 15:51:45 +0000 (16:51 +0100)]
intel: add missing drm_public exports

Fixes: 36bb0ea47b71d220b31e "intel: annotate public functions"
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Mark Janes <mark.a.janes@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108006
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Tested-by: Dylan Baker <dylan@pnwbakers.com>
5 years agoautotools: make symbols hidden by default
Lucas De Marchi [Thu, 13 Sep 2018 23:24:32 +0000 (16:24 -0700)]
autotools: make symbols hidden by default

Now that symbols that should be exported are annotated accordingly, make
all the rest hidden by default.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Acked-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agomeson: make symbols hidden by default
Lucas De Marchi [Wed, 12 Sep 2018 20:24:12 +0000 (13:24 -0700)]
meson: make symbols hidden by default

Now that symbols that should be exported are annotated accordingly, make
all the rest hidden by default.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agoexynos: annotate public functions
Lucas De Marchi [Thu, 13 Sep 2018 23:13:06 +0000 (16:13 -0700)]
exynos: annotate public functions

while read sym; do
read f func line _ <<<$(cscope -d -L -1 $sym)
if [ ! -z "$f" ]; then
sed -i "${line}s/^/drm_public /" $f
fi
done < /tmp/a.txt

In which /tmp/a.txt contains the public symbols from
exynos-symbol-check. The idea here will be to switch the default
visibility to hidden so we don't export symbols we shouldn't.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Acked-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agotegra: annotate public functions
Lucas De Marchi [Thu, 13 Sep 2018 23:06:31 +0000 (16:06 -0700)]
tegra: annotate public functions

while read sym; do
read f func line _ <<<$(cscope -d -L -1 $sym)
if [ ! -z "$f" ]; then
sed -i "${line}s/^/drm_public /" $f
fi
done < /tmp/a.txt

In which /tmp/a.txt contains the public symbols from
tegra-symbol-check. The idea here will be to switch the default
visibility to hidden so we don't export symbols we shouldn't.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Acked-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agoradeon: annotate public functions
Lucas De Marchi [Thu, 13 Sep 2018 23:05:15 +0000 (16:05 -0700)]
radeon: annotate public functions

while read sym; do
read f func line _ <<<$(cscope -d -L -1 $sym)
if [ ! -z "$f" ]; then
sed -i "${line}s/^/drm_public /" $f
fi
done < /tmp/a.txt

In which /tmp/a.txt contains the public symbols from
radeon-symbol-check. The idea here will be to switch the default
visibility to hidden so we don't export symbols we shouldn't.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Acked-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agoomap: annotate public functions
Lucas De Marchi [Thu, 13 Sep 2018 22:55:46 +0000 (15:55 -0700)]
omap: annotate public functions

while read sym; do
read f func line _ <<<$(cscope -d -L -1 $sym)
if [ ! -z "$f" ]; then
sed -i "${line}s/^/drm_public /" $f
fi
done < /tmp/a.txt

In which /tmp/a.txt contains the public symbols from
omap-symbol-check. The idea here will be to switch the default
visibility to hidden so we don't export symbols we shouldn't.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Acked-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agofreedreno: annotate public functions
Lucas De Marchi [Thu, 13 Sep 2018 22:49:18 +0000 (15:49 -0700)]
freedreno: annotate public functions

while read sym; do
read f func line _ <<<$(cscope -d -L -1 $sym)
if [ ! -z "$f" ]; then
sed -i "${line}s/^/drm_public /" $f
fi
done < /tmp/a.txt

In which /tmp/a.txt contains the public symbols from
freedreno-symbol-check. The idea here will be to switch the default
visibility to hidden so we don't export symbols we shouldn't.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Acked-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agoetnaviv: annotate public functions
Lucas De Marchi [Thu, 13 Sep 2018 22:49:18 +0000 (15:49 -0700)]
etnaviv: annotate public functions

while read sym; do
read f func line _ <<<$(cscope -d -L -1 $sym)
if [ ! -z "$f" ]; then
sed -i "${line}s/^/drm_public /" $f
fi
done < /tmp/a.txt

In which /tmp/a.txt contains the public symbols from
etnaviv-symbol-check. The idea here will be to switch the default
visibility to hidden so we don't export symbols we shouldn't.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Acked-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agolibdrm: annotate public functions
Lucas De Marchi [Thu, 13 Sep 2018 22:42:26 +0000 (15:42 -0700)]
libdrm: annotate public functions

This was done with:
nm --dynamic --defined-only build/libdrm.so | \
grep " T " | \
grep -v _fini | grep -v _init | \
cut -d' ' -f3 > /tmp/a.txt

while read sym; do
read f func line _ <<<$(cscope -d -L -1 $sym)
if [ ! -z "$f" ]; then
sed -i "${line}s/^/drm_public /" $f
fi
done < /tmp/a.txt

Then the alignment of function arguments were manually fixed all over.
The idea here will be to switch the default visibility to hidden so we
don't export symbols we shouldn't.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agoamdgpu: annotate public functions
Lucas De Marchi [Thu, 13 Sep 2018 21:57:13 +0000 (14:57 -0700)]
amdgpu: annotate public functions

This was done with:
nm --dynamic --defined-only build/amdgpu/libdrm_amdgpu.so | \
grep amdgpu_ | \
cut -d' ' -f3 > /tmp/a.txt

while read sym; do
read f func line _ <<<$(cscope -d -L -1 $sym)
if [ ! -z "$f" ]; then
line=$((line-1))
sed -i "${line}s/^/drm_public /" $f
fi
done < /tmp/a.txt

Then the alignment of function arguments were manually fixed all over.
The idea here will be to switch the default visibility to hidden so we
don't export symbols we shouldn't.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Acked-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
5 years agonouveau: annotate public functions
Lucas De Marchi [Thu, 13 Sep 2018 21:39:50 +0000 (14:39 -0700)]
nouveau: annotate public functions

This was done with:
nm --dynamic --defined-only build/nouveau/libdrm_nouveau.so | \
grep nouveau_ | \
cut -d ' ' -f3 > /tmp/a.txt

while read sym; do
read f func line _ <<<$(cscope -d -L -1 $sym)
if [ ! -z "$f" ]; then
line=$((line-1))
sed -i "${line}s/^/drm_public /" $f
fi
done < /tmp/a.txt

Then some corner cases were manually fixed. The idea here will be to
switch the default visibility to hidden so we don't export symbols we
shouldn't.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Acked-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agolibkms: annotate public functions
Lucas De Marchi [Thu, 13 Sep 2018 20:00:55 +0000 (13:00 -0700)]
libkms: annotate public functions

This was done with:
nm --dynamic --defined-only build/libkms/libkms.so | \
grep kms_ | \
cut -d' ' -f3 > /tmp/a.txt

while read sym; do
read f func line _ <<<$(cscope -d -L -1 $sym)
if [ ! -z "$f" ]; then
sed -i "${line}s/^/drm_public /" $f
fi
done < /tmp/a.txt

The idea here will be to switch the default visibility to hidden so we
don't export symbols we shouldn't.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Acked-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agointel: annotate public functions
Lucas De Marchi [Wed, 12 Sep 2018 20:09:08 +0000 (13:09 -0700)]
intel: annotate public functions

This was done with:
while read sym; do
read f func line _ <<<$(cscope -d -L -1 $sym)
if [ ! -z "$f" ]; then
line=$((line-1))
sed -i "${line}s/^/drm_public /" $f
fi
done < /tmp/a.txt

Then some corner cases were manually fixed. "a.txt" above contains the
symbols collected from intel/intel-symbol-check. The idea here will be
to switch the default visibility to hidden so we don't export symbols we
shouldn't.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agoheaders/README: fix/add link to drm-next
Eric Engestrom [Tue, 18 Sep 2018 15:22:42 +0000 (16:22 +0100)]
headers/README: fix/add link to drm-next

Reviewed-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agotest/amdgpu: add GDS, GWS and OA tests
Christian König [Fri, 14 Sep 2018 13:08:06 +0000 (15:08 +0200)]
test/amdgpu: add GDS, GWS and OA tests

Add allocation tests for GDW, GWS and OA.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
5 years agotest/amdgpu: add proper error handling v2
Christian König [Fri, 14 Sep 2018 13:04:38 +0000 (15:04 +0200)]
test/amdgpu: add proper error handling v2

Otherwise the calling function won't notice that something is wrong.

v2: check map result as well

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
5 years agoamdgpu: remove invalid check in amdgpu_bo_alloc
Christian König [Fri, 14 Sep 2018 12:58:24 +0000 (14:58 +0200)]
amdgpu: remove invalid check in amdgpu_bo_alloc

The heap is checked by the kernel and not libdrm, to make it even worse
it prevented allocating resources other than VRAM and GTT.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
5 years agofreedreno: move ring_cache behind fd_bo_del()
Rob Clark [Fri, 17 Aug 2018 19:58:17 +0000 (15:58 -0400)]
freedreno: move ring_cache behind fd_bo_del()

So that it isn't bypassing normal refcnt'ing.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
5 years agofreedreno: fix spelling typo
Rob Clark [Fri, 17 Aug 2018 19:44:40 +0000 (15:44 -0400)]
freedreno: fix spelling typo

Signed-off-by: Rob Clark <robclark@freedesktop.org>
5 years agotests/amdgpu: add unaligned VM test
Christian König [Fri, 7 Sep 2018 11:25:01 +0000 (13:25 +0200)]
tests/amdgpu: add unaligned VM test

Make a VM mapping which is as unaligned as possible.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
5 years agointel: annotate the intel genx helpers as private
Emil Velikov [Thu, 6 Sep 2018 15:14:07 +0000 (16:14 +0100)]
intel: annotate the intel genx helpers as private

They're used internally and never meant to be part of the API.
Add the drm_private notation, which should resolve that.

v2: (Rodrigo) Add missing include.
v3: (Rodrigo) Keep includes grouped per Eric suggestion.

Cc: Eric Engestrom <eric.engestrom@intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Fixes: 4e81d4f9c9b ("intel: add generic functions to check PCI ID")
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agogitlab-ci: use templates to deduplicate the build commands
Eric Engestrom [Thu, 6 Sep 2018 11:10:50 +0000 (12:10 +0100)]
gitlab-ci: use templates to deduplicate the build commands

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
5 years agointel: get gen once for gen >= 9
Lucas De Marchi [Wed, 5 Sep 2018 18:32:00 +0000 (11:32 -0700)]
intel: get gen once for gen >= 9

We don't need to call IS_GEN() for each gen >= 9: we can rather use the
new intel_is_genx() helper to iterate the pciids array once.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
5 years agointel: make gen9 use generic gen macro
Lucas De Marchi [Wed, 5 Sep 2018 18:31:59 +0000 (11:31 -0700)]
intel: make gen9 use generic gen macro

The 2 PCI IDs that are used for the command line overrid mechanism
were left defined. The rest can be gone and then we just use the kernel
defines.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
5 years agointel: make gen10 use generic gen macro
Lucas De Marchi [Wed, 5 Sep 2018 18:31:58 +0000 (11:31 -0700)]
intel: make gen10 use generic gen macro

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
5 years agointel: make gen11 use generic gen macro
Lucas De Marchi [Wed, 5 Sep 2018 18:31:57 +0000 (11:31 -0700)]
intel: make gen11 use generic gen macro

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
5 years agointel: add generic functions to check PCI ID
Lucas De Marchi [Wed, 5 Sep 2018 18:31:56 +0000 (11:31 -0700)]
intel: add generic functions to check PCI ID

This will allow platforms to reuse kernel IDs instead of manually
keeping them in sync. In most of the cases we only need to extend
IS_9XX().  Current platforms that fit this requirement can be ported
over to use this macro. Right now it's a nop since it doesn't have any
PCI ID added.

The i915_pciids.h header is in sync with kernel tree on
drm-tip 2018y-08m-20d-21h-41m-11s.

v2: - move to a separate .c so we can have the array in a single
      compilation unit
    - use a single array for all gens
    - add real functions to get or check gen by pciid
    - define our own pci device struct rather than inherit the one
      kernel uses: we can throw away most of the fields

v3: - add comment to keep ids sorted by gen
    - remove misleading comment about all gens

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
5 years agoxf86drm: rename "real_path" to "pci_path"
Eric Engestrom [Wed, 5 Sep 2018 12:29:08 +0000 (13:29 +0100)]
xf86drm: rename "real_path" to "pci_path"

"real_path" was getting confusing when there are other *paths in the
same functions.

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
5 years agoxf86drm: merge get_normal_pci_path() into get_real_pci_path()
Eric Engestrom [Wed, 5 Sep 2018 12:23:59 +0000 (13:23 +0100)]
xf86drm: merge get_normal_pci_path() into get_real_pci_path()

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
5 years agoFix build with -std=c11
Tom Anderson [Wed, 25 Jul 2018 19:06:29 +0000 (12:06 -0700)]
Fix build with -std=c11

typeof() is a GNU extension that will only work when the compiler is passed
-std=gnu*.  __typeof__() works with -std=c*, however.
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agoadd gitlab-ci builds of libdrm
Eric Engestrom [Thu, 30 Aug 2018 14:51:40 +0000 (15:51 +0100)]
add gitlab-ci builds of libdrm

It currently does 4 builds: 2 using Meson and 2 using Autotools, 2 using
the latest dependencies on ArchLinux and 2 using very old dependencies
on Debian (including manually building libpciaccess to have the oldest
version supported, to make sure it keeps being supported).

All the build options are turned on for both Meson and Autotools.

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Daniel Stone <daniels@collabora.com>
5 years agoAdd basic CONTRIBUTING file
Daniel Vetter [Wed, 15 Aug 2018 17:04:45 +0000 (19:04 +0200)]
Add basic CONTRIBUTING file

I picked up a bunch of the pieces from wayland's version:

https://gitlab.freedesktop.org/wayland/wayland/blob/master/CONTRIBUTING.md

The weston one is fairly similar. Then I rather massively trimmed it
down since in reality libdrm is a bit a dumping ground with very few
real rules. The commit rights and CoC sections I've copied verbatim
from igt respectively drm-misc. Weston/Wayland only differ in their
pick of how many patches you need (10 instead of 5). I think for
libdrm this is supremely relevant, since most everyone will get their
commit rights by contributing already to the kernel or mesa and having
commit rights there already.

Anyway, I figured this is good to get the rules documented, even if
there's mostly not many rules.

Note: This references maintainers in a MAINTAINERS file, which needs
to be created first.

Note: With the gitlab migration the entire commit rights process is
still a bit up in the air. But gitlab commit rights and roles are
hierarchical, so we can do libdrm-only maintainer/commiter roles
("Owner" and "Developer" in gitlab-speak). This should avoid
conflating libdrm roles with mesa roles, useful for those pushing to
libdrm as primarily kernel contributors.

v2: Comments from Emil:
- Recommend subject prefix.
- Fix copypaste fumbles, this isn't igt/wayland ...

v3: Comments from Marek:
- libdrm moved to mesa, update the document. Atm the entire account
  request situation is entirely not clear for gitlab and mesa
  projects, so that's a bit up in the air. Also, should probably send
  an announcement to dri-devel@, which didn't happen.
- amd folks don't submit their patches to dri-devel, document that.
  Probably applies to other drivers too.

v4: Comments from Rob:
- Also include kernel/userspace in the commit counts criteria, due to
  libdrm's special role as a glue library.

v5: Summarize the irc discussion on gitlab roles in the commit message
a bit.

v6: Some grammer stuff from Eric E.

v7: Use --local in git config (Eric E.)

Cc: Dave Airlie <airlied@gmail.com>
Cc: Michel Dänzer <michel@daenzer.net>
Cc: Emil Velikov <emil.velikov@collabora.com>
Cc: Marek Olšák <marek.olsak@amd.com>
Cc: Rob Clark <robdclark@gmail.com>
Cc: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Rob Clark <robdclark@gmail.com> (v4)
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com> (v6)
Acked-by: Emil Velikov <emil.l.velikov@gmail.com> (v6)
Acked-by: Marek Olšák <marek.olsak@amd.com> (v5)
Acked-by: Dave Airlie <airlied@redhat.com>
References: https://gitlab.freedesktop.org/wayland/weston/blob/master/CONTRIBUTING.md
References: https://01.org/linuxgraphics/gfx-docs/maintainer-tools/drm-misc.html#commit-rights
References: https://cgit.freedesktop.org/drm/igt-gpu-tools/tree/CONTRIBUTING#n54
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
5 years agoamdgpu: amdgpu_bo_inc_ref don't return dummy int
Qiang Yu [Mon, 3 Sep 2018 10:06:02 +0000 (18:06 +0800)]
amdgpu: amdgpu_bo_inc_ref don't return dummy int

Signed-off-by: Qiang Yu <Qiang.Yu@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>