OSDN Git Service

android-x86/external-libdrm.git
4 years agolibdrm: remove autotools support
Eric Engestrom [Wed, 7 Nov 2018 15:30:55 +0000 (15:30 +0000)]
libdrm: remove autotools support

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
4 years agoRELEASING: update instructions to use meson instead of autotools
Eric Engestrom [Wed, 19 Dec 2018 12:16:25 +0000 (12:16 +0000)]
RELEASING: update instructions to use meson instead of autotools

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Acked-by: Dylan Baker <dylan@pnwbakers.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
4 years ago*-symbols-check: let meson figure out how to execute the scripts
Eric Engestrom [Fri, 4 Oct 2019 08:37:31 +0000 (09:37 +0100)]
*-symbols-check: let meson figure out how to execute the scripts

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
4 years ago*-symbols-check: use normal shell over bash
Emil Velikov [Sun, 16 Jun 2019 13:23:41 +0000 (14:23 +0100)]
*-symbols-check: use normal shell over bash

None of the tests are bash specific. Tested with bash, zsh, dash, mksh
and ksh.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Niclas Zeising <zeising@daemonic.se>
Reviewed-by: Niclas Zeising <zeising@daemonic.se>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
4 years agomeson.build: Fix header detection on FreeBSD
Niclas Zeising [Sun, 16 Jun 2019 13:23:43 +0000 (14:23 +0100)]
meson.build: Fix header detection on FreeBSD

FreeBSD requires sys/types.h for sys/sysctl.h, add it as part of the
includes when checking for headers.
Instead of splitting out the check for sys/sysctl.h from the other
header checks, just add sys/types.h to all header checks.

v2 [Emil]
 - add inline comment
 - drop bash/sh hunk

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Niclas Zeising <zeising@daemonic.se>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
4 years agomeson.build: Fix typo
Niclas Zeising [Sun, 16 Jun 2019 13:23:40 +0000 (14:23 +0100)]
meson.build: Fix typo

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
4 years agotests/amdgpu: add the missing deactivation case for dispatch test
Le Ma [Mon, 5 Aug 2019 02:08:44 +0000 (10:08 +0800)]
tests/amdgpu: add the missing deactivation case for dispatch test

Signed-off-by: Le Ma <le.ma@amd.com>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agoamdgpu: add ras feature capability check in inject test
Guchun Chen [Wed, 28 Aug 2019 10:25:43 +0000 (18:25 +0800)]
amdgpu: add ras feature capability check in inject test

When running ras inject test, it's needed to be aligned
with kernel's ras enablement.

Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Guchun Chen <guchun.chen@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agoamdgpu: add ras inject unit test
Guchun Chen [Tue, 27 Aug 2019 09:42:14 +0000 (17:42 +0800)]
amdgpu: add ras inject unit test

Both UMC and GFX ras single_correctable
inject tests are added.

Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Guchun Chen <guchun.chen@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agoamdgpu: delete test configuration file
Guchun Chen [Tue, 27 Aug 2019 02:44:18 +0000 (10:44 +0800)]
amdgpu: delete test configuration file

Json package dependence is removed from amdgpu_test,
so this json configuration file is not needed any more.

Suggested-by: Christian König <christian.koenig@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Guchun Chen <guchun.chen@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agoamdgpu: remove json package dependence
Guchun Chen [Tue, 27 Aug 2019 02:27:18 +0000 (10:27 +0800)]
amdgpu: remove json package dependence

Except CUnit library, no additional external
library should be needed when compiling amdgpu_test.
This will keep this binary self containing.

Suggested-by: Christian König <christian.koenig@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Guchun Chen <guchun.chen@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agomeson: fix sys/mkdev.h detection on Solaris
Eric Engestrom [Sat, 14 Sep 2019 21:22:03 +0000 (22:22 +0100)]
meson: fix sys/mkdev.h detection on Solaris

On Solaris, sys/sysmacros.h has long-deprecated copies of major() & minor()
but not makedev().
sys/mkdev.h has all three and is the preferred choice.

Let's make sure we check for all 3 major(), minor() and makedev().

Fixes build failure with error:
../xf86drm.c: In function ‘drmOpenMinor’:
../xf86drm.c:454:30: error: implicit declaration of function ‘makedev’ [-Werror=implicit-function-declaration]
  454 |         return drmOpenDevice(makedev(DRM_MAJOR, minor), minor, type);
      |                              ^~~~~~~

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Tested-by: Alan Coopersmith <alan.coopersmith@oracle.com>
4 years agointel: sync i915_pciids.h with kernel
Anusha Srivatsa [Fri, 30 Aug 2019 20:32:51 +0000 (13:32 -0700)]
intel: sync i915_pciids.h with kernel

Add the new CML PCI IDS.

Align with kernel commit:
bfc4c359b2822 ("drm/i915/cml: Add Missing PCI IDs")

This is in sync with kernel header as of:
0747590267e7 ("drm-tip: 2019y-08m-30d-18h-03m-18s UTC integration manifest")

Cc: José Roberto de Souza <jose.souza@intel.com>
Signed-off-by: Anusha Srivatsa <anusha.srivatsa@intel.com>
4 years agoamdgpu: add umc ras inject test configuration
Guchun Chen [Tue, 6 Aug 2019 07:14:29 +0000 (15:14 +0800)]
amdgpu: add umc ras inject test configuration

Both umc single_correctable and multi_uncorrectable
inject types are added.

Signed-off-by: Dennis Li <dennis.li@amd.com>
Signed-off-by: Guchun Chen <guchun.chen@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agotests/amdgpu/ras: refine ras inject test
Guchun Chen [Wed, 31 Jul 2019 09:06:06 +0000 (17:06 +0800)]
tests/amdgpu/ras: refine ras inject test

Ras inject test framework is invalid with original codes,
so refine it to make it work on top of kernel ras inject
feature enablement.

Signed-off-by: Dennis Li <dennis.li@amd.com>
Signed-off-by: Guchun Chen <guchun.chen@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agoamdgpu: add gfx ras inject configuration file
Guchun Chen [Wed, 31 Jul 2019 08:56:49 +0000 (16:56 +0800)]
amdgpu: add gfx ras inject configuration file

This configuration file will be picked up when
running gfx ras inject tests by amdgpu_test tool.
For the time being, only add those tests that are
successfully trafficked. In addition, this file
can also be modified by user to add or delete ras
inject unit tests for different IP blocks/subblocks.

Signed-off-by: Dennis Li <dennis.li@amd.com>
Signed-off-by: Guchun Chen <guchun.chen@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agotests/amdgpu: divide dispatch test into compute and gfx
Le Ma [Mon, 22 Jul 2019 07:52:50 +0000 (15:52 +0800)]
tests/amdgpu: divide dispatch test into compute and gfx

for better clarification

v2: accordingly change dispatch_test caller in gpu_reset test

Signed-off-by: Le Ma <le.ma@amd.com>
Reviewed-by: Flora Cui <flora.cui@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agotests/amdgpu: disable reset test for now
Flora Cui [Tue, 23 Jul 2019 02:00:22 +0000 (10:00 +0800)]
tests/amdgpu: disable reset test for now

ASIC hang randomly.

Signed-off-by: Flora Cui <flora.cui@amd.com>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agointel: Add support for EHL
Rodrigo Vivi [Thu, 6 Sep 2018 04:29:49 +0000 (21:29 -0700)]
intel: Add support for EHL

Add the PCI ID import for EHL.

Cc: James Ausmus <james.ausmus@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
4 years agointel: add the TGL 12 PCI IDs and macros
Rodrigo Vivi [Thu, 6 Sep 2018 04:17:47 +0000 (21:17 -0700)]
intel: add the TGL 12 PCI IDs and macros

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
4 years agointel: sync i915_pciids.h with kernel
Lucas De Marchi [Mon, 15 Jul 2019 17:58:12 +0000 (10:58 -0700)]
intel: sync i915_pciids.h with kernel

Straight copy from the kernel file, aligned with drm-intel-next-queued
commit cb823ed9915b ("drm/i915/gt: Use intel_gt as the primary object
for handling resets")

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
4 years agotests/amdgpu: add gpu reset test
Flora Cui [Mon, 22 Apr 2019 07:57:23 +0000 (15:57 +0800)]
tests/amdgpu: add gpu reset test

1. perform gpu reset
2. perform dispatch test to verify gpu reset to a good state

Signed-off-by: Flora Cui <flora.cui@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
4 years agotests/amdgpu: fix for dispatch/draw test
Flora Cui [Tue, 23 Apr 2019 09:04:04 +0000 (17:04 +0800)]
tests/amdgpu: fix for dispatch/draw test

1. skip test if there's no desired ring
2. clear shader buffer
3. update command buffer for gfx9

Signed-off-by: Flora Cui <flora.cui@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
4 years agoxf86drm: dedupe drmGetDeviceName() logic
Eric Engestrom [Wed, 19 Dec 2018 13:53:41 +0000 (13:53 +0000)]
xf86drm: dedupe drmGetDeviceName() logic

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
4 years agoxf86drm: use max size of drm node name instead of arbitrary size
Eric Engestrom [Wed, 19 Dec 2018 13:42:08 +0000 (13:42 +0000)]
xf86drm: use max size of drm node name instead of arbitrary size

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
4 years agoxf86drm: dedupe `#define`s
Eric Engestrom [Wed, 19 Dec 2018 13:02:13 +0000 (13:02 +0000)]
xf86drm: dedupe `#define`s

Adapted from a local patch carried by DragonFlyBSD:
https://github.com/DragonFlyBSD/DPorts/blob/bc056f88f7e4d468d8c9751f831a47b5ae1326e3/graphics/libdrm/files/patch-xf86drm.h

Patch is sadly uncredited (a bot authored the commit), so I can't credit
the author here either.

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
4 years agoxf86drm: open correct render node on non-linux
Jonathan Gray [Sun, 12 May 2019 16:52:04 +0000 (02:52 +1000)]
xf86drm: open correct render node on non-linux

drm render nodes have the same major as drm primary devices but offset
the minor by a base of 128.

I expected the name of the device to have numbering starting at 0 when
these non-linux codepaths were added (before OpenBSD had render nodes).

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Acked-by: Eric Engestrom <eric.engestrom@intel.com>
4 years agoxf86drm: test for render nodes before primary nodes
Jonathan Gray [Sun, 12 May 2019 16:50:49 +0000 (02:50 +1000)]
xf86drm: test for render nodes before primary nodes

Unlike Linux the OpenBSD primary "drm" device name is substring of the
"drmR" render node device name and strncmp() tests resulted in render
nodes being flagged as primary nodes.

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Acked-by: Eric Engestrom <eric.engestrom@intel.com>
4 years agotests/util: fix incorrect memset argument order
Ilia Mirkin [Wed, 3 Jul 2019 03:18:56 +0000 (23:18 -0400)]
tests/util: fix incorrect memset argument order

Make it actually clear the LUT.

Reported-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Dave Airlie <airlied@redhat.com>
4 years agoBump version to 2.4.99
Marek Olšák [Tue, 2 Jul 2019 18:36:25 +0000 (14:36 -0400)]
Bump version to 2.4.99

4 years agoamdgpu: Rename fd_mutex/list to dev_mutex/list
Michel Dänzer [Thu, 20 Jun 2019 08:49:01 +0000 (10:49 +0200)]
amdgpu: Rename fd_mutex/list to dev_mutex/list

Seems to better reflect what they're for.

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
4 years agoamdgpu: Add BO handle to table in amdgpu_bo_create
Michel Dänzer [Fri, 14 Jun 2019 16:43:30 +0000 (18:43 +0200)]
amdgpu: Add BO handle to table in amdgpu_bo_create

Simplifies its callers.

dev->bo_table_mutex is now always held when amdgpu_bo_create is called
(this was already the case in amdgpu_bo_import).

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
4 years agoamdgpu: Pass file descriptor directly to amdgpu_close_kms_handle
Michel Dänzer [Thu, 13 Jun 2019 15:06:42 +0000 (17:06 +0200)]
amdgpu: Pass file descriptor directly to amdgpu_close_kms_handle

And propagate drmIoctl's return value.

This allows replacing all remaining open-coded DRM_IOCTL_GEM_CLOSE
ioctl calls with amdgpu_close_kms_handle calls.

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
4 years agoetnaviv: Fix double-free in etna_bo_cache_free()
Marek Vasut [Sat, 1 Jun 2019 23:36:27 +0000 (01:36 +0200)]
etnaviv: Fix double-free in etna_bo_cache_free()

The following situation can happen in a multithreaded OpenGL application.
A BO is submitted from etna_cmd_stream #1 with flags set for read.
A BO is submitted from etna_cmd_stream #2 with flags set for write.
This triggers a flush on stream #1 and clears the BO's current_stream
pointer. If at this point, stream #2 attempts to queue BO again, which
does happen, the BO will be added to the submit list twice. The Linux
kernel driver correctly detects this and warns about it with "BO at
index %u already on submit list" kernel message.

However, when cleaning the BO cache in etna_bo_cache_free(), the BO
which was submitted twice will also be free()d twice, this triggering
a glibc double free detector.

The fix is easy, even if the BO does not have current_stream set,
iterate over current streams' list of BOs before adding the BO to it
and verify that the BO is not yet there.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Wladimir J. van der Laan <laanwj@gmail.com>
4 years agoamdgpu: Update amdgpu_bo_handle_type_kms_noimport documentation
Michel Dänzer [Tue, 18 Jun 2019 09:24:42 +0000 (11:24 +0200)]
amdgpu: Update amdgpu_bo_handle_type_kms_noimport documentation

To reflect current reality.

Reviewed-by: Christian König <christian.koenig@amd.com>
4 years agoamdgpu: Move union declaration to top of amdgpu_cs_ctx_override_priority
Michel Dänzer [Thu, 20 Jun 2019 08:42:10 +0000 (10:42 +0200)]
amdgpu: Move union declaration to top of amdgpu_cs_ctx_override_priority

Avoids compiler warning:

../../amdgpu/amdgpu_cs.c: In function 'amdgpu_cs_ctx_override_priority':
../../amdgpu/amdgpu_cs.c:155:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
  union drm_amdgpu_sched args;
  ^~~~~

Reviewed-by: Christian König <christian.koenig@amd.com>
4 years agoetnaviv: drop etna_bo_from_handle symbol
Lucas Stach [Wed, 29 May 2019 10:05:54 +0000 (12:05 +0200)]
etnaviv: drop etna_bo_from_handle symbol

There is no implementation and also no users, so there is no point
in keeping it in the API.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
4 years agoutil: fix include path for drm_mode.h
Ilia Mirkin [Sat, 22 Jun 2019 18:49:19 +0000 (14:49 -0400)]
util: fix include path for drm_mode.h

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
4 years agomodetest: add FP16 format support
Ilia Mirkin [Sun, 2 Jun 2019 21:54:38 +0000 (17:54 -0400)]
modetest: add FP16 format support

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
4 years agomodetest: add the ability to specify fill patterns on the commandline
Ilia Mirkin [Sat, 5 Jan 2019 19:02:19 +0000 (14:02 -0500)]
modetest: add the ability to specify fill patterns on the commandline

Instead of hacking the binary every time, we can now specify directly.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
4 years agomodetest: add C8 support to generate SMPTE pattern
Ilia Mirkin [Sat, 18 Nov 2017 04:52:46 +0000 (23:52 -0500)]
modetest: add C8 support to generate SMPTE pattern

This includes logic to configure the LUT accordingly.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
4 years agomodetest: add an add_property_optional variant that does not print errors
Ilia Mirkin [Sun, 2 Jun 2019 18:33:26 +0000 (14:33 -0400)]
modetest: add an add_property_optional variant that does not print errors

As new features are added and others are declared to be legacy, it's
nice to be able to implement fallbacks. As such, create a
property-setting variant that does not generate errors which can very
well be entirely expected.

Will be used for gamma control in a future change.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
4 years agomodetest: don't pretend that atomic mode includes a format
Ilia Mirkin [Mon, 3 Jun 2019 00:20:39 +0000 (20:20 -0400)]
modetest: don't pretend that atomic mode includes a format

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
4 years agoutil: add cairo drawing for 30bpp formats when available
Ilia Mirkin [Sun, 2 Jun 2019 21:38:53 +0000 (17:38 -0400)]
util: add cairo drawing for 30bpp formats when available

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
4 years agoutil: add fp16 format support
Ilia Mirkin [Mon, 27 May 2019 22:27:24 +0000 (18:27 -0400)]
util: add fp16 format support

This change adds support for all current patterns.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
4 years agoutil: add gradient pattern
Ilia Mirkin [Sun, 4 Feb 2018 23:39:15 +0000 (18:39 -0500)]
util: add gradient pattern

The idea is to have a horizontal pattern split into two with the top and
bottom halves having different precision. This allows one to see whether
10bpc support is working properly or not, as there are many pieces to
the puzzle beyond the basic format support (gamma ramps, bpc encodings,
etc).

This is really only useful on 10bpc formats, but we also add support for
8bpc formats to ease testing. In the future, this could be applied to
16bpc formats as well.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
4 years agoutil: fix MAKE_RGBA macro for 10bpp modes
Ilia Mirkin [Thu, 23 Nov 2017 18:51:45 +0000 (13:51 -0500)]
util: fix MAKE_RGBA macro for 10bpp modes

We need to shift the values up, otherwise we'd end up with a negative
shift. This works for up-to 16-bit components, which is fine for now.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
4 years agoutil: add C8 format, support it with SMPTE pattern
Ilia Mirkin [Sun, 2 Jun 2019 21:51:08 +0000 (17:51 -0400)]
util: add C8 format, support it with SMPTE pattern

This also adds a helper to generate a color LUT, which has to be used in
conjunction with the C8 indexed format.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Acked-by: Emil Velikov <emil.velikov@collabora.com>
4 years agotests/amdgpu/vcn: add VCN2.0 decode support
Leo Liu [Wed, 12 Dec 2018 15:35:45 +0000 (10:35 -0500)]
tests/amdgpu/vcn: add VCN2.0 decode support

With different register offsets from VCN1.0

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: James Zhu <James.Zhu@amd.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
4 years agolibdrm/amdgpu: add new vram type (GDDR6) for navi10
Tao Zhou [Thu, 15 Nov 2018 03:48:58 +0000 (11:48 +0800)]
libdrm/amdgpu: add new vram type (GDDR6) for navi10

AMDGPU_VRAM_TYPE_GDDR6 is a new vram type for navi10

Reviewed-by: Tim Writer <Tim.Writer@amd.com>
Signed-off-by: Tao Zhou <tao.zhou1@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
4 years agolibdrm/amdgpu: add new member in drm_amdgpu_device_info for navi10
Hawking Zhang [Tue, 12 Jun 2018 10:08:39 +0000 (18:08 +0800)]
libdrm/amdgpu: add new member in drm_amdgpu_device_info for navi10

pa_sc_tile_steering_override is a new member introduced for gfx10

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
4 years agoamdgpu: add navi family id
Huang Rui [Thu, 28 Sep 2017 06:23:30 +0000 (14:23 +0800)]
amdgpu: add navi family id

Reviewed-by: Tim Writer <Tim.Writer@amd.com>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
4 years agoenable syncobj test depending on capability
Chunming Zhou [Tue, 11 Jun 2019 13:55:33 +0000 (15:55 +0200)]
enable syncobj test depending on capability

Feature is controlled by DRM_CAP_SYNCOBJ_TIMELINE drm capability.

Signed-off-by: Chunming Zhou <david1.zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
4 years agoupdate drm.h
Chunming Zhou [Wed, 22 May 2019 09:01:24 +0000 (17:01 +0800)]
update drm.h

   a) delta: only DRM_CAP_SYNCOBJ_TIMELINE
   b) Generated using make headers_install.
   c) Generated from origin/drm-misc-next commit 982c0500fd1a8012c31d3c9dd8de285129904656"

Signed-off-by: Chunming Zhou <david1.zhou@amd.com>
Suggested-by: Michel Dänzer <michel@daenzer.net>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
4 years agoamdgpu: Add amdgpu_cs_syncobj_transfer to amdgpu-symbol-check
Michel Dänzer [Thu, 16 May 2019 12:43:22 +0000 (14:43 +0200)]
amdgpu: Add amdgpu_cs_syncobj_transfer to amdgpu-symbol-check

Fixes make check. Trivial.

4 years agoadd syncobj timeline tests v3
Chunming Zhou [Thu, 16 May 2019 08:07:14 +0000 (16:07 +0800)]
add syncobj timeline tests v3

v2: drop DRM_SYNCOBJ_CREATE_TYPE_TIMELINE, fix timeout calculation,
    fix some warnings
v3: add export/import and cpu signal testing cases

Signed-off-by: Chunming Zhou <david1.zhou@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
4 years agowrap transfer interfaces
Chunming Zhou [Thu, 16 May 2019 08:07:13 +0000 (16:07 +0800)]
wrap transfer interfaces

Signed-off-by: Chunming Zhou <david1.zhou@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
4 years agoexpose timeline signal/export/import interfaces v2
Chunming Zhou [Thu, 16 May 2019 08:07:12 +0000 (16:07 +0800)]
expose timeline signal/export/import interfaces v2

v2: adapt to new one transfer ioctl

Signed-off-by: Chunming Zhou <david1.zhou@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
4 years agoadd timeline signal/transfer ioctls v2
Chunming Zhou [Thu, 16 May 2019 08:07:11 +0000 (16:07 +0800)]
add timeline signal/transfer ioctls v2

v2: use one transfer ioctl

Signed-off-by: Chunming Zhou <david1.zhou@amd.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
4 years agowrap syncobj timeline query/wait APIs for amdgpu v3
Chunming Zhou [Thu, 16 May 2019 08:07:10 +0000 (16:07 +0800)]
wrap syncobj timeline query/wait APIs for amdgpu v3

v2: symbos are stored in lexical order.
v3: drop export/import and extra query indirection

Signed-off-by: Chunming Zhou <david1.zhou@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
4 years agoadd timeline wait/query ioctl v2
Chunming Zhou [Thu, 16 May 2019 08:07:09 +0000 (16:07 +0800)]
add timeline wait/query ioctl v2

v2: drop export/import

Signed-off-by: Chunming Zhou <david1.zhou@amd.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
4 years agoadd cs chunk for syncobj timeline
Chunming Zhou [Thu, 16 May 2019 08:07:08 +0000 (16:07 +0800)]
add cs chunk for syncobj timeline

Signed-off-by: Chunming Zhou <david1.zhou@amd.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
5 years agoxf86drm: Fix possible memory leak with drmModeGetPropertyPtr()
Seung-Woo Kim [Mon, 29 Apr 2019 09:10:52 +0000 (18:10 +0900)]
xf86drm: Fix possible memory leak with drmModeGetPropertyPtr()

In drmModeGetPropertyPtr(), from upper error path, it calls free
but with just next error path, it does not call. Fix the possible
memory leak.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agotests/libkms-test-plane: fix possbile memory leak
Seung-Woo Kim [Thu, 25 Apr 2019 09:50:00 +0000 (18:50 +0900)]
tests/libkms-test-plane: fix possbile memory leak

The pointer p aquired with drmModeGetPlane() is not free in error
path. Fix possible memory leak by calling drmModeFreePlane() in
the error path.

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
5 years agolibdrm: omap: Add DRM_RDWR flag to dmabuf export
Hemant Hariyani [Wed, 24 Apr 2019 17:08:41 +0000 (10:08 -0700)]
libdrm: omap: Add DRM_RDWR flag to dmabuf export

Allows mmap on dmabuf fd with MAP_SHARED and PROT_WRITE.

This fixes boot failures with Android (likely w/ closed source
user-space drivers) that were caused due to mmap() returning
error.

Cc: Sean Paul <seanpaul@chromium.org>
Cc: Alistair Strachan <astrachan@google.com>
Cc: Marissa Wall <marissaw@google.com>
Acked-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Hemant Hariyani <hemanthariyani@ti.com>
[picked and updated commitmsg from http://git.ti.com/cgit/cgit.cgi/android/external-libdrm.git/]
Signed-off-by: Praneeth Bajjuri <praneeth@ti.com>
Signed-off-by: Alistair Strachan <astrachan@google.com>
[jstultz: Tweaked commit message]
Signed-off-by: John Stultz <john.stultz@linaro.org>
5 years agolibdrm: reduce number of reallocations in drmModeAtomicAddProperty
Adrian Salido [Wed, 24 Apr 2019 17:08:40 +0000 (10:08 -0700)]
libdrm: reduce number of reallocations in drmModeAtomicAddProperty

When calling drmModeAtomicAddProperty allocation of memory
happens as needed in increments of 16 elements. This can be very
slow if there are multiple properties to be updated in an Atomic
Commit call.

Increase this to as many as can fit in a memory PAGE to avoid
having to reallocate memory too often.

Also this patch has a small one line perf tweak in
drmModeAtomicDuplicate() to only memcpy items to the cursor
position in order avoid copying the entire item array if its
mostly empty.

Cc: Sean Paul <seanpaul@chromium.org>
Cc: Alistair Strachan <astrachan@google.com>
Cc: Marissa Wall <marissaw@google.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
[jstultz: Expanded commit message]
Signed-off-by: John Stultz <john.stultz@linaro.org>
5 years agolibdrm: Avoid additional drm open close
Prabhanjan Kandula [Wed, 24 Apr 2019 17:08:39 +0000 (10:08 -0700)]
libdrm: Avoid additional drm open close

Avoid additional drm device open and close.

Cc: Sean Paul <seanpaul@chromium.org>
Cc: Alistair Strachan <astrachan@google.com>
Cc: Marissa Wall <marissaw@google.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
5 years agolibdrm: amdgpu: Initialize unions with memset rather than "= {0}"
John Stultz [Wed, 24 Apr 2019 17:08:38 +0000 (10:08 -0700)]
libdrm: amdgpu: Initialize unions with memset rather than "= {0}"

Clang complains when initializing unions using "= {0}"
so instead use memset.

Cc: Sean Paul <seanpaul@chromium.org>
Cc: Alistair Strachan <astrachan@google.com>
Cc: Marissa Wall <marissaw@google.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
5 years agolibdrm: Use mmap64 instead of __mmap2
Sean Paul [Wed, 24 Apr 2019 17:08:36 +0000 (10:08 -0700)]
libdrm: Use mmap64 instead of __mmap2

__mmap2 isn't supported on all platforms, mmap64 is the right way
to do this in android.

Also folds in a fix from Stéphane Marchesin <marcheu@chromium.org>

Cc: Sean Paul <seanpaul@chromium.org>
Cc: Alistair Strachan <astrachan@google.com>
Cc: Marissa Wall <marissaw@google.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
[jstultz: Folded in Stéphane's fix]
Signed-off-by: John Stultz <john.stultz@linaro.org>
5 years agolibdrm: Android.mk: Add minimal Android platform check
John Stultz [Wed, 24 Apr 2019 17:08:37 +0000 (10:08 -0700)]
libdrm: Android.mk: Add minimal Android platform check

Add a check to error out on Android version K(4.4) or
lower.

This is due to dependency added in a previous commit on mmap64,
which was introduced with Android L.

Cc: Sean Paul <seanpaul@chromium.org>
Cc: Alistair Strachan <astrachan@google.com>
Cc: Marissa Wall <marissaw@google.com>
Suggested-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
5 years agoBump the version to 2.4.98
Emil Velikov [Fri, 19 Apr 2019 15:31:38 +0000 (16:31 +0100)]
Bump the version to 2.4.98

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
5 years agoamdgpu: Add context priority override function.
Bas Nieuwenhuizen [Mon, 28 Jan 2019 21:20:20 +0000 (22:20 +0100)]
amdgpu: Add context priority override function.

This way we can override the priority of a single context using a
master fd.

Since we cannot usefully create an amdgpu device of a master fd
without the fd deduplication kicking in this takes a plain fd.

This can be used by e.g. radv to get high priority contexts using
a master fd from the primary node or a lease.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Andres Rodriguez <andresx7@gmail.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
5 years agotests/util: Add armada-drm driver
Lubomir Rintel [Sat, 23 Mar 2019 20:23:42 +0000 (21:23 +0100)]
tests/util: Add armada-drm driver

This makes the test utilities work with the Armada driver without the
necessity of using the -M argument.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
5 years agoRevert "libdrm: Fix issue about differrent domainID but same BDF"
Emil Velikov [Wed, 17 Apr 2019 17:31:31 +0000 (18:31 +0100)]
Revert "libdrm: Fix issue about differrent domainID but same BDF"

This reverts commit 56c21f877bda7b8c62c3d7925b070b5113d807f2.

There were issues pointed out during review that were not addressed.
Would love to have this re-land, once those are addressed.

5 years agotests/modetest: add QCOM_COMPRESSED to supported modifiers list
Fritz Koenig [Fri, 1 Mar 2019 22:40:59 +0000 (14:40 -0800)]
tests/modetest: add QCOM_COMPRESSED to supported modifiers list

Signed-off-by: Fritz Koenig <frkoenig@google.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
5 years agofix various typos
Eric Engestrom [Wed, 19 Dec 2018 14:55:45 +0000 (14:55 +0000)]
fix various typos

Saw a couple of typos fixes in the patch DragonFlyBSD carries [1], so
I ran codespell (a spell checker for code) on the whole repo.

[1] https://github.com/DragonFlyBSD/DPorts/blob/master/graphics/libdrm/files/patch-xf86drm.c

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
5 years agoamdgpu/tests: drop unused local vars
Eric Engestrom [Wed, 19 Dec 2018 16:23:35 +0000 (16:23 +0000)]
amdgpu/tests: drop unused local vars

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
5 years agoamdgpu: Fix a structure initialization issue
Pan, Xinhui [Fri, 12 Apr 2019 05:42:01 +0000 (05:42 +0000)]
amdgpu: Fix a structure initialization issue

struct drmPciBusInfo has been aligned to 6 bytes. So memcmp will access
the last byte which is not initialized.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: xinhui pan <xinhui.pan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agoheaders: Sync with drm-next
Ayan Halder [Wed, 10 Apr 2019 15:17:21 +0000 (15:17 +0000)]
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 - 14d2bd53a47a7e1cb3e03d00a6b952734cf90f3f

The changes were as follows :-

core: (drm.h, drm_fourcc.h, drm_mode.h)
- Added 'struct drm_syncobj_transfer', 'struct drm_syncobj_timeline_wait' and 'struct drm_syncobj_timeline_array'
- Added various DRM_IOCTL_SYNCOBJ_ ioctls
- Added some new RGB and YUV formats
- Added 'DRM_FORMAT_MOD_VENDOR_ALLWINNER'
- Added 'SAMSUNG' and Arm's 'AFBC' and 'ALLWINNER' format modifiers
- Added 'struct drm_mode_rect'

i915:
- Added struct 'struct i915_user_extension' and various 'struct drm_i915_gem_context_'
- Added different modes of per-process Graphics Translation Table

Changes from v1:-
- Removed the changes to 'msm_drm.h' as it breaks the build for 'freedreno' platform.

Signed-off-by: Ayan Kumar halder <ayan.halder@arm.com>
Acked-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agodrm/amdgpu: support test mask
xinhui pan [Thu, 14 Mar 2019 08:39:39 +0000 (16:39 +0800)]
drm/amdgpu: support test mask

support per device test mask. Skip inject test on non-server card.

Signed-off-by: xinhui pan <xinhui.pan@amd.com>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agoamdgpu: add ras tests
xinhui pan [Fri, 1 Feb 2019 03:48:11 +0000 (11:48 +0800)]
amdgpu: add ras tests

Signed-off-by: xinhui pan <xinhui.pan@amd.com>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agoamdgpu: update amdgpu_drm.h from drm-next for 5.2
Alex Deucher [Thu, 4 Apr 2019 18:39:07 +0000 (13:39 -0500)]
amdgpu: update amdgpu_drm.h from drm-next for 5.2

From drm-next commit b4e4538a0ab5079ae5dc401970e11f0ff2ba13a7

Adds support for:
- RAS queries
- context priority updates
- CS chunks support for scheduled dependencies
- IB flag for GDS max wave id

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agovirtgpu: Update kernel header
Gurchetan Singh [Thu, 28 Feb 2019 00:52:37 +0000 (16:52 -0800)]
virtgpu: Update kernel header

Generated using make headers_install.

This brings in the in/out fence support for explicit
synchronization.

v2: don't use experimental kernel branch

Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Robert Foss <robert.foss@collabora.com>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
5 years agointel: sync i915_pciids.h with kernel
Anusha [Wed, 20 Mar 2019 22:00:06 +0000 (15:00 -0700)]
intel: sync i915_pciids.h with kernel

Add CML and EHL PCI IDs, and one more for ICL. This is in sync with
kernel header as of b024ab9b2d3a ("drm/i915/bios: iterate over child
devices to initialize ddi_port_info")

Signed-off-by: Anusha Srivatsa <anusha.srivatsa@intel.com>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
5 years agotests/amdgpu: minor fix for dispatch/draw test
Cui, Flora [Wed, 20 Mar 2019 02:46:56 +0000 (02:46 +0000)]
tests/amdgpu: minor fix for dispatch/draw test

1. clear cmd buffer
2. make amdgpu_memcpy_dispatch_test static
3. tab/space fix

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Flora Cui <flora.cui@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agotests/amdgpu: add memcpy draw test
Cui, Flora [Fri, 15 Mar 2019 08:51:21 +0000 (08:51 +0000)]
tests/amdgpu: add memcpy draw test

add memcpy draw test for gfx9

Signed-off-by: Flora Cui <flora.cui@amd.com>
Tested-by: Rui Teng <rui.teng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agotests/amdgpu: add memset draw test
Cui, Flora [Fri, 15 Mar 2019 08:51:18 +0000 (08:51 +0000)]
tests/amdgpu: add memset draw test

add memset draw test for gfx9

Signed-off-by: Flora Cui <flora.cui@amd.com>
Tested-by: Rui Teng <rui.teng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agotests/amdgpu: add memcpy dispatch test
Cui, Flora [Fri, 15 Mar 2019 08:51:13 +0000 (08:51 +0000)]
tests/amdgpu: add memcpy dispatch test

add memcpy dispatch test for gfx9

Signed-off-by: Flora Cui <flora.cui@amd.com>
Tested-by: Rui Teng <rui.teng@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agotests/amdgpu: add memset dispatch test
Cui, Flora [Fri, 15 Mar 2019 08:50:54 +0000 (08:50 +0000)]
tests/amdgpu: add memset dispatch test

add memset dispatch test for gfx9
v2: disable dispatch test for other ASICs

Signed-off-by: Flora Cui <flora.cui@amd.com>
Tested-by: Rui Teng <rui.teng@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agotests/amdgpu: add deadlock test for sdma
Cui, Flora [Wed, 6 Mar 2019 06:37:13 +0000 (06:37 +0000)]
tests/amdgpu: add deadlock test for sdma

deadlock test for sdma will cause gpu recoverty.
disable the test for now until GPU reset recovery could survive at least
1000 times test.

v2: add modprobe parameter

Reviewed-and-tested-by: Evan Quan <evan.quan@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Flora Cui <flora.cui@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agoamdgpu: add marketing name for AMD Radeon VII
Alex Deucher [Tue, 5 Mar 2019 16:14:31 +0000 (11:14 -0500)]
amdgpu: add marketing name for AMD Radeon VII

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agoxf86drm: Fix segmentation fault while parsing device info
Andreas Baierl [Mon, 11 Mar 2019 15:04:08 +0000 (16:04 +0100)]
xf86drm: Fix segmentation fault while parsing device info

This fixes a bug, which was introduced with commit ee798b98
"xf85drm: de-duplicate drmParse{Platform.Host1x}{Bus,Device}Info".
where accessing *compatible[i] with i>0 results in a segfault.

Signed-off-by: Andreas Baierl <ichgeh@imkreisrum.de>
Fixes: ee798b98479709acdd8d "xf85drm: de-duplicate drmParse{Platform.Host1x}{Bus,Device}Info"
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
[Eric: add the same fix to the free() below]
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agolibkms: update list of intel_drivers for Android build
Tapani Pälli [Tue, 18 Dec 2018 06:13:53 +0000 (08:13 +0200)]
libkms: update list of intel_drivers for Android build

Add new iris driver, remove deprecated ilo driver.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agoconfigure.ac fix build error for config.h in autotools
Seung-Woo Kim [Tue, 26 Feb 2019 01:00:56 +0000 (10:00 +0900)]
configure.ac fix build error for config.h in autotools

After the commit 0926f0af54d6 ("meson,configure: include config.h
automatically"), there is build error for autotools because
config.h is not included. Fix the error by adding "-include
config.h" to CPPFLAGS instead of CFLAGS from configure.ac.

Reference: https://bugs.freedesktop.org/show_bug.cgi?id=106561
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Fixes: 0926f0af54d654b1a958 "meson,configure: include config.h automatically"

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>