Commit Graph

7101 Commits (7c5c742de8a8b577654964635f05d7033c92ee53)

Author SHA1 Message Date
Lang Yu 0a8fad5f5c 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>
2022-11-09 14:57:14 +08:00
Simon Ser b9ca37b313 build: bump version to 2.4.114
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-11-03 09:33:36 +01:00
Simon Ser e832f5b0b8 modetest: use dumb buffer helpers
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-11-02 18:46:38 +01:00
Simon Ser ce22377778 modetest: use sized integers in struct bo
Use the same size types as the kernel.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-11-02 18:46:15 +01:00
Simon Ser fc6bc66c64 modetest: drop unused offset field in struct bo
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-11-02 18:45:42 +01:00
Simon Ser 3be3b1a83f 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>
2022-10-27 22:18:22 +02:00
Simon Ser 82b2b1e898 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>
2022-10-23 17:47:24 +02:00
Alex Deucher a81b9ab8f3 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>
2022-10-17 16:19:44 -04:00
Alex Deucher 613cc945b3 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>
2022-10-17 16:19:44 -04:00
Alex Deucher 2ca30c7e4f 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>
2022-10-17 16:19:44 -04:00
Alex Deucher 7e4aa50e3d 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>
2022-10-17 16:19:44 -04:00
Alex Deucher 74b7b618dc 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>
2022-10-17 16:19:44 -04:00
Simon Ser ffb9375a50 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>
2022-10-17 12:03:50 +02:00
Marco Felsch e08a22dc43 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>
2022-10-06 18:38:29 +02:00
Simon Ser 0bd3e4e94f 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>
2022-10-03 09:03:30 +02:00
Simon Ser 2df9cc28c0 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 ‘drm_intel_gem_bo_unreference’:
    ../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>
2022-10-03 08:54:43 +02:00
Jordan Justen e0df5fce89
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>
2022-09-28 17:04:12 -07:00
Jordan Justen e2504b921f
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>
2022-09-28 17:03:04 -07:00
Eli Schwartz 474894ed17
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>
2022-09-11 01:49:42 -04:00
Simon Ser fb5c0c301a build: bump to version 2.4.113
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-08-31 16:38:38 +02:00
Simon Ser e761875fc5 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>
2022-08-31 06:40:49 +00:00
Simon Ser baa4b8cafc 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>
2022-08-31 06:40:49 +00:00
Matt Roper 03e0ab4d88 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>
2022-08-30 19:32:48 +00:00
Sui Jingfeng 33f0009de5 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>
2022-08-30 16:03:36 +01:00
Matt Turner d4bb19e2c4 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.
2022-08-23 22:54:15 +00:00
Eric Engestrom 3ff3d59ed9 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: 63fc571863 ("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>
2022-08-23 22:49:34 +00:00
Matthieu Herrb cf54ebf6cf 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>
2022-08-23 22:43:38 +00:00
Eric Engestrom a64a176cfd meson: simplify some more build options by using features
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Simon Ser <contact@emersion.fr>
2022-08-23 18:52:16 +01:00
Eric Engestrom 26eb15165b 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>
2022-08-23 18:52:16 +01:00
Eric Engestrom 4a7706b2a4 ci: drop dead script since e722ba9f67
Noticed-by: Michel Daenzer <michel@daenzer.net>
2022-08-23 17:54:58 +01:00
Eric Engestrom 502f64cb30 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>
2022-08-22 21:06:22 +01:00
Eric Engestrom 3e3874d50d ci: bump images tags to take !255 into effect
Reviewed-by: Simon Ser <contact@emersion.fr>
2022-08-22 18:53:08 +01:00
Eric Engestrom f32db9d354 ci/freedesktop: bump python version of docutils package as 3.8 no longer exists 2022-08-22 18:50:04 +01:00
Eric Engestrom 1637d8b020 ci: fix the tested meson version
Reviewed-by: Simon Ser <contact@emersion.fr>
2022-08-22 17:41:18 +01:00
Eric Engestrom 24163f40d3 ci: remove system meson before installing the pip one
Reviewed-by: Simon Ser <contact@emersion.fr>
2022-08-22 17:40:42 +01:00
Simon Zeni 46d1e99a5d 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>
2022-08-18 09:58:41 +00:00
Likun Gao 003eb2a554 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>
2022-08-15 06:10:15 +00:00
Likun Gao 3c04686ae5 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>
2022-08-15 06:10:15 +00:00
Flora Cui f1b897ec83 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>
2022-08-15 06:10:15 +00:00
Flora Cui cc3c80c6ae tests/amdgpu: refactor dispatch/draw test
Signed-off-by: Flora Cui <flora.cui@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
2022-08-15 06:10:15 +00:00
Hawking Zhang 176e6ce6f3 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>
2022-08-15 06:10:15 +00:00
Matt Roper 98794e2a0d 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>
2022-08-03 22:48:27 +00:00
Stephan Lachnit 40fcca248b
build: set c_std to c11
Signed-off-by: Stephan Lachnit <stephanlachnit@debian.org>
2022-07-25 17:37:32 +02:00
Eric Curtin 512c8a88ca 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>
2022-07-22 13:25:53 +01:00
Ruijing Dong 6070e6a798 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>
2022-07-20 18:23:59 -04:00
Ruijing Dong 8be3042864 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>
2022-07-20 18:23:55 -04:00
James Zhu e83aaae15e 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>
2022-07-20 18:23:45 -04:00
Alex Deucher e214a6a6e8 amdgpu: update marketing names for 22.20
Add new marketing names.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2022-07-18 17:08:21 -04:00
Simon Ser 60cf6bcef1 build: bump version to 2.4.112
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-07-06 10:43:38 +02:00
Simon Ser 3ee004ef52 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
2022-07-02 22:22:49 +02:00