platform/upstream/libdrm.git
15 months agoxf86drm: bump DRM_MAX_MINOR to 64
Simon Ser [Mon, 17 Jul 2023 14:17:45 +0000 (16:17 +0200)]
xf86drm: bump DRM_MAX_MINOR to 64

This is what the kernel uses (see drm_minor_alloc).

Signed-off-by: Simon Ser <contact@emersion.fr>
15 months agoxf86drmMode: constify drmModeCrtcSetGamma
Xaver Hugl [Fri, 7 Apr 2023 23:42:17 +0000 (01:42 +0200)]
xf86drmMode: constify drmModeCrtcSetGamma

The data is never modified, so it should be const

Signed-off-by: Xaver Hugl <xaver.hugl@gmail.com>
15 months agotests/amdgpu/vcn: fix session buffer issue for vcn1-vcn3
Ruijing Dong [Mon, 10 Jul 2023 23:27:41 +0000 (19:27 -0400)]
tests/amdgpu/vcn: fix session buffer issue for vcn1-vcn3

issue:
   in vcn1-vcn3, session buffer was not truly added, it shows
   decoding creation commands cannot be sent multiple times.

problem:
   session buffer has to be the first buffer sending out.
   Otherwise, system could assume session buffer doesn't
   exist.

solution:
   move session buffer sending sequence to be the first one.

Reviewed-by: Veerabadhran Gopalakrishnan <Veerabadhran.Gopalakrishnan@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Signed-off-by: Saleemkhan Jamadar <saleemkhan.jamadar@amd.com>
16 months agotests/amdgpu/vcn:update decoder unit test
Saleemkhan Jamadar [Thu, 22 Jun 2023 08:57:10 +0000 (14:27 +0530)]
tests/amdgpu/vcn:update decoder unit test

update decoder unit test with session context buffer for VCN v1 to v4

v2: remove multiple checks for vcn4 (Ruijing Dong)

Signed-off-by: Saleemkhan Jamadar <saleemkhan.jamadar@amd.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
17 months agoamdgpu: add an environment variable that overrides the context priority
Marek Olšák [Thu, 13 Apr 2023 15:01:51 +0000 (11:01 -0400)]
amdgpu: add an environment variable that overrides the context priority

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
17 months agotests/amdgpu/vcn: fix drm test failure
Ruijing Dong [Tue, 9 May 2023 20:15:41 +0000 (16:15 -0400)]
tests/amdgpu/vcn: fix drm test failure

1. fixed an issue that drm test vcn3/4 encoding test
   could cause VCN engine stuck.
2. adding missing or errous encoding ib package members.

Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
17 months agotests/amdgpu/vcn: change vbv_buffer name to input
Ruijing Dong [Tue, 9 May 2023 15:19:34 +0000 (11:19 -0400)]
tests/amdgpu/vcn: change vbv_buffer name to input

It is input buffer instead of vbv_buffer.
Correct its name.

Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
19 months agotests/amdgpu: Allow to exclude a test or a suite of tests
Luben Tuikov [Tue, 21 Mar 2023 12:51:50 +0000 (08:51 -0400)]
tests/amdgpu: Allow to exclude a test or a suite of tests

Add the command line argument -e s[.t] to exclude (disable) suite s, or to
exclude suite s test t.

This is useful for instance to run the Basic Suite, but disable the GPU reset
test, on the command line, like this:

    amdgpu_tests -s 1 -e 1.13

This option can be specified more than once on the command line, in order to
exclude more than one suite and/or suite and test combination from being run.

Cc: Alex Deucher <Alexander.Deucher@amd.com>
Signed-off-by: Luben Tuikov <luben.tuikov@amd.com>
19 months agotests/amdgpu: Add all 9 options to the help output
Luben Tuikov [Thu, 16 Mar 2023 22:17:18 +0000 (18:17 -0400)]
tests/amdgpu: Add all 9 options to the help output

Add -s and -t to the help output, as well as sort
the options output alphabetically.

v1: Fix a spelling in the subject of this commit.

Cc: Alex Deucher <Alexander.Deucher@amd.com>
Signed-off-by: Luben Tuikov <luben.tuikov@amd.com>
19 months agotests/amdgpu: Fix Usage string
Luben Tuikov [Thu, 16 Mar 2023 19:09:14 +0000 (15:09 -0400)]
tests/amdgpu: Fix Usage string

Fix the Usage: string on -h (help) in amdgpu_tests.c,
so brackets match, and remove mismatched angle brackets.

Cc: Alex Deucher <Alexander.Deucher@amd.com>
Signed-off-by: Luben Tuikov <luben.tuikov@amd.com>
19 months agoamdgpu: add marketing names from amd-5.4.3 (22.40.3)
Jonathan Gray [Sun, 19 Mar 2023 08:50:19 +0000 (19:50 +1100)]
amdgpu: add marketing names from amd-5.4.3 (22.40.3)

19 months agoamdgpu: remove va::dev member
Pierre-Eric Pelloux-Prayer [Mon, 20 Mar 2023 10:19:15 +0000 (11:19 +0100)]
amdgpu: remove va::dev member

This is unused so drop it.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
19 months agotest/amdgpu/hotunplug: add apu check for hotplug test
jie zhang [Wed, 15 Feb 2023 04:45:05 +0000 (04:45 +0000)]
test/amdgpu/hotunplug: add apu check for hotplug test

For apu, it is integrated with cpu.
So hotplug test should be unnecessary for it.

Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com>
Reviewed-by: Flora Cui <flora.cui@amd.com>
20 months agomeson: drop pthread-stubs dependency on BSDs
Jan Beich [Wed, 8 Sep 2021 09:14:20 +0000 (09:14 +0000)]
meson: drop pthread-stubs dependency on BSDs

pthread-stubs >= 0.4 simply passes -pthread which is similar to what
dependency('threads') returns. And make it a private dependency
for subprojects even on Linux.

Reviewed-by: Emmanuel Vadot <manu@FreeBSD.org>
20 months agotests/util: Add vkms driver
Yi Xie [Thu, 2 Feb 2023 03:58:12 +0000 (12:58 +0900)]
tests/util: Add vkms driver

Add an entry for the "vkms" driver, so that the test utilities work with
the vkms driver without passing the -M argument.

Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Yi Xie <yixie@google.com>
20 months agobuild: bump version to 2.4.115 libdrm-2.4.115
Simon Ser [Thu, 9 Feb 2023 11:55:44 +0000 (12:55 +0100)]
build: bump version to 2.4.115

Signed-off-by: Simon Ser <contact@emersion.fr>
20 months agoxf86drm: add support for printing AMD GFX11 modifiers
Simon Ser [Wed, 21 Dec 2022 11:36:59 +0000 (12:36 +0100)]
xf86drm: add support for printing AMD GFX11 modifiers

See kernel commit 543036a2de71 ("drm/amd: Add GFX11 modifiers support
to AMDGPU (v3)").

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
22 months agoamdgpu: add some additional marketing names
Alex Deucher [Sun, 1 Jan 2023 19:14:58 +0000 (14:14 -0500)]
amdgpu: add some additional marketing names

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
22 months agoamdgpu: add marketing names from amd-5.4 (22.40)
Alex Deucher [Tue, 27 Dec 2022 17:24:14 +0000 (12:24 -0500)]
amdgpu: add marketing names from amd-5.4 (22.40)

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
22 months agoxf86drm: fix warning in drmGetFormatModifierNameFromVivante()
Simon Ser [Wed, 21 Dec 2022 15:42:44 +0000 (16:42 +0100)]
xf86drm: fix warning in drmGetFormatModifierNameFromVivante()

Fixes the following warning:

    ../xf86drm.c: In function ‘drmGetFormatModifierNameFromVivante’:
    ../xf86drm.c:614:14: warning: passing argument 1 of ‘asprintf’ from incompatible pointer type [-Wincompatible-pointer-types]
      614 |     asprintf(&mod_vivante, "%s%s%s", color_tiling, tile_status, compression);
          |              ^~~~~~~~~~~~
          |              |
          |              const char **
    In file included from ../xf86drm.c:34:
    /usr/include/stdio.h:396:40: note: expected ‘char ** restrict’ but argument is of type ‘const char **’
      396 | extern int asprintf (char **__restrict __ptr,
          |                      ~~~~~~~~~~~~~~~~~~^~~~~
    ../xf86drm.c:615:12: warning: return discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
      615 |     return mod_vivante;
          |            ^~~~~~~~~~~

Signed-off-by: Simon Ser <contact@emersion.fr>
23 months agoxf86drm: Add support for decoding Vivante format modifiers
Philipp Zabel [Thu, 13 Oct 2022 11:44:38 +0000 (13:44 +0200)]
xf86drm: Add support for decoding Vivante format modifiers

Allow applications to pretty-print Vivante format modifiers.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
23 months agodrm_fourcc: sync drm_fourcc with latest drm-next kernel
Philipp Zabel [Wed, 30 Nov 2022 17:13:37 +0000 (18:13 +0100)]
drm_fourcc: sync drm_fourcc with latest drm-next kernel

Update drm_fourcc.h to include latest changes from drm-next branch.
This brings in sub-8bpp formats, AVUY and XVUY 8:8:8:8, and
Vivante tile-status and compression modifiers.

Generated using make headers_install.
Generated from drm-next branch commit 077bd80083ab

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
23 months agointel: Eliminate need to keep adding PCI IDs
Matt Roper [Tue, 25 Oct 2022 00:07:28 +0000 (17:07 -0700)]
intel: Eliminate need to keep adding PCI IDs

The Intel-specific code in libdrm is continually updated with new PCI
IDs for each new platform so that we can recognize the IP version
properly.  However this is mostly a pointless exercise; none of the
Intel code in libdrm is conditional on IP versions above 8.  If we just
treat any future unrecognized Intel platforms as IP version 8, we should
get the same behavior without the need for continued PCI ID updates.

Note that the intel_decode tool probably _should_ have conditions on
newer IP versions, but it was last updated for gen8 and has been
bitrotting from gen9 onward.  This change won't make the tool behave any
more incorrectly than it already does today.

Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
23 months agotests/amdgpu/jpeg: enable unit test for jpeg 4
Saleemkhan Jamadar [Tue, 8 Nov 2022 11:39:14 +0000 (17:09 +0530)]
tests/amdgpu/jpeg: enable unit test for jpeg 4

Enable decode unit test for jpeg4.

Signed-off-by: Saleemkhan Jamadar <saleemkhan.jamadar@amd.com>
Reviewed-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
2 years agotests/amdgpu: use AMDGPU_TIMEOUT_INFINITE to query fence
Lang Yu [Wed, 9 Nov 2022 06:29:57 +0000 (14:29 +0800)]
tests/amdgpu: use AMDGPU_TIMEOUT_INFINITE to query fence

We need to wait longer when running on emulator.

Signed-off-by: Lang Yu <Lang.Yu@amd.com>
2 years agobuild: bump version to 2.4.114 libdrm-2.4.114
Simon Ser [Thu, 3 Nov 2022 08:33:36 +0000 (09:33 +0100)]
build: bump version to 2.4.114

Signed-off-by: Simon Ser <contact@emersion.fr>
2 years agomodetest: use dumb buffer helpers
Simon Ser [Thu, 27 Oct 2022 17:13:06 +0000 (19:13 +0200)]
modetest: use dumb buffer helpers

Signed-off-by: Simon Ser <contact@emersion.fr>
2 years agomodetest: use sized integers in struct bo
Simon Ser [Wed, 2 Nov 2022 17:43:58 +0000 (18:43 +0100)]
modetest: use sized integers in struct bo

Use the same size types as the kernel.

Signed-off-by: Simon Ser <contact@emersion.fr>
2 years agomodetest: drop unused offset field in struct bo
Simon Ser [Wed, 2 Nov 2022 17:45:42 +0000 (18:45 +0100)]
modetest: drop unused offset field in struct bo

Signed-off-by: Simon Ser <contact@emersion.fr>
2 years agoxf86drmMode: add helpers for dumb buffers
Simon Ser [Thu, 27 Oct 2022 17:11:20 +0000 (19:11 +0200)]
xf86drmMode: add helpers for dumb buffers

Up until now, DRM clients had to hand-roll their code to create,
destroy and map dumb buffers. This is slightly inconvenient,
a bit error-prone, and not easily discoverable.

Introduce wrappers for these operations, just like we have for
other KMS IOCTLs.

Signed-off-by: Simon Ser <contact@emersion.fr>
2 years agoamdgpu: silence uninitialized variable warning
Simon Ser [Wed, 28 Sep 2022 06:53:17 +0000 (08:53 +0200)]
amdgpu: silence uninitialized variable warning

The compiler isn't smart enough to tell that this can't happen:

    [30/74] Compiling C object amdgpu/libdrm_amdgpu.so.1.0.0.p/amdgpu_bo.c.o
    In file included from ../amdgpu/amdgpu_internal.h:32,
                     from ../amdgpu/amdgpu_bo.c:39:
    ../xf86atomic.h: In function ‘amdgpu_find_bo_by_cpu_mapping’:
    ../xf86atomic.h:47:54: warning: ‘bo’ may be used uninitialized [-Wmaybe-uninitialized]
       47 | # define atomic_inc(x) ((void) __sync_fetch_and_add (&(x)->atomic, 1))
          |                                                      ^
    ../amdgpu/amdgpu_bo.c:536:27: note: ‘bo’ was declared here
      536 |         struct amdgpu_bo *bo;
          |                           ^~

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2 years agoamdgpu: Add a default marketing name if none is found
Alex Deucher [Mon, 26 Sep 2022 21:19:27 +0000 (17:19 -0400)]
amdgpu: Add a default marketing name if none is found

Apparently quite a few apps use this API to get the GPU
name and end up with NULL as the GPU name.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 years agoamdgpu_ids: add MI marketing names
Alex Deucher [Mon, 26 Sep 2022 15:20:31 +0000 (11:20 -0400)]
amdgpu_ids: add MI marketing names

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 years agoamdgpu.ids: update to the latest marketing name
Alex Deucher [Fri, 23 Sep 2022 22:47:20 +0000 (18:47 -0400)]
amdgpu.ids: update to the latest marketing name

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 years agoamdgpu.ids: sort the file
Alex Deucher [Fri, 23 Sep 2022 22:41:06 +0000 (18:41 -0400)]
amdgpu.ids: sort the file

So the list is in numeric order.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 years agoamdgpu.ids: use consistent formatting for RID
Alex Deucher [Fri, 23 Sep 2022 22:11:01 +0000 (18:11 -0400)]
amdgpu.ids: use consistent formatting for RID

Use two digits for the revision id.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 years agoxf86drm: handle DRM_FORMAT_BIG_ENDIAN in drmGetFormatName()
Simon Ser [Wed, 12 Oct 2022 07:40:06 +0000 (09:40 +0200)]
xf86drm: handle DRM_FORMAT_BIG_ENDIAN in drmGetFormatName()

This bit can be added to a DRM format to indicate that it's
big endian instead of little endian.

Signed-off-by: Simon Ser <contact@emersion.fr>
2 years agotests/util: add imx-lcdif driver
Marco Felsch [Fri, 8 Jul 2022 09:39:14 +0000 (11:39 +0200)]
tests/util: add imx-lcdif driver

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

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
2 years agobuild: automatically disable Intel if pciaccess is not found
Simon Ser [Wed, 28 Sep 2022 06:49:40 +0000 (08:49 +0200)]
build: automatically disable Intel if pciaccess is not found

Wire up the pciaccess dep to the intel option. This automatically
skips the dep if intel is explicitly disabled, fails if intel is
explicitly enabled and it's not found, and disables intel if it's
set to auto and the dep is not found.

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
2 years agointel: move declarations to top in drm_intel_gem_bo_unreference()
Simon Ser [Wed, 28 Sep 2022 06:55:14 +0000 (08:55 +0200)]
intel: move declarations to top in drm_intel_gem_bo_unreference()

Fixes the following warning:

    [65/74] Compiling C object intel/libdrm_intel.so.1.0.0.p/intel_bufmgr_gem.c.o
    ../intel/intel_bufmgr_gem.c: In function â\80\98drm_intel_gem_bo_unreferenceâ\80\99:
    ../intel/intel_bufmgr_gem.c:1388:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
     1388 |         drm_intel_bufmgr_gem *bufmgr_gem =
          |         ^~~~~~~~~~~~~~~~~~~~

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
2 years agoinclude/drm/i915_drm.h: Update from Linux v6.0-rc7
Jordan Justen [Wed, 28 Sep 2022 23:46:20 +0000 (16:46 -0700)]
include/drm/i915_drm.h: Update from Linux v6.0-rc7

Generated from the Linux v6.0-rc7 tag with a sha1 of
f76349cf41451c5c42a99f18a9163377e4b364ff.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2 years agoinclude/drm/drm_fourcc.h: Update from Linux v6.0-rc7
Jordan Justen [Wed, 28 Sep 2022 23:46:20 +0000 (16:46 -0700)]
include/drm/drm_fourcc.h: Update from Linux v6.0-rc7

Generated from the Linux v6.0-rc7 tag with a sha1 of
f76349cf41451c5c42a99f18a9163377e4b364ff.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2 years agomeson: fast-fail on unsupported OSes
Eli Schwartz [Sun, 11 Sep 2022 05:09:17 +0000 (01:09 -0400)]
meson: fast-fail on unsupported OSes

It's not worth even attempting to configure anything on OSes where there
is no DRM to have a userspace library for.

This failure message can be useful in e.g. the case where libdrm is an
optional wrap fallback in another project.

Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2 years agobuild: bump to version 2.4.113 libdrm-2.4.113
Simon Ser [Wed, 31 Aug 2022 14:38:38 +0000 (16:38 +0200)]
build: bump to version 2.4.113

Signed-off-by: Simon Ser <contact@emersion.fr>
2 years agotests/modetest: use drmGetFormatName()
Simon Ser [Sun, 21 Aug 2022 12:18:28 +0000 (14:18 +0200)]
tests/modetest: use drmGetFormatName()

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Marius Vlad <marius.vlad@collabora.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
2 years agoxf86drm: add drmGetFormatName()
Simon Ser [Sun, 21 Aug 2022 12:17:35 +0000 (14:17 +0200)]
xf86drm: add drmGetFormatName()

Same as drmGetFormatModifierName() but for formats.

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Marius Vlad <marius.vlad@collabora.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
2 years agointel: Hook up new platforms IDs
Matt Roper [Fri, 26 Aug 2022 23:26:33 +0000 (16:26 -0700)]
intel: Hook up new platforms IDs

In commit 98794e2a0d ("lib: sync i915_pciids.h with kernel") we
resynchronized the PCI header with the kernel to bring in the
definitions for several new platforms.  But before those IDs will be
recognized, we still need to hook them up in the libdrm chipset code as
well.

References: https://gitlab.freedesktop.org/drm/intel/-/issues/5416
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
2 years agomeson: auto-enable etnaviv on arm, arc, mips and loongarch architectures
Sui Jingfeng [Mon, 17 Jan 2022 09:36:50 +0000 (17:36 +0800)]
meson: auto-enable etnaviv on arm, arc, mips and loongarch architectures

There is a Vivante GC1000 gpu in LS2K1000 and LS7A1000.

LS7A1000 is a bridge chip made by Loongson corporation
which act as north and/or south bridge of loongson's
desktop and server level processor. It is equivalent
to RS780E or something like that. In fact, the company
use RS780E as bridge of LS3A3000 at its early stage,
but as RS780E is out of stock long long time ago, the
company have to made one by themself. More details can
be read from its user manual[1].

This bridge chip typically use with LS3A3000, LS3A4000
and LS3A5000.

LS3A3000 is 4 core 1.45gHz mips64r2 compatible cpu.
LS3A4000 is 4 core 1.8gHz mips64r5 compatible cpu.
LS3A5000 is 4 core 2.5gHz loongarch cpu, the company
acclaim that loongarch a new archtecture with its
instruction set is released[2].

LS2K1000 is a double core 1.0Ghz mips64r2 compatible SoC[3].

we need to enable it to test and developing driver on above
listed archtecture.

[1] https://loongson.github.io/LoongArch-Documentation/Loongson-7A1000-usermanual-EN.html
[2] https://loongson.github.io/LoongArch-Documentation/Loongson-3A5000-usermanual-EN.html
[3] https://wiki.debian.org/InstallingDebianOn/Lemote/Loongson2K1000

Signed-off-by: Sui Jingfeng <15330273260@189.cn>
[Eric: rebase over meson changes, add ARM & ARC architectures, and drop
"experimental" from the description]
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
2 years agointel: Avoid aliasing violation
Matt Turner [Tue, 23 Aug 2022 01:36:52 +0000 (21:36 -0400)]
intel: Avoid aliasing violation

../intel/test_decode.c: In function ‘compare_batch’:
../intel/test_decode.c:109:39: error: dereferencing type-punned pointer might break strict-aliasing rules [-Werror=strict-aliasing]
  109 |         out = open_memstream((char **)&ptr, &size);
      |                                       ^~~~
cc1: some warnings being treated as errors

The fix is simple: just declare `ptr` as a `char *` to begin with.

2 years agoatomic: fix atomic_add_unless() fallback's return value
Eric Engestrom [Wed, 15 Mar 2017 23:27:25 +0000 (23:27 +0000)]
atomic: fix atomic_add_unless() fallback's return value

According to the kernel documentation:
  Returns non-zero if @v was not @u, and zero otherwise.

Fixes: 63fc571863aa64683400 ("atomic: add atomic_add_unless()")
Closes: https://gitlab.freedesktop.org/mesa/drm/issues/17
Signed-off-by: David Shao <davshao@gmail.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
[Eric: fix its callers to maintain current behaviour]
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
2 years agoRemove unused 3rd parameter to open(2)
Matthieu Herrb [Tue, 26 Oct 2021 17:00:22 +0000 (19:00 +0200)]
Remove unused 3rd parameter to open(2)

The 3rd parameter is only used with the O_CREAT flag

Signed-off-by: Matthieu Herrb <matthieu@herrb.eu>
2 years agomeson: simplify some more build options by using features
Eric Engestrom [Mon, 22 Aug 2022 16:10:16 +0000 (17:10 +0100)]
meson: simplify some more build options by using features

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Simon Ser <contact@emersion.fr>
2 years agomeson: convert auto combos into proper features
Eric Engestrom [Mon, 22 Aug 2022 16:04:52 +0000 (17:04 +0100)]
meson: convert auto combos into proper features

Allows users to easily enable everything (eg. packagers), or select just
the drivers they want with something like:
    -D auto-features=disabled -D amdgpu=enabled

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Simon Ser <contact@emersion.fr>
2 years agoci: drop dead script since e722ba9f67
Eric Engestrom [Tue, 23 Aug 2022 16:51:34 +0000 (17:51 +0100)]
ci: drop dead script since e722ba9f67

Noticed-by: Michel Daenzer <michel@daenzer.net>
2 years agomeson: fix value of `auto` for a bunch of drivers
Eric Engestrom [Mon, 22 Aug 2022 19:20:40 +0000 (20:20 +0100)]
meson: fix value of `auto` for a bunch of drivers

You can't have an error if your driver is requested by you're missing
a dep, but then happily build that driver without the dep in `auto`.

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
2 years agoci: bump images tags to take !255 into effect
Eric Engestrom [Mon, 22 Aug 2022 17:16:46 +0000 (18:16 +0100)]
ci: bump images tags to take !255 into effect

Reviewed-by: Simon Ser <contact@emersion.fr>
2 years agoci/freedesktop: bump python version of docutils package as 3.8 no longer exists
Eric Engestrom [Mon, 22 Aug 2022 17:22:46 +0000 (18:22 +0100)]
ci/freedesktop: bump python version of docutils package as 3.8 no longer exists

2 years agoci: fix the tested meson version
Eric Engestrom [Mon, 22 Aug 2022 16:41:18 +0000 (17:41 +0100)]
ci: fix the tested meson version
Reviewed-by: Simon Ser <contact@emersion.fr>
2 years agoci: remove system meson before installing the pip one
Eric Engestrom [Mon, 22 Aug 2022 16:40:09 +0000 (17:40 +0100)]
ci: remove system meson before installing the pip one
Reviewed-by: Simon Ser <contact@emersion.fr>
2 years agobuild: make tests optional
Simon Zeni [Thu, 28 Jul 2022 10:18:33 +0000 (06:18 -0400)]
build: make tests optional

Building the project as a meson subproject, meson inherits the warning level
from the parent project. Making the tests optional bypasses that issue and
reduces build time.

Signed-off-by: Simon Zeni <simon@bl4ckb0ne.ca>
Reviewed-by: Simon Ser <contact@emersion.fr>
2 years agotests/amdgpu: add sdma slow copy linear hang test
Likun Gao [Wed, 13 Jul 2022 05:43:51 +0000 (13:43 +0800)]
tests/amdgpu: add sdma slow copy linear hang test

Issue slow copy linear for sdma to trigger SDMA hang test.

Signed-off-by: Likun Gao <Likun.Gao@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
2 years agotests/amdgpu: add sdma corrupted header hang test
Likun Gao [Wed, 13 Jul 2022 02:28:20 +0000 (10:28 +0800)]
tests/amdgpu: add sdma corrupted header hang test

Issue corrupted header for sdma to trigger SDMA hang test.

Signed-off-by: Likun Gao <Likun.Gao@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
2 years agotests/amdgpu: add dispatch/draw test for gfx11
Flora Cui [Thu, 7 Jul 2022 13:01:56 +0000 (21:01 +0800)]
tests/amdgpu: add dispatch/draw test for gfx11

Signed-off-by: Flora Cui <flora.cui@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
2 years agotests/amdgpu: refactor dispatch/draw test
Flora Cui [Thu, 7 Jul 2022 12:48:19 +0000 (20:48 +0800)]
tests/amdgpu: refactor dispatch/draw test

Signed-off-by: Flora Cui <flora.cui@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
2 years agotests/amdgpu: skip gfx CE subtest in gfx11
Hawking Zhang [Sat, 12 Feb 2022 06:56:01 +0000 (14:56 +0800)]
tests/amdgpu: skip gfx CE subtest in gfx11

CE is not available in gfx11

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Likun Gao <Likun.Gao@amd.com>
2 years agolib: sync i915_pciids.h with kernel
Matt Roper [Wed, 27 Jul 2022 04:42:50 +0000 (21:42 -0700)]
lib: sync i915_pciids.h with kernel

This synchronizes with kernel commit 7835303982d1 ("drm/i915/mtl: Add
MeteorLake PCI IDs") to bring in the missing PCI IDs for several recent
platforms.

These days adding PCI IDs to libdrm doesn't really matter for real-world
system usage.  However there are still a few driver testing situations
where they're needed (such as the IGT dma-buf tests that still rely on
libdrm's bufmgr code).  At some point we should probably break that
final IGT dependency on libdrm so that these PCI ID resyncs won't be
necessary anymore, but that hasn't happened yet.

References: https://gitlab.freedesktop.org/drm/intel/-/issues/5416
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
2 years agobuild: set c_std to c11
Stephan Lachnit [Mon, 25 Jul 2022 15:37:32 +0000 (17:37 +0200)]
build: set c_std to c11

Signed-off-by: Stephan Lachnit <stephanlachnit@debian.org>
2 years agotests/util: Add simpledrm driver
Eric Curtin [Mon, 13 Jun 2022 15:07:35 +0000 (16:07 +0100)]
tests/util: Add simpledrm driver

Add an entry for the "simpledrm" driver, so that the test utilities
work with the simpledrm driver without passing the -M argument.

Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Eric Curtin <ecurtin@redhat.com>
2 years agotests/amdgpu/vcn: add unified queue support in vcn4
Ruijing Dong [Mon, 18 Jul 2022 15:41:23 +0000 (11:41 -0400)]
tests/amdgpu/vcn: add unified queue support in vcn4

add unified queue headers on the existing tests.

Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
2 years agotests/amdgpu/vcn: align comments for AMDGPU_HW_IP_VCN_ENC
Ruijing Dong [Mon, 18 Jul 2022 15:36:14 +0000 (11:36 -0400)]
tests/amdgpu/vcn: align comments for AMDGPU_HW_IP_VCN_ENC

From VCN4, AMDGPU_HW_IP_VCN_ENC is re-used to support both encoding
and decoding jobs.

Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
2 years agotests/amdgpu: enable vcn swRing test for version 4 and later
James Zhu [Fri, 11 Mar 2022 17:46:47 +0000 (12:46 -0500)]
tests/amdgpu: enable vcn swRing test for version 4 and later

Enable vcn decode software ring test for version 4 and later.

Signed-off-by: James Zhu <James.Zhu@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
2 years agoamdgpu: update marketing names for 22.20
Alex Deucher [Mon, 18 Jul 2022 21:06:32 +0000 (17:06 -0400)]
amdgpu: update marketing names for 22.20

Add new marketing names.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 years agobuild: bump version to 2.4.112 libdrm-2.4.112
Simon Ser [Wed, 6 Jul 2022 08:43:38 +0000 (10:43 +0200)]
build: bump version to 2.4.112

Signed-off-by: Simon Ser <contact@emersion.fr>
2 years agoxf86drmMode: introduce drmModeConnectorGetPossibleCrtcs
Simon Ser [Fri, 21 Jan 2022 22:14:50 +0000 (23:14 +0100)]
xf86drmMode: introduce drmModeConnectorGetPossibleCrtcs

Nowadays, users don't really care about encoders except for retrieving
the list of CRTCs compatible with a connector. Introduce a new function
so that users no longer need to deal with encoders.

This is a re-do of [1], but with a slightly different API.

Signed-off-by: Simon Ser <contact@emersion.fr>
[1]: https://gitlab.freedesktop.org/mesa/drm/-/merge_requests/102

2 years agotests: use drmModeGetConnectorTypeName
Simon Ser [Tue, 1 Feb 2022 13:36:52 +0000 (14:36 +0100)]
tests: use drmModeGetConnectorTypeName

Drop util_lookup_connector_type_name and use
drmModeGetConnectorTypeName instead.

Signed-off-by: Simon Ser <contact@emersion.fr>
2 years agoxf86drmMode: introduce drmModeGetConnectorTypeName
Simon Ser [Tue, 1 Feb 2022 13:33:34 +0000 (14:33 +0100)]
xf86drmMode: introduce drmModeGetConnectorTypeName

User-space often needs to print the name of a connector type.
When a new connector type is added, all user-space programs need
to be updated to support the new connector type.

Expose a function to get a connector type name in libdrm.

The names are taken from the kernel [1].

[1]: https://cgit.freedesktop.org/drm/drm/tree/drivers/gpu/drm/drm_connector.c?h=4fc8cb47fcfdc93e274a1291757e478df4f9c39b#n83

Signed-off-by: Simon Ser <contact@emersion.fr>
2 years agotests/amdgpu/vcn:vcn encoder unit test
Saleemkhan Jamadar [Tue, 19 Oct 2021 09:00:11 +0000 (14:30 +0530)]
tests/amdgpu/vcn:vcn encoder unit test

 Add support for vcn encoder unit test

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Signed-off-by: Saleemkhan Jamadar <saleemkhan.jamadar@amd.com>
Signed-off-by: Satyajit Sahu <satyajit.sahu@amd.com>
2 years agotests/amdgpu: fix decode test failure on VCN2.5
Sathishkumar S [Wed, 25 May 2022 09:15:08 +0000 (14:45 +0530)]
tests/amdgpu: fix decode test failure on VCN2.5

For VCN2.5 wrong index was chosen, fix it.

Signed-off-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
2 years agoxf86drmMode: constify drmModeAtomicReq functions
Simon Ser [Mon, 7 Feb 2022 10:59:54 +0000 (11:59 +0100)]
xf86drmMode: constify drmModeAtomicReq functions

This acts as an additional ABI guarantee, and improves
documentation for users.

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2 years agogen_table_fourcc: strip _MODIFIER suffix for INVALID
Simon Ser [Mon, 2 May 2022 17:24:43 +0000 (19:24 +0200)]
gen_table_fourcc: strip _MODIFIER suffix for INVALID

This is the only modifier printed with a "_MODIFIER" suffix. It
looks inconsistent when callers already print this word (e.g.
"modifier: INVALID_MODIFIER").

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Marius Vlad <marius.vlad@collabora.com>
2 years agobuild: bump version to 2.4.111 libdrm-2.4.111
Dave Airlie [Fri, 3 Jun 2022 04:02:49 +0000 (14:02 +1000)]
build: bump version to 2.4.111

Signed-off-by: Dave Airlie <airlied@redhat.com>
2 years agotests/amdgpu: use appropriate ring for different asics
Guchun Chen [Thu, 26 May 2022 01:42:58 +0000 (09:42 +0800)]
tests/amdgpu: use appropriate ring for different asics

Use compute ring in case of no gfx ring.

Signed-off-by: Guchun Chen <guchun.chen@amd.com>
2 years agoamdgpu: add marketing names from 22.10
Alex Deucher [Thu, 12 May 2022 20:23:45 +0000 (16:23 -0400)]
amdgpu: add marketing names from 22.10

Add new marketing names

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 years agotests/modeprint: fix argument type
Eleni Maria Stea [Mon, 9 May 2022 12:00:54 +0000 (15:00 +0300)]
tests/modeprint: fix argument type

Replaced the type PRId64 with PRIu64 in a printf as the argument was
unsigned to fix the related compiler warning.

Signed-off-by: Eleni Maria Stea <elene.mst@gmail.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
2 years agomodeprint, modetest, proptest: cast __u64 to uint64_t
Eleni Maria Stea [Mon, 9 May 2022 11:59:37 +0000 (14:59 +0300)]
modeprint, modetest, proptest: cast __u64 to uint64_t

It seems that __u64 values are defined differently across systems. In
glibc it's defined as unsigned long, in Linux kernel headers
(int-ll64.h) as unsigned long long, and on FreeBSD as uint64_t so it
matches glibc. A temporal solution is to cast all __u64 values to
uint64_t to avoid warnings on Linux, but ideally we'd like a better fix
in the future.

See also: https://gitlab.freedesktop.org/mesa/drm/-/merge_requests/212
for discussion.

Signed-off-by: Eleni Maria Stea <elene.mst@gmail.com>
2 years agoxf86drm.c: fix C99 warning
Eleni Maria Stea [Mon, 9 May 2022 11:56:11 +0000 (14:56 +0300)]
xf86drm.c: fix C99 warning

Moved declaration to the top to resolve C99 compliance warning.

Signed-off-by: Eleni Maria Stea <elene.mst@gmail.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
2 years agonouveau: add ioctl wrapper to check for dead channels
Karol Herbst [Tue, 3 Aug 2021 17:29:04 +0000 (19:29 +0200)]
nouveau: add ioctl wrapper to check for dead channels

v2: explicitly set nr_push to 0 as well

Signed-off-by: Karol Herbst <kherbst@redhat.com>
2 years agointel: Add support for RPLP
Tejas Upadhyay [Thu, 21 Apr 2022 17:04:52 +0000 (22:34 +0530)]
intel: Add support for RPLP

Add RPLP platform support and PCIIDs

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Tejas Upadhyay <tejaskumarx.surendrakumar.upadhyay@intel.com>
Signed-off-by: Raviteja Goud Talla <ravitejax.goud.talla@intel.com>
2 years agoman: Add formatting to drmModeGetConnector reference
Matt Turner [Tue, 19 Apr 2022 20:10:57 +0000 (13:10 -0700)]
man: Add formatting to drmModeGetConnector reference

Signed-off-by: Matt Turner <mattst88@gmail.com>
2 years agoman: Fix some typos
Matt Turner [Tue, 19 Apr 2022 18:53:55 +0000 (11:53 -0700)]
man: Fix some typos

Signed-off-by: Matt Turner <mattst88@gmail.com>
2 years agolibkms: Remove libkms completely
Daniel Stone [Tue, 29 Mar 2022 12:59:57 +0000 (13:59 +0100)]
libkms: Remove libkms completely

libkms was a very early attempt at a KMS management library, that only
got as far as handling requests to create buffers. It has since been
superseded by GBM in doing this, which everyone uses, unlike libkms
which no-one uses.

Remove it from the tree to avoid any confusion.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2 years agotests/amdgpu: add dispatch test for gfx10
Flora Cui [Wed, 13 Nov 2019 08:16:55 +0000 (16:16 +0800)]
tests/amdgpu: add dispatch test for gfx10

Signed-off-by: Flora Cui <flora.cui@amd.com>
2 years agotests/amdgpu: add draw test for gfx10
Flora Cui [Wed, 13 Nov 2019 05:54:54 +0000 (13:54 +0800)]
tests/amdgpu: add draw test for gfx10

Signed-off-by: Flora Cui <flora.cui@amd.com>
2 years agotests/amdgpu: Add test suite CP DMA
Lu Jiacheng [Wed, 9 Mar 2022 15:05:04 +0000 (15:05 +0000)]
tests/amdgpu: Add test suite CP DMA

2 years agoamdgpu: add marketing names from 21.50
Alex Deucher [Wed, 2 Mar 2022 16:51:08 +0000 (11:51 -0500)]
amdgpu: add marketing names from 21.50

Add new marketing names

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 years agotest/amdgpu: only disable deadlock tests on asics without GPU reset
Alex Deucher [Mon, 14 Feb 2022 21:31:45 +0000 (16:31 -0500)]
test/amdgpu: only disable deadlock tests on asics without GPU reset

Switch the logic to only disable the tests for asics which don't
have GPU reset support.  This way we don't need to update it
every time we add a new asic which does support it.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2 years agotests/amdgpu/hotunplu: Enable hotunplug tests.
Andrey Grodzovsky [Tue, 1 Mar 2022 17:56:05 +0000 (12:56 -0500)]
tests/amdgpu/hotunplu: Enable hotunplug tests.

I tested with latest amd-staging-drm-next and after minor
fix for me all the testys pass. I bumped libdrm minor version
for this.

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
2 years agotests: tegra: Add VIC flip test
Thierry Reding [Fri, 9 Jul 2021 19:10:22 +0000 (21:10 +0200)]
tests: tegra: Add VIC flip test

This test will attempt to use the VIC to blit one surface to another
and perform a vertical flip.

Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2 years agotests: tegra: Add VIC blit test
Thierry Reding [Fri, 9 Jul 2021 19:10:02 +0000 (21:10 +0200)]
tests: tegra: Add VIC blit test

This test will attempt to use the VIC to blit from one surface to
another.

Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2 years agotests: tegra: Add VIC clear test
Thierry Reding [Fri, 9 Jul 2021 19:09:39 +0000 (21:09 +0200)]
tests: tegra: Add VIC clear test

This test will attempt to use VIC to clear a surface.

Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>