Commit Graph

741 Commits (6a961ca843d154be994bd4d232a99d59d18fe26d)

Author SHA1 Message Date
Geert Uytterhoeven 6a961ca843 amdgpu: Use PRI?64 to format uint64_t
On 32-bit:

    ../tests/amdgpu/amdgpu_stress.c: In function ‘alloc_bo’:
    ../tests/amdgpu/amdgpu_stress.c:178:49: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘uint64_t’ {aka ‘long long unsigned int’} [-Wformat=]
      fprintf(stdout, "Allocated BO number %u at 0x%lx, domain 0x%x, size %lu\n",
                                                   ~~^
                                                   %llx
       num_buffers++, addr, domain, size);
                      ~~~~
    ../tests/amdgpu/amdgpu_stress.c:178:72: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 6 has type ‘uint64_t’ {aka ‘long long unsigned int’} [-Wformat=]
      fprintf(stdout, "Allocated BO number %u at 0x%lx, domain 0x%x, size %lu\n",
                                                                          ~~^
                                                                          %llu
       num_buffers++, addr, domain, size);
                                    ~~~~
    ../tests/amdgpu/amdgpu_stress.c: In function ‘submit_ib’:
    ../tests/amdgpu/amdgpu_stress.c:276:54: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘uint64_t’ {aka ‘long long unsigned int’} [-Wformat=]
      fprintf(stdout, "Submitted %u IBs to copy from %u(%lx) to %u(%lx) %lu bytes took %lu usec\n",
                                                        ~~^
                                                        %llx
       count, from, virtual[from], to, virtual[to], copied, delta / 1000);
                    ~~~~~~~~~~~~~
    ../tests/amdgpu/amdgpu_stress.c:276:65: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘uint64_t’ {aka ‘long long unsigned int’} [-Wformat=]
      fprintf(stdout, "Submitted %u IBs to copy from %u(%lx) to %u(%lx) %lu bytes took %lu usec\n",
                                                                   ~~^
                                                                   %llx
       count, from, virtual[from], to, virtual[to], copied, delta / 1000);
                                       ~~~~~~~~~~~
    ../tests/amdgpu/amdgpu_stress.c:276:70: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 8 has type ‘uint64_t’ {aka ‘long long unsigned int’} [-Wformat=]
      fprintf(stdout, "Submitted %u IBs to copy from %u(%lx) to %u(%lx) %lu bytes took %lu usec\n",
                                                                        ~~^
                                                                        %llu
       count, from, virtual[from], to, virtual[to], copied, delta / 1000);
                                                    ~~~~~~
    ../tests/amdgpu/amdgpu_stress.c:276:85: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 9 has type ‘uint64_t’ {aka ‘long long unsigned int’} [-Wformat=]
      fprintf(stdout, "Submitted %u IBs to copy from %u(%lx) to %u(%lx) %lu bytes took %lu usec\n",
                                                                                       ~~^
                                                                                       %llu
       count, from, virtual[from], to, virtual[to], copied, delta / 1000);
                                                            ~~~~~~~~~~~~
    ../tests/amdgpu/amdgpu_stress.c: In function ‘parse_size’:
    ../tests/amdgpu/amdgpu_stress.c:296:24: warning: format ‘%li’ expects argument of type ‘long int *’, but argument 3 has type ‘uint64_t *’ {aka ‘long long unsigned int *’} [-Wformat=]
      if (sscanf(optarg, "%li%1[kmgKMG]", &size, ext) < 1) {
                          ~~^             ~~~~~
                          %lli
    ../tests/amdgpu/amdgpu_stress.c: In function ‘main’:
    ../tests/amdgpu/amdgpu_stress.c:378:45: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘uint64_t’ {aka ‘long long unsigned int’} [-Wformat=]
         fprintf(stderr, "Buffer size to small %lu\n", size);
                                               ~~^     ~~~~
                                               %llu

Fix this by using the proper "PRI?64" format specifiers.

Fixes: d77ccdf3ba ("amdgpu: add amdgpu_stress utility v2")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
---
On Linux/amd64, the format strings in the resulting binary are
unchanged.

v3:
  - Add Reviewed-by,

v2:
  - Use PRI?64 to unbreak 64-bit build.
2023-09-04 09:31:55 +02:00
Ruijing Dong 5e0b1df4fb 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>
2023-07-17 08:40:11 -04:00
Saleemkhan Jamadar 7d7a9901bd 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>
2023-07-06 14:03:15 -04:00
Ruijing Dong 7784d57166 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>
2023-05-11 11:09:38 -04:00
Ruijing Dong 03d18b44db 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>
2023-05-11 11:09:32 -04:00
Luben Tuikov 28d9a3c4fb 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>
2023-03-24 13:47:21 +00:00
Luben Tuikov 41121251de 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>
2023-03-24 13:47:21 +00:00
Luben Tuikov 25e08fd9ae 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>
2023-03-24 13:47:21 +00:00
jie zhang d1681af054 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>
2023-03-17 17:24:14 +00:00
Yi Xie c6d6dce99f 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>
2023-02-10 05:22:52 +00:00
Saleemkhan Jamadar e699b28b54 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>
2022-11-11 09:57:01 -05:00
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 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
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 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
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
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
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
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
Simon Ser 0427c1f669 tests: use drmModeGetConnectorTypeName
Drop util_lookup_connector_type_name and use
drmModeGetConnectorTypeName instead.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-07-02 20:13:29 +00:00
Saleemkhan Jamadar f7828dc180 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>
2022-06-11 12:13:26 -04:00
Sathishkumar S 0b21fcb214 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>
2022-06-11 12:13:03 -04:00
Guchun Chen 362a93d1fb 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>
2022-05-26 21:02:33 +08:00
Eleni Maria Stea ae6d81da20 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>
2022-05-09 15:54:20 +03:00
Eleni Maria Stea 4caec56fb8 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>
2022-05-09 15:53:56 +03:00
Daniel Stone 2b997bb4bb 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>
2022-04-15 22:40:29 +00:00
Flora Cui 85393adb12 tests/amdgpu: add dispatch test for gfx10
Signed-off-by: Flora Cui <flora.cui@amd.com>
2022-03-30 16:39:02 +08:00
Flora Cui f2314a4871 tests/amdgpu: add draw test for gfx10
Signed-off-by: Flora Cui <flora.cui@amd.com>
2022-03-30 16:39:02 +08:00
Lu Jiacheng 7c28f52830 tests/amdgpu: Add test suite CP DMA 2022-03-09 15:05:04 +00:00
Alex Deucher dce623f525 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>
2022-03-02 16:10:41 +00:00
Andrey Grodzovsky b47c057d69 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>
2022-03-01 12:57:39 -05:00
Thierry Reding 8376362245 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>
2022-02-23 16:06:49 +01:00
Thierry Reding 8c4887b4e1 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>
2022-02-23 16:06:49 +01:00
Thierry Reding e9ddc93d8e 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>
2022-02-23 16:06:49 +01:00
Thierry Reding 26b872ebad tests: tegra: Add VIC 4.2 support
The Video Image Composer (VIC) 4.2 can be found on NVIDIA Tegra194 SoCs.
It uses a different class (C5B6) that is slightly incompatible with the
class found on earlier generations, although it is backwards compatible
with the class implemented on Tegra186 (B1B6).

Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2022-02-23 16:06:49 +01:00
Thierry Reding 5217c5c747 tests: tegra: Add VIC 4.1 support
The Video Image Composer (VIC) 4.1 can be found on NVIDIA Tegra186 SoCs.
It uses a different class (B1B6) that is slightly incompatible with the
class found on earlier generations.

Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2022-02-23 16:06:49 +01:00
Thierry Reding fa5dc0c925 tests: tegra: Add VIC 4.0 support
The Video Image Composer (VIC) 4.0 can be found on NVIDIA Tegra210 SoCs.
It uses a different class (B0B6) that is slightly incompatible with the
class found on earlier generations.

Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2022-02-23 16:06:49 +01:00
Thierry Reding 8215b29832 tests: tegra: Add VIC 3.0 support
The Video Image Composer (VIC) 3.0 can be found on NVIDIA Tegra124 SoCs.

Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2022-02-23 15:40:17 +01:00
Thierry Reding 2ddf703bc3 tests: tegra: Add VIC support
Implement a small abstraction interface to allow different versions of
VIC to be used transparently. An implementation will be chosen based on
the VIC version number reported by the DRM_TEGRA_IOCTL_OPEN_CHANNEL
IOCTL.

Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2022-02-23 15:40:15 +01:00
Thierry Reding b707a71654 tests: tegra: Add syncpoint timeout test
This test can be used to purposefully trigger a job timeout.

Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2022-02-23 15:40:12 +01:00
Thierry Reding 637d6a46d3 tests: tegra: Add syncpt-wait test
This is a very simple sanity test to check whether or not a syncpt can
be incremented by a host1x client. This uses gr2d on Tegra20 through
Tegra114 and VIC on Tegra124 and later.

Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2022-02-23 15:40:11 +01:00
Thierry Reding 8f8e54d688 tests: tegra: Add gr2d-fill test
This test uses the IOCTLs for job submission and fences to fill a sub-
region of the screen to a specific color using gr2d.

Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2022-02-23 15:40:09 +01:00
Thierry Reding 37fbc4c892 tests: tegra: Add helper library for tests
This library provides helpers for common functionality needed by test
programs.

Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2022-02-23 15:40:06 +01:00