Commit Graph

775 Commits (f94a79a7a7cf4f84caaec6625ab43793e81721c2)

Author SHA1 Message Date
Andrey Grodzovsky 21f1176458 amdgpu/test: Fix deadlock tests for AI and RV v2
Seems like AI and RV requires uncashed memory mapping to be able
to pickup value written to memory by CPU after the WAIT_REG_MEM
command was already launched.
.
Enable the test for AI and RV.

v2:
Update commit description.

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2018-10-10 14:38:19 -04:00
Andrey Grodzovsky eabc4cb35c amdgpu/test: Allow BO mapping flags to be passed in tests
v2:
Call amdgpu_bo_va_op_raw directly in amdgpu_bo_alloc_and_map_raw
Move amdgpu_bo_alloc_and_map_raw into C file to avoid including
unistd.h in amdgpu_test.h

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2018-10-10 14:38:19 -04:00
Ezequiel Garcia 5775741d16 tests/util: Add support for sun4i-drm driver
This is the DRM driver for all Allwinner (sunxi) platforms.

Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2018-10-04 14:46:47 +01:00
Stefan Agner 8d44918a7d modeprint: print encoder type
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2018-10-04 14:26:48 +01:00
Stefan Agner eaed5c8825 modeprint: use libutil to lookup strings
Use libutil to lookup connector type names and state. This also
makes sure that the latest connector type addition "DPI" gets
printed correctly.

Signed-off-by: Stefan Agner <stefan@agner.ch>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2018-10-04 14:26:16 +01:00
Lucas De Marchi 1e3fcc495b autotools: make symbols hidden by default
Now that symbols that should be exported are annotated accordingly, make
all the rest hidden by default.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Acked-by: Eric Engestrom <eric.engestrom@intel.com>
2018-09-19 22:46:45 -07:00
Lucas De Marchi ba808253bc meson: make symbols hidden by default
Now that symbols that should be exported are annotated accordingly, make
all the rest hidden by default.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
2018-09-19 22:46:45 -07:00
Christian König b46945e2dc test/amdgpu: add GDS, GWS and OA tests
Add allocation tests for GDW, GWS and OA.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2018-09-18 14:56:40 +02:00
Christian König 864d4501b9 test/amdgpu: add proper error handling v2
Otherwise the calling function won't notice that something is wrong.

v2: check map result as well

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2018-09-18 14:56:22 +02:00
Christian König 5bd5f7b25e tests/amdgpu: add unaligned VM test
Make a VM mapping which is as unaligned as possible.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
2018-09-14 14:13:03 +02:00
Likun Gao cc472c5bb3 amdgpu: Disable deadlock test suite for RV
disable deadlock test suite for RV

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Likun Gao <Likun.Gao@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2018-08-16 13:45:20 -05:00
Junwei Zhang f4f61e5ec8 tests/amdgpu: add test for finding bo by CPU mapping
Add a test for API to query bo by CPU mapping

Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2018-08-08 12:37:49 +02:00
Benjamin Gaignard f693c468c1 tests/util: Add support for stm module
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2018-08-07 15:40:35 +01:00
Benjamin Gaignard 93220283cb tests/modetest: Add atomic support
If "-a" option is set this make modetest use atomic API instead
of legacy API.

Test the frame rate ("-v") it does a loop and swap between two
framebuffer for each active planes.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2018-08-07 13:39:20 +01:00
Emil Velikov 68bd236aa4 drmdevice: print the correct host1x information
While fairly close, the host1x and platform are two separate things.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Tested-by: Robert Foss <robert.foss@collabora.com>
Reviewed-by: Robert Foss <robert.foss@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
2018-07-24 16:27:57 +01:00
Emil Velikov 8a3a8c15e2 drmdevice: convert the tabbed output into a tree
Making the output a little bit easier to parse by human beings.

v2: Add extra whitespace (Eric)

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Tested-by: Robert Foss <robert.foss@collabora.com> (v1)
Reviewed-by: Robert Foss <robert.foss@collabora.com> (v1)
Reviewed-by: Eric Engestrom <eric@engestrom.ch> (v1)
2018-07-24 16:27:52 +01:00
Emil Velikov 33b035722b tests/drmdevice: add a couple of printf headers
Add a few printf statements, which should make the output easier to
parse.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Tested-by: Robert Foss <robert.foss@collabora.com>
Reviewed-by: Robert Foss <robert.foss@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
2018-07-24 16:27:50 +01:00
Emil Velikov c64dc00fd9 tests/drmdevices: install alongside other utilities
It's mildly useful program, to ship it when the user wants the "tests"
installed. Obviously the "tests" in the name is a misnomer.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Tested-by: Robert Foss <robert.foss@collabora.com>
Reviewed-by: Robert Foss <robert.foss@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
2018-07-24 16:27:37 +01:00
Xiaojie Yuan d4b4c51437 amdgpu: enlarge the maximum number of cards supported
128 is the maximum number of cards that the kernel can support
at the moment.

Change-Id: I155b7b21635306d8ecc440b85fb8954501ab5599
Signed-off-by: Xiaojie Yuan <Xiaojie.Yuan@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2018-04-19 16:48:51 +02:00
James Zhu cb850ceb0f tests/amdgpu: add vce mv tests support and sets
Signed-off-by: James Zhu <James.Zhu@amd.com>
Acked-by: Leo Liu <leo.liu@amd.com>
2018-04-06 09:35:14 -04:00
Eric Engestrom 0926f0af54 meson,configure: include config.h automatically
This will prevent any more missing `#include "config.h"` bug, at the
cost of having to recompile some files that didn't need to be when
changing build options.

Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2018-03-20 18:19:26 +00:00
Inki Dae 32e0370e36 tests: fix memory leak issue
Fixed memory leak issue to drmModeRes and drmModePlaneRes objects.

These objects were allocated by drmModeGetResources and
drmModeGetPlaneResources functions but not freed properly.

So this patch frees them by calling drmModeFreeResources
drmModeFreePlaneResources functions at failure case.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2018-03-20 14:14:51 +00:00
Seung-Woo Kim dff690ac31 tests/exynos: remove dead condition
There is already condition checking input values between 2 and 4096
so condition checking 0 is always false. Remove the dead condition.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2018-03-15 16:30:14 +00:00
Michel Dänzer a1a13d2002 tests/amdgpu: Fix misspellings of "suite"
Acked-by: Christian König <christian.koenig@amd.com>
2018-03-02 12:19:11 +01:00
Chunming Zhou 1f6a85cc37 test/amdgpu: disable bo eviction test by default
if some system has no swap space and memory is less, than the test
could fail.
And bo eviction test takes much more time in some system, which effects
automation test result and efficiency.
So disable it by default now, only be used by developer manually.

Signed-off-by: Chunming Zhou <david1.zhou@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
2018-03-02 10:32:22 +08:00
Thierry Reding ab5aaf6c8e drm/tegra: Sanitize format modifiers
The existing format modifier definitions were merged prematurely, and
recent work has unveiled that the definitions are suboptimal in several
ways:

  - The format specifiers, except for one, are not Tegra specific, but
    the names don't reflect that.
  - The number space is split into two, reserving 32 bits for some
    "parameter" which most of the modifiers are not going to have.
  - Symbolic names for the modifiers are not using the standard
    DRM_FORMAT_MOD_* prefix, which makes them awkward to use.
  - The vendor prefix NV is somewhat ambiguous.

Fortunately, nobody's started using these modifiers, so we can still fix
the above issues. Do so by using the standard prefix. Also, remove TEGRA
from the name of those modifiers that exist on NVIDIA GPUs as well. In
case of the block linear modifiers, make the "parameter" smaller (4
bits, though only 6 values are valid) and don't let that leak into any
of the other modifiers.

Finally, also use the more canonical NVIDIA instead of the ambiguous NV
prefix.

This is based on commit 5843f4e02fbe86a59981e35adc6cabebee46fdc0 from
Linux v4.16-rc1 and also updates modetest to use the new defines.

Acked-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2018-02-19 14:58:57 +01:00
Chunming Zhou 09642c073e tests/amdgpu: add bo eviction test
for(( i=1; i < 100; i++))
do
     echo "Hello, Welcome $i times "
     sudo ./amdgpu_test -s 1 -t 5
done

with above stricpt, run in two terminals, will reproduce Felix's swap leeking issue.

Signed-off-by: Chunming Zhou <david1.zhou@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
2018-02-08 15:03:47 +08:00
Emil Velikov 10e85a8b7f tests/amdgpu: add missing config.h include
Otherwise we'll end up without the macros set during configure stage.
And effectively error out in sanity tests such as the mmap static
assert.

To reproduce, do a multilib build - 32bit build on 64bit machine.

Cc: Fabio Pedretti <pedretti.fabio@gmail.com>
Cc: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Fixes: 33dcc29f7c ("amdgpu: Add VMID reservation per GPU context test.")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104819
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2018-01-31 15:57:58 +00:00
Eric Engestrom 440e6ad070 exynos/tests: use #ifdef for never-defined token
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2018-01-31 11:22:57 +00:00
Eric Engestrom d2b0a4ec70 always define HAVE_CAIRO
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2018-01-29 15:41:52 +00:00
Eric Engestrom 44867b0eef tests/etnaviv: drop unused `return 0`
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2018-01-29 15:41:52 +00:00
Eric Engestrom 28052ad589 tests/util: drop unused parameters
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2018-01-29 15:41:52 +00:00
Eric Engestrom 256cdc02a8 tests/util: fix signed/unsigned comparisons
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2018-01-29 15:41:52 +00:00
Eric Engestrom 80f33f4529 tests/amdgpu: drop unused variables
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2018-01-29 15:41:52 +00:00
Eric Engestrom c6fcd176e8 tests/amdgpu: add parentheses to make operation priority explicit
While at it, align with the other half on the next line.

Cc: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2018-01-29 15:41:52 +00:00
Eric Engestrom 089d45456b remove unnecessary double-semicolon
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2018-01-29 15:41:52 +00:00
Michel Dänzer 82aef5f0cb amdgpu: Disable VM test suite by default for SI ASICs
Hangs my Cape Verde.

Acked-by: Christian König <christian.koenig@amd.com>
2018-01-26 15:25:17 +01:00
Michel Dänzer 8e75f5a145 amdgpu: Disable deadlock test suite by default for SI ASICs
Hangs my Cape Verde.

Acked-by: Christian König <christian.koenig@amd.com>
2018-01-26 15:25:17 +01:00
Andrey Grodzovsky 429bb5820d amdgpu: Fix segfault in deadlock test.
If amdgpu_cs_query_fence_status terminates prematurely the BO
sometimes is unmapped before helper thread writes a vlaue
into it causing a segfault.

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
2018-01-26 07:45:48 -05:00
Andrey Grodzovsky 5e239f3e3d amdgpu: Update deadlock test to not assert on ECANCELED
Kernel will abort jobs for guilty (causing GPU hang) context
with -ECANCELED don't assert if that the case.

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
2018-01-26 07:45:34 -05:00
Seung-Woo Kim 6736ad45d8 modetest: Fix to check return value of asprintf()
There is warning about ignoring return value of 'asprintf'. Fix to
check return value of asprintf().

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2018-01-25 10:39:30 +00:00
Michel Dänzer 032bb3b11d amdgpu: Symlink .editorconfig to tests/amdgpu
In order to use consistent editorconfig settings in both amdgpu
directories.

Reviewed-by: Christian König <christian.koenig@amd.com>
2018-01-18 10:12:37 +01:00
Michel Dänzer 6fe93b8000 amdgpu: Don't dereference device_handle after amdgpu_device_deinitialize
Fixes use after free:

==2537== Invalid read of size 4
==2537==    at 0x1162C9: suite_deadlock_tests_enable (deadlock_tests.c:101)
==2537==    by 0x10B157: amdgpu_disable_suits (amdgpu_test.c:421)
==2537==    by 0x10B157: main (amdgpu_test.c:560)
==2537==  Address 0x5e44f24 is 452 bytes inside a block of size 1,016 free'd
==2537==    at 0x4C2BE1B: free (vg_replace_malloc.c:530)
==2537==    by 0x504CD8B: amdgpu_device_reference (amdgpu_device.c:164)
==2537==    by 0x504CD8B: amdgpu_device_deinitialize (amdgpu_device.c:307)
==2537==    by 0x1162BB: suite_deadlock_tests_enable (deadlock_tests.c:97)
==2537==    by 0x10B157: amdgpu_disable_suits (amdgpu_test.c:421)
==2537==    by 0x10B157: main (amdgpu_test.c:560)
==2537==  Block was alloc'd at
==2537==    at 0x4C2CC05: calloc (vg_replace_malloc.c:711)
==2537==    by 0x504CA5E: amdgpu_device_initialize (amdgpu_device.c:212)
==2537==    by 0x116298: suite_deadlock_tests_enable (deadlock_tests.c:93)
==2537==    by 0x10B157: amdgpu_disable_suits (amdgpu_test.c:421)
==2537==    by 0x10B157: main (amdgpu_test.c:560)

Reviewed-by: Christian König <christian.koenig@amd.com>
2018-01-16 16:57:57 +01:00
Dylan Baker 5f7deb5078 Add meson build system
This patch adds a complete meson build system, including tests and
install. It has the necessary hooks to allow it be used as a subproject
for other meson based builds such as mesa.

Signed-off-by: Dylan Baker <dylan.c.baker@intel.com>
Reviewed-and-tested-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2018-01-12 09:40:48 -08:00
Hawking Zhang f115de819b tests/amdgpu: execute copy linear on all the available rings
Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2018-01-12 12:17:24 -05:00
Hawking Zhang cbbb8a332d tests/amdgpu: execute const fill on all the available rings
Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2018-01-12 12:15:40 -05:00
Hawking Zhang 168dbe9a0e tests/amdgpu: execute write linear on all the available rings
Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2018-01-12 12:12:40 -05:00
Christian König de807d1a74 test/amdgpu: fix compiler warnings
SWAP_32() should mask first and then shift.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2018-01-09 17:15:13 +01:00
Andrey Grodzovsky 4f8e426884 tests/amdgpu: Add return CUE_SUCCESS to suite_vcn_tests_clean.
fixes: 806d080360 (amdgpu: Use new suite/test disabling functionality.)
    bug: https://bugs.freedesktop.org/show_bug.cgi?id=104280

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2017-12-15 13:30:53 -05:00
Andrey Grodzovsky 7f2993948c amdgpu: Remove dummy CU_ASSERT_EQUAL.
Fixes test failure on rhel.

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Reviewed-by: Qiang Yu <Qiang.Yu@amd.com>
2017-12-12 09:25:50 -05:00
Andrey Grodzovsky bc21168fa9 amdgpu: Add explicit dependency test.
The test is as following:

1) Create context A & B
2) Send a command submission using context A which fires up a compute shader.
3) The shader wait a bit and then write a value to a memory location.
4) Send a command submission using context B which writes another value to the same memory location, but having an explicit dependency on the first command submission.
5) Wait with the CPU for both submissions to finish and inspect the written value.

Test passes if the value seen in the memory location after both submissions is from command B.

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
2017-11-30 14:51:12 -05:00
Andrey Grodzovsky aeab24aa9e amdgpu: Dynamicly disable BO suite "Metadata" test.
Disable the test instead of doing  #ifdef 0

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2017-11-29 10:31:10 -05:00
Andrey Grodzovsky 1a129004a8 amdgpu: Switch amdgpu CS tests enabling to the new way.
Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2017-11-29 10:31:00 -05:00
Andrey Grodzovsky 18ffe485cd amdgpu: Disable deadlock test suite for Vega 10
The test stalls the CP, until RCA is done the test is
disabled to not disrupt regression testing.

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
2017-11-15 23:28:45 -05:00
Andrey Grodzovsky 9ad9b7e91e amdgpu: Add memory over allocation test.
Allocates 1 TB of memory. Test is disabled by default
since it's triggers OOM killer.

v2:
FIx the test to only alloc the BO and assert if return value
not equal to -ENOMEM and remove test disable on start.

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2017-11-14 14:26:25 +01:00
Andrey Grodzovsky 818a0d4245 amdgpu: Move memory alloc tests in bo suite.
Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2017-11-13 18:20:27 +01:00
Andrey Grodzovsky 806d080360 amdgpu: Use new suite/test disabling functionality.
Switch from disabling tests during run to using the new disable
API.

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2017-11-13 18:20:22 +01:00
Andrey Grodzovsky 864219425d amdgpu: Add functions to disable suites and tests.
Suits are diasbled based on hooks they provide (e.g incompatible
ASIC or missing blocks). Single tests are diasbled explicitly.
Suit or test can be forced to execute even if disabled by adding -f
flag after specifying suit [test] ids.

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2017-11-13 18:20:05 +01:00
Inki Dae be40710f06 exynos: change the license to X11/MIT
Change GPL license of Exynos related code to X11/MIT.

I'd like to keep a consistent license across all Exynos code
because License checker notices two more licenses exist
in libdrm.

For the license change I need to get your agree - all committers.
So please give me Acked-by if you agree with me.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
Acked-by: Hyungwon Hwang <human.hwang@samsung.com>
Acked-by: SooChan Lim <sc1.lim@samsung.com>
Acked-by: Sangjin LEE <lsj119@samsung.com>
Acked-by: Boram Park <boram1288.park@samsung.com>
Acked-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Acked-by: Joonyoung Shim <jy0922.shim@samsung.com>
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Acked-by: Jan Vesely <jan.vesely@rutgers.edu>
2017-11-07 11:19:58 +00:00
Andrey Grodzovsky f3091bac21 amdgpu: Fix wrappers for AMDGPU_VM IOCTL.
Rmove amdgpu_context_handle from the interface and use
amdgpu_device_handle instead. Uupdate VMID reservation test
accordingly.

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2017-11-03 13:07:30 +01:00
Andrey Grodzovsky 33dcc29f7c amdgpu: Add VMID reservation per GPU context test.
The test will Reserve a VMID, submit a command and
unreserve the VMID.

v2:
Wrappers names were changed.

Signed-off-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2017-10-27 18:26:08 +02:00
Ville Syrjälä ba68d7bf60 modetest: Allow full testing of primary planes
Allow the user to override the default configuration set by setcrtc
for the primary plane. On some hardware primary planes can be freely
positioned/sized, and it'd be nice if we can actually test that feature.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2017-10-19 19:16:16 +03:00
Kristian H. Kristensen 511c71c868 modetest: Decode IN_FORMATS plane blob property
This teaches modetest about the new IN_FORMATS blob and decodes the
blob to show supported formats and modifiers.

Signed-off-by: Kristian H. Kristensen <hoegsberg@chromium.org>
2017-10-18 12:32:40 -07:00
James Zhu 2ecafcae8a tests/amdgpu: fix uvd enc data corruption issue
In uvd encode parameter package, parameters input_pic_luma_pitch and
input_pic_chroma_pitch should be picture width align with hardware alignment.
The hardware alignment is 16 for amdgpu family earlier than AMDGPU_FAMILY_AI,
and 256 for later than and including AMDGPU_FAMILY_AI.

Signed-off-by: James Zhu <James.Zhu@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
2017-10-06 09:40:06 -04:00
James Zhu 657b09438b tests/amdgpu: add new uvd enc support check
Query hardware IP information to find out if there are uvd encode rings
ready for use in kernel driver.

Signed-off-by: James Zhu <James.Zhu@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
2017-10-06 09:40:06 -04:00
Andrey Grodzovsky 670db97dc3 amdgpu: Add deadlock detection test suit.
Adding initial tests for locks detection when SW
scheduler FIFO is full.

The test works by submitting a batch of identical commands which make the CP
stall waiting for condition to become true. The condition is later satisfied
form a helper thread. Other events that happen during this time
might create deadlock situations. One such example is GPU reset
triggered by this stall when  amdgpu_lockup_timeout != 0.

v2:
Increase the delay from 2 to 100 ms.
Comment out the compute test until it's working.
Typos fix.

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2017-10-04 10:50:02 +02:00
Christian König 736ef0b61c amdgpu: make userptr unit test more interesting
Do a fork() to force some MMU callbacks.

Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
2017-10-04 10:47:49 +02:00
Alex Deucher 05a830d382 tests/amdgpu: add missing header to SOURCES
Fixes the tarball generation.

fixes: 9d133dd087 (tests/amdgpu: add uvd encode unit tests)
bug: https://bugs.freedesktop.org/show_bug.cgi?id=102391
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2017-08-31 10:23:18 -04:00
Jan Vesely 20138ea997 drmsltest: Check expected neighbours
Fixes: 7d8c946408
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-08-21 13:05:13 +01:00
Boyuan Zhang 9d133dd087 tests/amdgpu: add uvd encode unit tests
Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Acked-by: Alex Deucher <alexander.deucher at amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
2017-08-16 16:16:50 -04:00
Flora Cui e2b6785c5a test/amdgpu: fix test failure for SI
Signed-off-by: Flora Cui <Flora.Cui@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2017-08-04 08:27:06 -04:00
Hawking Zhang 4d0e05eb2a tests/amdgpu: bypass VCE tests on raven
raven doesn't support VCE

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Xiaojie Yuan <Xiaojie.Yuan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2017-08-04 08:25:00 -04:00
Hawking Zhang 517df5f513 tests/amdgpu: bypass UVD CS tests on raven
raven doesn't support UVD decode

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Xiaojie Yuan <Xiaojie.Yuan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2017-08-04 08:24:51 -04:00
Michel Dänzer 57d67d55d3 tests/amdgpu: s/uvd_messages.h/decode_messages.h/ in Makefile.am
Fixes make distcheck with amdgpu enabled.

Fixes: ec65d19809 ("tests/amdgpu: rename uvd messages to decode
                      messages")

Trivial.
2017-06-12 17:16:47 +09:00
Tom St Denis b6f450e065 tests/amdgpu: Fix device_id option
The device_id option [-d] was badly broken.  This commit fixes
the width (was 8 is now 16 bits) as well as enables searches
without specifying a bus id.  It was also comparing "dev" from
the bus field which is not the PCI device id.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
2017-06-06 12:14:13 -04:00
Leo Liu 16444e1061 tests/amdgpu: implement vcn dec unit tests
Signed-off-by: Leo Liu <leo.liu@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
2017-06-05 10:41:13 -04:00
Leo Liu c1f5eea50f tests/amdgpu: add vcn tests support and sets
Signed-off-by: Leo Liu <leo.liu@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
2017-06-05 10:41:13 -04:00
Leo Liu 01096f2122 tests/amdgpu: move decode sum to common
Signed-off-by: Leo Liu <leo.liu@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
2017-06-05 10:41:13 -04:00
Leo Liu 1851f1b57a tests/amdgpu: separate decode messages
AVC decode messages will be common with VCN decode

Signed-off-by: Leo Liu <leo.liu@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
2017-06-05 10:41:13 -04:00
Leo Liu ec65d19809 tests/amdgpu: rename uvd messages to decode messages
It will be shared with VCN decode

Signed-off-by: Leo Liu <leo.liu@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
2017-06-05 10:41:13 -04:00
Eric Anholt 2ee1fd2470 Add the DPI encoder/connector types to KMS utils.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2017-04-25 16:10:38 -07:00
Eric Anholt d75a7ef1d7 Add pl111 as a KMS driver for utils.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2017-04-25 16:10:33 -07:00
Ilia Mirkin 691a215799 modetest: fix printing of fourcc on BE machines
fourcc is not a string, it's a packed integer. This happens to work out
on LE, but gets reversed on BE.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2017-04-19 23:25:43 -04:00
Nicolai Hähnle 90c304584a amdgpu: add a test for amdgpu_cs_wait_fences
Signed-off-by: monk.liu <Monk.Liu@amd.com>
[v2: actually hook up the test case]
Signed-off-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-04-18 21:05:48 +02:00
Bernd Kuhls 6796859fcc tests/etnaviv: link against libdrm
Fixes link errors detected by buildroot autobuilders:

http://autobuild.buildroot.net/results/68a/68af62f4ab6944d326468818562c05fd5cc55b03/build-end.log

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100530
Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-04-03 17:57:22 +01:00
Rob Herring c4d673acdc Android: fix building of modetest and proptest
These tests depend on tests/util/ headers, but expect the include path
to be tests/.

Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-04-03 17:46:06 +01:00
Seung-Woo Kim 2dc30dd527 tests/exynos: fix invalid code of error path in g2d test
This patch fixes invalid code of error path including NULL
deference and leak in g2d test.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-04-03 17:46:06 +01:00
Seung-Woo Kim a398adba7c tests/exynos: remove unused-function build warning
The function g2d_blend_test() is blocked to call because of
feature unsafety. This patch blocks with proper feature name
and also blocks the function itself to remove build warning.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-04-03 17:46:06 +01:00
Junwei Zhang a784c38af7 tests/amdgpu: add Polaris12 support for cs test
Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com>
Reviewed-by: Ken Wang <Qingqing.Wang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-03-27 21:42:07 +02:00
Leo Liu f810e31bcf tests/amdgpu: add vce unit test support for vega10
swizzle mode needs reference and input picture luma and
chroma pitch aligned with 256

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-03-27 21:42:07 +02:00
Leo Liu 5a44f9e6c6 tests/amdgpu: add uvd unit test support for vega10
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-03-27 21:42:07 +02:00
Huang Rui fee173dc77 tests/amdgpu: fix the count number for vega10
Signed-off-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Ken Wang <Qingqing.Wang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-03-27 21:42:07 +02:00
Emil Velikov 07edf5d905 Remove unused tests/drmstat.c
Earlier commit removed all the legacy 'tests' but a file was left
danglig.

Fixes: 0c80fddd1d "tests: remove useless legacy tests"
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reported-by: Andreas Boll <andreas.boll.dev@gmail.com>
Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2017-02-01 22:09:42 +00:00
Alex Xie 8a89d5f620 amdgpu: A new option to run tests on render node
Tested:
1. As root, tests passed on primary.
2. As root, tests passed on render node.
   BO export/import test was skipped
3. As non-privileged user, tests failed on primary as expected.
4. As non-privileged user, tests passed on render node.
   BO export/import test was skipped

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Alex Xie <AlexBin.Xie@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2017-01-27 11:56:23 -05:00
Alex Xie 12dd7a2e9c amdgpu: A new option to choose which device to run most tests
This can be used to test multiple GPUs

v2: Use PCI bus ID and optional PCI device ID to choose device
    Add an option to display information of AMDGPU devices

Tested:
   ./amdgpu_test -p
   ./amdgpu_test
   ./amdgpu_test -b 1 #fail as expected
   ./amdgpu_test -b 6 #pass
   ./amdgpu_test -b -d 1 #fail as expected
   ./amdgpu_test -b -d 0 #pass

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Alex Xie <AlexBin.Xie@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2017-01-27 11:55:28 -05:00
Alex Xie 5e0f7c5c65 amdgpu: verify the tested device
Verify the vender ID and driver name.
Open all AMDGPU devices.
Provide an option to open render node.

Tested as root: PASS
Tested as non-privileged user:
All tests failed as expected

v2: Return value in the ene of function amdgpu_open_devices.
    Check the return value of amdgpu_open_devices.
    amdgpu_test is not for USB device for the time being.
    Get the name of node from function drmGetDevices2.
    Drop the legacy drmAvailable() from the test.

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Alex Xie <AlexBin.Xie@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2017-01-27 11:53:26 -05:00
Tomasz Figa 8ef7e5b702 tests: Use -pthread in CFLAGS instead of -lpthread
-lpthread is not always a valid flag to pull pthread support, especially
on Android it will fail to link due to a missing libpthread.so. The more
generic way to build-in pthread support is to use the -pthread CFLAG, so
let's use it instead.

Signed-off-by: Tomasz Figa <tfiga@chromium.org>
[Emil Velikov: rebase on top of previous commit]
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2017-01-27 16:18:02 +00:00
Emil Velikov 58459a57fa tests/nouveau: automake: fold C and CPP flags
Since we don't have any C++ souces this should be a no-op. Folding the
two seems to be the common practise throughout the repo.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2017-01-27 16:15:45 +00:00
Emil Velikov 03d2e91d00 android: introduce Android.common.mk to reduce boilerplate
... across the makefiles. Currently this isn't much but that will change
shortly.

As an added bonus this fixes all present and future cases where we've
forgotten to strip out the headers from LOCAL_SRC_FILES.

In a couple of cases (the tests) we start setting
LOCAL_EXPORT_C_INCLUDE_DIRS, which shouldn't be an issue.

Cc: Chih-Wei Huang <cwhuang@android-x86.org>
Cc: Rob Herring <robh@kernel.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Rob Herring <robh@kernel.org>
2017-01-27 15:48:16 +00:00
Emil Velikov de5b41ef5a android: remove LOCAL_MODULE_TAGS := optional tag
Seems to be the default option since ~2009 with commit 2f31293ba78 "auto
import from //branches/cupcake/...@137197". Fleshed out from a larger
commit in the AOSP repo/fork.

Cc: Dan Willemsen <dwillemsen@google.com>
Cc: Chih-Wei Huang <cwhuang@android-x86.org>
Cc: Rob Herring <robh@kernel.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Rob Herring <robh@kernel.org>
2017-01-27 15:47:13 +00:00
Thierry Reding 13b99f2a89 tests/drmdevice: Add USB, platform and host1x support
Extend the drmdevice test with support for the newly added USB, platform
and host1x busses.

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2017-01-20 16:27:33 +01:00
Neil Armstrong 9e4c686aa3 tests/util: Add support for meson module
Add support for Amlogic Meson DRM driver merged for Linux 4.10.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2017-01-19 10:18:33 +01:00
Alex Xie e1ee01a758 amdgpu: Provide more specific error message if non-privileged user runs amdgpu_test
Before this change, the error message is:
"WARNING - Suite initialization failed..."
People might think this is a driver problem.

Tested with non-privileged user. Now the error message is like:
...
Error:Permission denied. Hint:Try to run this test program as root.
WARNING - Suite initialization failed for 'Basic Tests'.
...

Tested as root with no regression.

amdgpu_test uses CUnit. CUnit outputs warning message to stdout.
To be consistent, this commit outputs error message to stdout.

v2: Use strerror instead of %m. %m is a GNU C Library extension.
v3: Limit code and commit message within 80 characters per line.
    Update commit message.
    Remove a space before starting parenthesis in function call.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Xie <AlexBin.Xie@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2017-01-13 10:35:43 -05:00
Ville Syrjälä e3af5368b2 modetest: Allow the user to specify the plane ID
Devices can have multiple planes, so allow the user to choose between
them.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2016-12-19 15:14:07 +02:00
Emil Velikov 5c1c91b3d3 tests: automake: reorder makefile contents
Purely cosmetic changes.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-12-05 17:24:32 +00:00
Emil Velikov 0c80fddd1d tests: remove useless legacy tests
All of these 'tests' cover UMS functionality which is neither being
worked on or actively maintained.

The only cases where developers touch UMS code is to unwrap it from the
KMS codepaths and ensure that those are secure.

Anyone who feels strong about having these around can revive them, but
in all honestly do consider _seriously_ what you're doing ;-)

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-12-05 17:23:45 +00:00
Emil Velikov b305238ceb tests/drmdevice: use drmGetDevice[s]2
Pass along DRM_DEVICE_GET_PCI_REVISION only when the individual nodes
are opened and update the printed messages accordingly.

v2: Attribute for the flag rename, call drmGetDevices2 w/o the flag.

v3: Keep drmParsePciDeviceInfo() hunk in previous patch.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2016-12-05 17:22:52 +00:00
Grazvydas Ignotas 1fc32f1cc5 tests: kms: fix shadowed declaration warning
There is no need to maintain the value in the shadowed variable from
what I can see.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-11-22 13:54:31 +00:00
Leo Liu 207efb16ea tests/amdgpu: update vce encRefPic addr mode to tiled
Adapt to recent firmware update, it's also compatible with previous
firmware version

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2016-09-30 14:28:03 -04:00
The etnaviv authors 0659558f64 libdrm: add etnaviv tests
This adds the following basic unit tests:

- etnaviv_2d_test
  Let the 2D core render a defined pattern into a bo
  and store it as bmp.

- etnaviv_bo_cache_test
  Basic tests to validate the bo-cache behavior.

- etnaviv_cmd_stream_test
  Tests for the etna_cmd_stream API.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
2016-09-17 15:05:33 +02:00
Stéphane Marchesin 72a041694e modetest: Also print the pixel clock
This can be useful for debugging. xrandr prints it, so why not.

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-09-01 16:02:46 +01:00
Daniel Kurtz 587e5a8179 modetest: add mediatek to module list
There is a mediatek drm kms driver: Add "mediatek" to the static
lists of driver names.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: JB Tsai <jb.tsai@mediatek.com>
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2016-09-01 16:02:19 +01:00
satsahu 3106a33fea modetest: Adding amdgpu to module list
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-08-29 12:52:25 -04:00
Andreas Boll a5446775f2 automake: Don't include Android Makefiles in the release tarball
Currently only some Android Makefiles are included in the release tarball.
To be more consistent one could either add the remaining files or don't
ship Android Makefiles altogether.

According to Emil the Android folk doesn't use our release tarballs.
Thus it makes sense to remove those files from distribution which also
means less work for maintenance in the future.

Suggested-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Andreas Boll <andreas.boll.dev@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-07-23 09:45:53 +02:00
Emil Velikov 681fd2ab6d tests/drmdevice: be move verbose when using open()
Print out the node we're attempting to open and a message if/why we fail
to do so.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-07-20 23:44:40 +01:00
Emil Velikov dd58044530 tests/drmdevice: print out the full 'bus' and 'dev' strings
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-07-20 23:44:40 +01:00
Rob Herring d342cd34ac Android: strip out header files from sources list
AOSP master now errors if LOCAL_SRC_FILES contains headers, so filter
out header files from the source lists.

Signed-off-by: Rob Herring <robh@kernel.org>
2016-07-06 16:58:38 +01:00
Christian König 361d0a8898 amdgpu: fix fence status query
Not initializing the ip instance leads to sporadic fails in the tests.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2016-06-02 16:05:51 +02:00
Sonny Jiang 7aab852d4e tests/amdgpu: adapt to new polaris10/11 uvd fw
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Sonny Jiang <sonny.jiang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-05-13 15:10:28 -04:00
Leo Liu 4e7ec72a1b tests/amdgpu: add interface to adapt firmware requirement
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-05-13 15:10:21 -04:00
Alex Deucher 3f5b31939c tests/amdgpu: expand write/copy tests to compute
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-05-13 15:10:16 -04:00
Alex Deucher b7a51965e1 tests/amdgpu: expand write/copy tests to compute
Uses same packets as gfx.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-05-13 15:10:01 -04:00
Daniel Vetter 1e5c590a24 tests/kms-steal-crtc: Use correct includes
It was relying on drm_fourcc.h providing <stdint.h>, which is silly.
Fix it.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2016-04-12 13:15:49 +02:00
Eric Engestrom 96f2907c85 tests: Fix spelling mistakes
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-04-07 18:15:59 +01:00
Emil Velikov ea78c17854 proptest: print signed values correctly
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-03-28 22:15:03 +01:00
Gustavo Padovan dfd8cd4611 modetest: print signed values correctly
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-03-28 22:13:29 +01:00
Gustavo Padovan 2e6f8f1dd5 tests: add virtio_gpu to the driver list
modetest was failing to work with driver because it wasn't in the
module list.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-03-28 22:12:33 +01:00
Sonny Jiang 99ede3e687 amdgpu/tests: fix tests for asics with one VCE instance
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Sonny Jiang <sonny.jiang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-02-18 16:50:43 -05:00
Alex Deucher 6950af4e84 tests/amdgpu: add a test for cp dma copy
Use the CP to copy data between buffers

Reviewed-by: Ken Wang <Qingqing.Wang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-02-04 12:24:15 -05:00
Alex Deucher 35c35ea66d tests/amdgpu: make amdgpu_command_submission_sdma_copy_linear generic
So it can be shared for CP tests.

Reviewed-by: Ken Wang <Qingqing.Wang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-02-04 12:24:15 -05:00
Alex Deucher 0edc442560 tests/amdgpu: add a test for cp dma fill
Use the CP to fill to memory.

Reviewed-by: Ken Wang <Qingqing.Wang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-02-04 12:24:15 -05:00
Alex Deucher 7c656ba72f tests/amdgpu: make amdgpu_command_submission_sdma_const_fill generic
So it can be shared for CP tests.

Reviewed-by: Ken Wang <Qingqing.Wang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-02-04 12:24:15 -05:00
Alex Deucher 47c7e7a6dd tests/amdgpu: add a test for cp write data
Use the CP to write data to memory.

Reviewed-by: Ken Wang <Qingqing.Wang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-02-04 12:24:15 -05:00
Alex Deucher c5da5eade0 tests/amdgpu: make amdgpu_command_submission_sdma_write_linear generic
So it can be shared for CP tests.

Reviewed-by: Ken Wang <Qingqing.Wang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-02-04 12:23:43 -05:00
Alex Deucher 8be79be043 tests/amdgpu: make amdgpu_sdma_test_exec_cs() generic (v2)
Share with upcoming CP tests.

v2: drop unnecessary forward declaration

Reviewed-by: Ken Wang <Qingqing.Wang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2016-02-04 12:22:20 -05:00
Eric Anholt 0ad32e7ff4 util: Add support for vc4.
This lets allows using modetest for overlay plane testing.

Signed-off-by: Eric Anholt <eric@anholt.net>
2016-02-03 11:29:52 -08:00
Emil Velikov 432e08de88 tests/kmstest: inverse the order of LDADD libraries
The utils library depends on libdrm. Flip the order, orderwise we might
error during link stage like below:

  CC       main.o
  CCLD     kmstest
/usr/bin/ld: ../../tests/util/.libs/libutil.a(libutil_la-kms.o):
undefined reference to symbol 'drmOpen'

Reported-by: Tom Stellard <thomas.stellard@amd.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-01-27 23:12:09 +00:00
Kylie McClain ff0c9caa8e tests: Include poll.h rather than sys/poll.h
sys/poll.h is a non-standard location of the poll.h header, and is
incorrect on non-glibc libcs. poll.h, however, is defined in SUS (v2)
and is more portable.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93764
http://pubs.opengroup.org/onlinepubs/007908799/xsh/poll.h.html
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-01-26 21:50:17 +00:00
Khem Raj 358615f416 tests: Include sys/select.h
Used in compliance with POSIX 2001/2008

Fixes errors e.g.
error: implicit declaration of function 'select'

and helps with missing definitions of FD_* defines

v2: conditionally include sys/select.h, include in every test where
needed.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Reviewed-by: Thierry Reding <thierry.reding@gmail.com> (v1)
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-01-26 21:50:17 +00:00
Thierry Reding 1674147a14 tests: util: Fixup util_open() parameter order
util_open() takes a device parameter, followed by a module parameter.
The existing tests used the drmOpen() function, which uses a different
ordering of the parameters, and the old ordering was accidentally kept
during the conversion.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-01-26 21:50:17 +00:00
Stefan Agner 2ad5ea780b tests: add fsl-dcu-drm to modules
Signed-off-by: Stefan Agner <stefan@agner.ch>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-01-26 21:50:17 +00:00
Stefan Agner 0caf58a6cb kmstest: Use util_open()
Use the new util_open() helper instead of open-coding the method for
finding a usable device. While at it, make the command-line interface
more consistent with that of modetest by adding the -D and -M options.

Signed-off-by: Stefan Agner <stefan@agner.ch>
v2: correctly use util_open() - swap device, module
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-01-26 21:45:46 +00:00
Chunming Zhou d4d4184363 tests/amdgpu: add semaphore test
Signed-off-by: Chunming Zhou <david1.zhou@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2016-01-20 02:14:46 +01:00
Stefan Agner 0cfb6a3986 tests: remove missleading comments
The comment has been copied from modetest and is not applicable
for vbltest.

Signed-off-by: Stefan Agner <stefan@agner.ch>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2015-12-18 17:44:27 +00:00
Thierry Reding b020b02f84 vbltest: Use util_open()
Use the new util_open() helper instead of open-coding the method for
finding a usable device. While at it, this adds -D and -M command-line
options to vbltest to make its usage more consistent with its siblings
modetest and proptest.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-12-18 17:44:22 +00:00
Thierry Reding 6223481b8d proptest: Use util_open()
Use the new util_open() helper instead of open-coding the method for
finding a usable device. While at it, make the command-line interface
more consistent with that of modetest by adding the -D and -M options.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-12-18 17:44:18 +00:00
Thierry Reding c26266fcd0 modetest: Use util_open()
Use the new util_open() helper instead of open-coding the method for
finding a usable device.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-12-18 17:44:16 +00:00
Thierry Reding e744b02375 tests: Add helper to open a device/module
The new function util_open() encapsulates the standard method employed
by tests to open a device or module. There is a verbatim copy of this in
almost all test programs, with slight variations in the list of modules.
Moving this code into a common helper allows code reuse and makes tests
more consistent.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-12-18 17:44:13 +00:00
Thierry Reding 89cca28dfb tests: kms: Implement universal planes test
This small program allows universal planes to be tested. Currently this
isn't very flexible because it allows only the first plane of a given
type to be tested on the first CRTC. However it should be simple to
extend this with some additional command-line arguments.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-12-18 17:44:10 +00:00
Thierry Reding e0ec59efb1 tests: kms: Implement CRTC stealing test
This test program sets a mode and framebuffer on a connector and cycles
through all CRTCs, moving the connector to each of them in turn. This is
useful to verify that CRTC stealing is properly handled in the DRM core
and drivers.

Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-12-18 17:44:08 +00:00
Thierry Reding c13c504ed2 tests: Add libkms-test library
This library contains abstractions for KMS that help remove the need for
a lot of boilerplate in KMS test programs.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-12-18 17:44:05 +00:00
Thierry Reding ca6c5f8c81 proptest: Add Android support
Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-12-18 17:44:03 +00:00
Thierry Reding 4664d657ea tests: Move name tables to libutil
These tables are duplicated in several places, so move them into libutil
so that they can be shared.

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-12-18 17:44:01 +00:00
Thierry Reding 1ec3c44bdd tests: Split helpers into library
Some of the helpers, such as the pattern drawing helpers or the format
lookup helpers, have potential to be reused. Move them into a separate
library to make it easier to share them.

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-12-18 17:43:40 +00:00
Tobias Jakobi 6689e4ee14 tests/exynos: add test for g2d_move
To check if g2d_move() works properly we create a small checkerboard
pattern in the center of the screen and then shift this pattern
around with g2d_move(). The pattern should be properly preserved
by the operation (but not the surrounding area).

Tested-by: Hyungwon Hwang <human.hwang@samsung.com>
Reviewed-by: Hyungwon Hwang <human.hwang@samsung.com>
Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
[Emil Velikov: add g2d_move to the symbol check]
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-12-18 17:42:54 +00:00
Tobias Jakobi 1b32e5da44 tests/exynos: use XRGB8888 for framebuffer
This matches the G2D color mode that is used in the entire code.
The previous (incorrect) RGBA8888 would only work since the
Exynos mixer did its configuration based on the bpp, and not
based on the actual pixelformat.

Reviewed-by: Hyungwon Hwang <human.hwang@samsung.com>
Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
2015-12-18 17:42:54 +00:00
Tobias Jakobi 58a39f6ba1 tests/exynos: add fimg2d event test
This tests async processing of G2D jobs. A separate thread is spawned
to monitor the DRM fd for events and check whether a G2D job was
completed.

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
2015-12-18 17:42:54 +00:00
Tobias Jakobi 2e4b9f08c7 tests/exynos: add fimg2d performance analysis
Currently only fast solid color clear performance is measured.
A large buffer is allocated and solid color clear operations
are executed on it with randomly chosen properties (position
and size of the region, clear color). Execution time is
measured and output together with the amount of pixels
processed.

The 'simple' variant only executes one G2D command buffer at
a time, while the 'multi' variant executes multiple ones. This
can be used to measure setup/exec overhead.

The test also serves a stability check. If clocks/voltages are
too high or low respectively, the test quickly reveals this.

Tested-by: Hyungwon Hwang <human.hwang@samsung.com>
Reviewed-by: Hyungwon Hwang <human.hwang@samsung.com>
Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
2015-12-18 17:42:54 +00:00
Emil Velikov 8990ed3199 tests/drmdevice: add drm{Get,Free}Device() example
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
2015-09-21 17:43:11 +01:00
Emil Velikov f098d1c130 tests/drmdevice: add new 'test'
A simple example of how to use/what is the new drm{Get,Free}Devices()
interface.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
2015-09-21 17:42:37 +01:00
Alan Coopersmith 94ecdcb8b1 Include <alloca.h> when needed before calling alloca
Fixes "error: implicit declaration of function 'alloca'" failures
when building on Solaris

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2015-09-12 09:41:24 -07:00
Michel Dänzer a814152187 tests: Add -lm to LDADD for dristat
Fixes build failure due to unresolved log2.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-09-09 16:03:03 +01:00
Emil Velikov ae2cf4507c tests/amdgpu: ensure tests work by using c99 initializers
In the latest version of CUnit the fourth parameter of the CU_SuiteInfo
struct is pSetUpFunc rather than *pTests.

Seems like the CUnit ABI broke at some point, so let's the the robust
thing and use c99 designated initializers to correctly populate the
struct(s).

Cc: Leo Liu <leo.liu@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-09-04 21:39:06 +01:00
Emil Velikov f756877736 tests/amdgpu: annotate (most of) the vce templates as const data
The remaining two templates are modified on the fly, depending on the
type of test to be performed.

Cc: Leo Liu <leo.liu@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-09-04 21:39:06 +01:00
Emil Velikov 05185fa054 tests/amdgpu: annotate the uvd message templates as const data
Cc: Leo Liu <leo.liu@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-09-04 21:39:06 +01:00
Emil Velikov 150ebe49ac tests/amdgpu: reference the correct variable for memcpy
Cc: Leo Liu <leo.liu@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-09-04 21:39:06 +01:00
Emil Velikov 04e243262d modetest: annotate const data as such for good measure
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-09-04 21:39:06 +01:00
Emil Velikov 99722bfec6 modetest: fix shadowing warnings
No real issue here, but let's fix these so that real issues don't get
lost in the spam.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-09-04 21:36:42 +01:00
Emil Velikov 687cc66d46 vbltest: fix variable shadowing warning
Just remove the second (shadowing) declaration of ret.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-09-04 21:36:42 +01:00
Hyungwon Hwang 6e84ada4cc modetest: remove the trailing white spaces
This patch removes the trailing white spaces.

Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
2015-08-20 17:11:15 +01:00
Michel Dänzer 2a34176123 tests/amdgpu: Remove unused local variable 'i'
Reviewed-by: Christian König <christian.koenig@amd.com>
2015-08-17 18:54:33 +09:00
Michel Dänzer 25784d3af2 tests/amdgpu: Include config.h first
Fixes build failure on 32-bit because _FILE_OFFSET_BITS wasn't defined to
64.

Reviewed-by: Christian König <christian.koenig@amd.com>
2015-08-17 18:41:11 +09:00
Thierry Reding f05a74fb9c tests: modetest: Accept connector names in addition to connector IDs
Allow connector names to be used in the specification of the -s option.
This requires storing the string passed on the command-line so that it
can later be resolved to a connector ID (after the DRM device has been
opened).

Connector names are constructed from the connector type name and
connector type ID using the same format as used internally in the
Linux kernel.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2015-08-15 03:06:57 +03:00
Tapani Pälli d7f58da11a modeprint: cleanup, remove compile warnings
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-08-10 11:28:33 +03:00
Michel Dänzer d9b282593e amdgpu/tests: Cast CPU map argument of amdgpu_bo_alloc_and_map to void**
Silences incompatible pointer type compiler warnings.

Reviewed-by: Christian König <christian.koenig@amd.com>
2015-08-05 13:47:52 -04:00
Michel Dänzer 84d099072f amdgpu/tests: Use buf_handle in amdgpu_bo_alloc_and_map() error paths
The compiler pointed out that bo has the wrong type.

Reviewed-by: Christian König <christian.koenig@amd.com>
2015-08-05 13:47:52 -04:00
Ken Wang 9961900b8d test/amdgpu : fix a bug in VCE/UVD test introduced by previous change
Signed-off-by: Ken Wang <Qingqing.Wang@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
2015-08-05 13:47:52 -04:00
Jammy Zhou 8aeffcc1cf amdgpu: add amdgpu_bo_va_op for va map/unmap support v3
The following interfaces are changed accordingly:
- amdgpu_bo_alloc
- amdgpu_create_bo_from_user_mem

v2: update the interfaces
v3: remove virtual_mc_base_address from amdgpu_bo

Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2015-08-05 13:47:52 -04:00
Ken Wang 926c805686 amdgpu : move management of user fence from libdrm to UMD
Signed-off-by: Ken Wang <Qingqing.Wang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
2015-08-05 13:47:52 -04:00
Christian König 01e4546ff3 amdgpu: fix bs buffer size for vce test
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
2015-08-05 13:47:52 -04:00
Jammy Zhou 872a5c714a tests/amdgpu: remove the duplicate IB allocation for VCE test
Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2015-08-05 13:47:52 -04:00
Christian König 5463d2e83a amdgpu: use common fence structure for dependencies as well.
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
2015-08-05 13:47:52 -04:00
Jammy Zhou f91b56dc8c amdgpu: improve the amdgpu_cs_query_fence_status interface
make amdgpu_cs_query_fence reusable to support multi-fence query

Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2015-08-05 13:47:52 -04:00
Marek Olšák 76af5c249f amdgpu: remove bo_handle from amdgpu_cs_ib_info, IBs should be in buffer list
Reviewed-by: Christian König <christian.koenig@amd.com>
2015-08-05 13:47:51 -04:00
Marek Olšák 646f5411cf amdgpu: remove amdgpu_ib helpers
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2015-08-05 13:47:50 -04:00
Marek Olšák 194d5c2ee4 amdgpu: remove amdgpu_ib
Not useful if we're gonna use BO handles directly.

Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2015-08-05 13:47:50 -04:00
Jammy Zhou 1041cfdc38 tests/amdgpu: manage IB in client side
Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2015-08-05 13:47:50 -04:00
Leo Liu 0f4e6702ee tests/amdgpu: implement VCE unit tests
Signed-off-by: Leo Liu <leo.liu@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2015-08-05 13:47:50 -04:00
Jammy Zhou ba1653eff8 tests/amdgpu: add shared IB submission test v2
v2: some function renaming

Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-08-05 13:47:50 -04:00
Jammy Zhou db126d1d8a amdgpu: reuse the kernel IB flags v2
v2: remove 'CE' from the preamble flag

Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2015-08-05 13:47:49 -04:00
Jammy Zhou a4c8321179 amdgpu: remove AMDGPU_GEM_CREATE_CPU_GTT_UC
Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-08-05 13:47:49 -04:00
Christian König 6dc2eaf2cc amdgpu: add public bo list interface v3
v2: cleanup comments and function parameter
v3: rebased on internal branch

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-08-05 13:47:49 -04:00
Christian König 9c2afffedb amdgpu: cleanup public interface v2
Remove the mostly unused device parameter, for the few cases
where we really need it keep a copy in the context structure.

v2: rebased on internal branch

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-08-05 13:47:49 -04:00
Alex Deucher 3c5fe78801 drm: add tests/amdgpu (v3)
This adds some basic unit tests for the new amdgpu driver.

v2: use common util_math.h
v3: implement suggestions from Emil
    replace malloc/memset with calloc
    make header guards all caps
    use posix_memalign rather than mem_align
    replace malloc with calloc for pm4 allocations
    make CU_SuiteInfo static
    fix Makefile.am
    fix fd numbering
    use drmGetVersion/drmFreeVersion rather than open coding it
    close fd, clean up CU registry on error

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-08-05 13:47:48 -04:00
Alex Deucher 4ee0fa2f37 drm: consolidate common list implementations (v2)
This is used by radeon and freedreno and will be used
by amdgpu.  I looked at switching to libdrm_lists.h,
but it's pretty horrible.  E.g., DRMLISTFOREACHENTRYSAFE.

v2: remove missed list.h from tests/radeon/Makefile.am

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-08-05 13:47:48 -04:00
Joonyoung Shim 293f8fac0a Build vbltest irrespective of the presence of libudev.
The vbltest doesn't have any dependency of LIBUDEV.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-07-20 22:13:55 +01:00
Emil Velikov c08655271a Consistently check the fd value
Follow the approach used through the rest of the project.

Suggested-by: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Thierry Reding <treding@nvidia.com>
2015-07-16 16:41:53 +01:00
Tobias Jakobi 2bf0d5bf63 tests/exynos: handle G2D_IMGBUF_COLOR in switch statements
This fixes a compiler warning about missing handling of enum
values in the switch statements.

Also remove the silent mapping to G2D_IMGBUF_GEM when an
unknown buffer type is encountered. We have full control
about the type here, and if it's unknown then we obviously
have a bug in the code.

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-06-29 19:19:23 +01:00
Tobias Jakobi b26c8efb65 tests/exynos: remove connector_find_plane
No test uses DRM planes at the moment so this function
is never called. Inspection of the git history shows
that DRM planes were also never used in these tests
in the past.

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-06-29 19:19:23 +01:00
Tobias Jakobi 13ad10afc3 tests/exynos: simplify drm_set_crtc
We can just return 'ret' here, the goto serves no purpose.

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-06-29 19:19:23 +01:00
Tobias Jakobi 28d896c763 tests/exynos: remove struct fimg2d_test_case
It doesn't make sense to keep this structure, since we
can just call all tests directly. An inspection of the
git history shows that no code ever used this
abstraction in the past.

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-06-29 19:19:23 +01:00
Tobias Jakobi 3aeea6198d tests/exynos: remove unused define
It doesn't make sense to limit the number of
test cases anyway.

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-06-29 19:19:23 +01:00
Tobias Jakobi 0536d33f07 tests/exynos: clean struct connector
Remove all unused struct members. An inspection of the
git history shows that these members were also never
used in the past.

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-06-29 19:19:23 +01:00
Tobias Jakobi 8d8bbbb972 tests/exynos: replace return by break
The 'usage' function already does exit(0), so that this
'return -EINVAL' is never called. Just put a break there
to avoid confusion.

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-06-29 19:19:23 +01:00
Boris BREZILLON 97be70b45e tests/kmstest: support atmel-hlcdc
Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com>
2015-05-28 16:04:16 +01:00
Boris BREZILLON e6a1064929 modetest: add atmel-hlcdc driver support
Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com>
2015-05-28 16:03:57 +01:00
Tobias Jakobi 360a7eacd4 modetest: only select plane with matching format
Don't assume that a plane supports any kind of pixelformat
but do a check first.

v2: Simplify the format check.
Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-05-28 16:02:28 +01:00
Tobias Jakobi 85ede61136 modetest: make middle SMPTE colors transparent
This enables us to check for overlay planes which are located
'below' the primary plane.

Since the alpha value only has an effect when creating surfaces
with an alpha-pixelformat this doesn't affect the regular
XRGB8888 primary surface.

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-05-28 16:01:33 +01:00
Emil Velikov 128344c2cf modetest: replace malloc + memset with calloc
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-05-28 15:40:16 +01:00
Emil Velikov c78917ee4f modetest: explicitly zero the newly allocated memory
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-05-28 15:40:13 +01:00
Rob Clark b4defea65f modetest: fix allocation for yuv420/yvu420
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2015-05-05 11:16:23 -04:00
Joonyoung Shim b091ecdbf9 modetest: fix the arguments of the MAKE_RGB_INFO define
The current order (rbg) seems wrong.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
[Emil Velikov: Tweak the commit message.]
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-29 17:28:32 +00:00
Joonyoung Shim 9915e68b3b modetest: destroy the cursor bo
Currently we are missing the bo_destroy() when modetest terminates.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
[Emil Velikov: Tweak the commit message.]
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-28 13:06:37 +01:00
Joonyoung Shim 4d760d7f46 modetest: clear buffer and framebuffer for planes
Currently we don't destroy buffer and remove framebuffer for
planes when closing modetest.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
[Emil Velikov: Tweak the commit message. fb_id = 0 is unused]
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-28 13:06:28 +01:00
Joonyoung Shim 21170a8c63 modetest: fix the error path handling
Remove the framebuffer and destroy the bo when error occurs on set_mode
and test_page_flip.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
[Emil Velikov: Tweak the commit message.]
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-28 13:04:49 +01:00
Joonyoung Shim bcaaa75cf4 modetest: make use of drmModeRmFB
We should remove the framebuffer before destroying the buffer.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
[Emil Velikov: Tweak the commit message. fb_id = 0 is unused]
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-28 13:04:15 +01:00
Joonyoung Shim 4e4d79d4ca modetest: fix Segmentation fault
If use -P option without -s option, the program segfaults due to
dev.mode.bo being NULL.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
[Emil Velikov: Tweak the commit message.]
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-28 11:27:18 +01:00
Tobias Jakobi b1d19de764 modetest: initialize handles/pitches in set_plane()
Only the 'offsets' array was initialized to zero.
Since bo_create only sets the handles which are
necessary, were we passing garbage data to the
kernel when calling drmModeAddFB2 later.

The issue only seems to appear when passing e.g.
NV12 data to the kernel, a case where not only
handles[0] is used. I therefore also removed the
corresponding comment.

v2: Do the same for set_mode(), set_cursors()
    and test_page_flip().

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-28 11:23:14 +01:00
Greg Hackmann 0c8db0a563 Add missing <strings.h> includes
A couple of files use ffs() without explicitly including strings.h.
Some systems will pull in ffs()'s declaration through another header
anyway, but not when compiling against bionic in AOSP master.

Signed-off-by: Greg Hackmann <ghackmann@google.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-28 11:22:31 +01:00
Emil Velikov 41eb131dfe drm: use c99 __func__ over __FUNCTION__
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-28 11:21:02 +01:00
Emil Velikov 42465feb97 drm: rename libdrm{,_macros}.h
Provide a more meaningful name, considering what it does.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-28 11:19:15 +01:00
Rob Clark 0d78b37b1c modeprint: add missing encoder/connector type names
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2015-04-15 09:35:00 -04:00
Chris Wilson 5ed5fa1060 mode: Retrieve only the current information for a Connector
Add a new API that allows the caller to skip any forced probing, which
may require slow i2c to a remote display, and only report the currently
active mode and encoder for a Connector. This is often the information
of interest and is much, much faster than re-retrieving the link status
and EDIDs, e.g. if the caller only wishes to count the number of active
outputs.

v2: Fix error path to avoid double free after a failed GETCONNECTOR
ioctl.

v3: Daniel strongly disapproved of my disjoint in behaviour between
GetConnector and GetConnectorCurrent, and considering how best to make a
drop in replacement for drmmode_output_init() convinced me keeping the
API as consistent as possible was the right approach.

v4: Avoid probing on the second calls to GETCONNECTOR for unconnected
outputs.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.com>
Cc: Damien Lespiau <damien.lespiau@intel.com>
Cc: David Herrmann <dh.herrmann@googlemail.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-04-14 15:58:26 +01:00
Chih-Wei Huang 6f90b77ea9 android: remove unnecessary TARGET_OUT_HEADERS variable
Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-09 16:26:59 +01:00
Emil Velikov 1ed5faab24 tests/random: return non-zero on test failure
... and wire it up to make check

v2: s/rand - state->check/rand != state->check/. (Jan)

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
2015-04-05 15:33:33 +01:00
Emil Velikov f1f4cabd8e tests/random: extract test out of xf86drmRandom.c
With follow up commits we can clear it up and wire to
make check

v2:
 - Use xf86drmRandom.h for common struct.(Jan)
 - Add test to .gitignore.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
2015-04-05 15:33:33 +01:00
Emil Velikov 7e4f0664ac tests/hash: return non-zero on failure
... and wire up to `make check' now that it's useful.

v2: Really return non-zero on failure.
v3: Initialise ret.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu> (v2)
2015-04-05 15:33:06 +01:00
Emil Velikov 4fcb6637f0 tests/hash: style fixes
v2: Rebase on earlier changes. Keep count initialisation as is.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
2015-04-05 15:19:50 +01:00
Emil Velikov c53da3ac57 tests/hash: misc compilation fixes
Get the test from completely broken to working like a charm.

 - Use the same variable type for both HashInsert and HashLookup.
 - Use correct storage type for the HashLookup return value.
 - Remove useless backward iteration of HashLookup(i).

v2:
 - Use void * instead of unsigned long.
 - Change value to key << 16 | key.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
2015-04-05 15:19:47 +01:00
Emil Velikov 79f9cf3eb7 tests/hash: extract test out of xf86drmHash.c
This way with follow up commits we can fix it and wire it up to
make check

v2:
 - Use xf86drmHash.h for common structs.(Jan)
 - Add test to .gitignore.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
2015-04-05 15:19:42 +01:00
Jan Vesely 7d8c946408 tests/drmsl: Extract tests out of xf86drmSL.c
v2: merge tests creation and xf86drmSL cleanup
    rename tests/drmsltest -> tests/drmsl
    move the test out of libudev test block
v3: run test even on noudev builds

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-04 13:48:54 -04:00
Jan Vesely 8dff7a0478 tests/exynos: Fix missing static keyword
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
2015-03-20 18:17:34 -04:00
Jan Vesely 6fc0e4ba1e Fix unused function warnings
v2: Remove the handler function instead of commenting out
    split debugmsg function removal to a separate patch

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-03-20 13:36:53 -04:00
Daniel Kurtz 9588e66dbd tests: add rockchip to modetest, kmstest, vbltest and proptest
There is a rockchip drm kms driver.
Add "rockchip" to the static lists of driver names in the the standard
set of tests.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
[Emil Velikov: Resolve trivial conflicts.]
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-03-20 17:18:01 +00:00
Daniel Kurtz 292b5100e5 proptest: install it with --enable-install-test-programs
--enable-install-test-programs allows tests to be installed in $bindir.
This is disabled by default, but very useful when cross compiling.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-03-20 17:18:01 +00:00
Chih-Wei Huang a3b3c1afb7 android: simplify the including rule of subdirs
Use android build system functions to include Android.mk
of subdirs.

Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
[Emil Velikov: Resolve trivial conflicts.]
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-03-20 17:07:21 +00:00
Tobias Jakobi 9a0949a8f4 exynos: add exynos prefix to fimg2d header
Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Reviewed-by: Inki Dae <inki.dae@samsung.com>
Tested-by: Joonyoung Shim <jy0922.shim@samsung.com>
2015-03-16 22:21:40 +00:00
Tobias Jakobi 736d6a1f0f exynos: use structure initialization instead of memset
Keeps the code cleaner, since the structs have to be initialized
once anyway.

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Reviewed-by: Inki Dae <inki.dae@samsung.com>
Tested-by: Joonyoung Shim <jy0922.shim@samsung.com>
[evelikov: squash trivial conflict]
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>

Conflicts:
	tests/exynos/exynos_fimg2d_test.c
2015-03-16 22:21:03 +00:00
Tobias Jakobi 6f950de953 tests/exynos: fimg2d: add a checkerboard test
This makes it easier to spot memory corruptions which don't become
visible when using a plain buffer filled with a solid color (so
corruptions that are just a permutation of the bytes in the buffer).

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Reviewed-by: Inki Dae <inki.dae@samsung.com>
Tested-by: Joonyoung Shim <jy0922.shim@samsung.com>
2015-03-16 22:18:05 +00:00
Emil Velikov 763ff19a2f modetest: include into the build when libkms is not selected.
With commit d7c0a08bc57(modetest: Allocate dumb buffers with the correct
bpp) we moved away from the libkms dependency. As such we are safe with
including the Makefile/subdir, even as we opt out of building the
library.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2015-03-16 22:18:04 +00:00
Jan Vesely d729d75f84 Add static qualifier to local functions
v2: Don't bother marking dead functions static
    (handler, xf86VDrvMsgVerb, drmSetDebugMsgFunction)

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-03-15 14:17:02 -04:00
Jan Vesely 0706c14e7c Fix unused, and unused-but-set variables warnings
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Emil Velikov <eil.l.velikov@gmail.com>
2015-03-14 17:02:06 -04:00
Jan Vesely 13e34308b7 dristat: Handle DRM_CONSISTENT
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Emil Velikov <eil.l.velikov@gmail.com>
2015-03-14 17:02:06 -04:00
Jan Vesely 65041c4a19 Fix type-limits, pointer-arith and sign-compare warnings
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Emil Velikov <eil.l.velikov@gmail.com>
2015-03-14 17:02:06 -04:00
Jan Vesely f11b8c955c tests: String literals are const char *
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Emil Velikov <eil.l.velikov@gmail.com>
2015-03-14 17:02:05 -04:00
Maarten Lankhorst 5ea6f1c326 nouveau: make nouveau importing global buffers completely thread-safe, with tests
While I've closed off most races in a previous patch, a small race still existed
where importing then unreffing cound cause an invalid bo. Add a test for this case.

Racing sequence fixed:

- thread 1 releases bo, refcount drops to zero, blocks on acquiring nvdev->lock.
- thread 2 increases refcount to 1.
- thread 2 decreases refcount to zero, blocks on acquiring nvdev->lock.

At this point the 2 threads will clean up the same bo.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@ubuntu.com>
Reviewed-By: Emil Velikov <emil.l.velikov@gmail.com>
2015-03-13 20:26:33 +01:00
Tobias Jakobi 734d13b13b tests/exynos: improve error handling
Check for a useable connector and also if the resolution is sane
(width and height are both non-zero).

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Joonyoung Shim <jy0922.shim@samsung.com>
2015-03-10 19:21:52 +00:00
Tobias Jakobi 6e2a9f936e tests/exynos: introduce wait_for_user_input
Currently getchar() is used to pause execution after each test.
The user isn't informed if one is supposed to do anything for
the tests to continue, so print a simple message to make this
more clear.

v3: Compactify printf calls as pointed out by
    Emil Velikov <emil.l.velikov@gmail.com>.

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Joonyoung Shim <jy0922.shim@samsung.com>
2015-03-10 19:21:33 +00:00
Tobias Jakobi a7c865dc0a tests/exynos: disable the G2D userptr/blend test
v2: Move the commit description into the patch itself.
v3: Use common commenting style as pointed out by
    Emil Velikov <emil.l.velikov@gmail.com>.

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Joonyoung Shim <jy0922.shim@samsung.com>
2015-03-10 19:21:21 +00:00
Tobias Jakobi c8168fe5b8 tests/exynos: fix typos and change wording
No functional changes.

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Joonyoung Shim <jy0922.shim@samsung.com>
2015-03-10 19:21:18 +00:00
Emil Velikov b374a59e0e tests: automake: keep the libs link at the final stage
Currently the static archive libdrmtest.la links against libdrm.la.
Only to have both added to the executables' LDADD. Simplify things a
bit, by doing the link in the final module (the executables/tests in
this case).

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-03-10 18:11:35 +00:00
Emil Velikov f5b7a1d2da tests: move the SUBDIR at the top of the makefile
None of the subdirs require the modules built in the local makefile, so
moving them at the top makes things a hell lot easier to read.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-03-10 18:11:35 +00:00
Emil Velikov 58e5010a09 automake: drop the NULL variable from the makefile
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-03-10 18:11:35 +00:00
Emil Velikov f799a527db tests/radeon: set the list* functions as inline
To silence the chatty compiler.
As a future work we may want to merge these with libdrm_lists.h

Cc: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
2015-02-27 15:51:36 +00:00
Emil Velikov 0b3e540aa4 exynos_fimg2d_test: remove unused variables
Cc: Inki Dae <inki.dae@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
2015-02-27 15:51:32 +00:00
Emil Velikov bb6cc7c972 tests: remove unused variables
As kindly pointed out by GCC.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
2015-02-27 15:51:28 +00:00
Emil Velikov 4c6b1b1a82 autotools: add WARN_CFLAGS to all targets
... minus test/ttmtest. The latter is not really hooked up with the
actual build.

This will give us 66 warnings on a distribution build of which
 - 12 -Wunused-variable
 - 11 -Wunused-function
 - 19 -Wmissing-prototypes
and a few -Wswitch-enum, -Wtype-limits etc.

Adding the CFLAGS gives some exposure to these so that we can fix them.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
2015-02-27 15:51:24 +00:00
Emil Velikov 794810d62d tests: fix implicit funciton declaration errors
ioctl() and strcmp() were used without the relevent header being
included.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
2015-02-27 15:51:15 +00:00
Emil Velikov 2b209fc409 exynos_fimg2d_test: fix implicit funciton declaration errors
As one adds WARN_CFLAGS to the build the compiler throws a couple of
lovely error messages. Add the relevant includes to fix them.

  error: implicit declaration of function ‘time’
  error: implicit declaration of function ‘getopt’

Cc: Inki Dae <inki.dae@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
2015-02-27 15:51:08 +00:00
Philipp Zabel 77703f61cb tests: add support for imx-drm
Since imx-drm has graduated from staging it seems to be a good idea to
recognize it by default in the libdrm tests.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-02-25 17:51:22 +01:00
Daniel Vetter 3a6c65c546 tests: remove intel-specific tests
These all moved to igt meanwhile.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-02-11 15:37:26 +01:00
Jan Vesely de8532dd83 Fix gcc -Wextra warnings
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-02-10 15:25:28 -05:00
Frank Binns ad8bbfd3c7 Rename DRM_NODE_RENDER to DRM_NODE_PRIMARY
Now that there are render nodes it doesn't seem appropriate for the type of
the card nodes to be DRM_NODE_RENDER. For this reason, rename this type to
DRM_NODE_PRIMARY as this name better represents the purpose of these nodes.

Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
2015-01-23 23:02:06 +00:00
Laurent Pinchart d7c0a08bc5 modetest: Allocate dumb buffers with the correct bpp
The modetest application uses libkms to allocate dumb buffers, leading
to overallocation due to the hardcoded 32 bpp value. This can even cause
failures in drivers when the resulting pitch is too large for the
hardware to handle and gets rejected by the driver when creating the
frame buffer.

Fix this by computing the required bpp value and allocating dumb buffers
directly without going through libkms.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2015-01-11 14:37:53 +02:00
Thierry Reding 93035cfbeb tegra: Add simple test for drm_tegra_open()
This test opens a device, dumps the version information and checks that
a Tegra DRM context can be opened on it.

Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-11-27 17:20:27 +01:00
Thierry Reding d6a4c2cbd1 libdrm: Add NVIDIA Tegra support
Add the libdrm_tegra helper library to encapsulate Tegra-specific
interfaces to the DRM.

Furthermore, Tegra is added to the list of supported chips in the
modetest and vbltest programs.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-11-27 17:05:35 +01:00
Rob Clark fb4177046d update signed/object prop types
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-11-24 19:56:50 -05:00
Ville Syrjälä c2c0346e1f modetest: Print newline for empty blobs
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-11-24 19:54:35 -05:00
Rob Clark b958d76f77 modetest: alpha buffers
Make upper-left corner for RGB32 buffers translucent, for testing
blending of AR24 vs XR24.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-11-24 19:53:41 -05:00
Paulo Zanoni 8f66c98818 tests: add proptest
A small program that allows us to see and modify properties.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-11-24 19:51:59 -05:00
Rob Clark 1fec623b02 modetest: universal plane support
Minimal support, so we can at least dump properties of primary/cursor
planes.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-11-24 13:43:10 -05:00
Jasper St. Pierre 29bb4c6911 modetest: Use threads for cursors instead of SIGALRM
This fixes an issue when trying to use -v and -C together. When trying
to read the page flip event, we are interrupted by the SIGALRM that
comes in, and so we think we timed out when we simply got EINTR. While
we could just loop checking for EINTR, SIGALRM is just bad idea to
begin with, so just rewrite it to use a thread.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-11-22 11:45:02 -05:00
Rob Clark 0599f2fd6a more compile fix
Signed-off-by: Rob Clark <robdclark@gmail.com>
2014-09-28 14:52:51 -04:00
Emil Velikov 268dce4192 automake: pick up all files for distribution.
Autotools is already smart enough to pick the *.pc.in files but it
needs some help with the Android.mk ones.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2014-09-28 17:09:34 +01:00
Benjamin Gaignard 33bad73b27 modetest: Add support of STI driver
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2014-09-28 17:09:34 +01:00
Emil Velikov 6f95526a81 modetest: add Android build
v2: include modetest rather than modeset.
Spotted by Mauro Rossi and Paulo Sergio.

Cc: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com> (v1)
2014-09-28 17:09:34 +01:00
Emil Velikov fea3831133 modetest: move sources lists to makefiles.sources
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2014-09-28 17:09:34 +01:00
Emil Velikov 8e93afc976 all: include config.h only when available and use its defines
... rather than explicitly redefining HAVE_STDINT_H and _GNU_SOURCE.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-01 16:06:01 +01:00
Maarten Lankhorst a328b02c1d exynos: do not build fimg2d_test when building without libkms support.
This prevents a build failure.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
2014-07-25 11:38:55 +02:00
Thomas Klausner c0b34dca26 radeon: Add missing header includes.
unistd.h for close() and xf86drm.h for drmOpen().

Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
2014-07-16 12:16:08 +09:00
Daniel Kurtz d1000c432c exynos_fimg2d_test: fix drmModeRmFB
The first parameter should be the drm fd, second param is the fb id.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Acked-by: Inki Dae <inki.dae@samsung.com>
2014-05-12 23:09:20 -04:00
Daniel Kurtz 382043ee48 exynos: remove unusable "run" target
This looks like it was copied from kmstest, but isn't needed, and doesn't
actually work since exynos_fimg2d_test requires parameters.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Acked-by: Inki Dae <inki.dae@samsung.com>
2014-05-12 23:09:19 -04:00
Daniel Kurtz 71bbf86f58 eyxnos: install exynos tests if HAVE_INSTALL_TESTS
This exynos test was added just before HAVE_INSTALL_TESTS, and so didn't
get this annotation.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Acked-by: Inki Dae <inki.dae@samsung.com>
2014-05-12 23:09:11 -04:00
Rob Clark 0e512794bf modetest: add cursor support
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-04-22 11:14:12 -04:00
Thierry Reding d4083dc762 tests: Use drmFreeVersion() instead of drmFree()
drmFreeVersion() frees the memory allocated for the name, date and desc
fields in addition to that for the struct _drmVersion.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-04-17 16:21:47 +02:00
Thierry Reding 44b08c0ddf Mark functions printf-like where possible
These functions all take a format string and either a list of variable
arguments or a va_list. Use the new DRM_PRINTFLIKE macro to tell the
compiler about it so that the arguments can be checked against the
format string.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-04-17 16:21:40 +02:00
Lucas Stach ce62b8e059 modeprint: pretty print connector names
Use same names as the kernel, makes it easier to identify
connectors in the common case.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
2014-01-24 17:51:05 -05:00
Vincent ABRIOU de09702030 modetest: add the possibility to select the refresh frequency for a mode
When mode is selected we only give the name of the mode as parameter.
But sometime, two different modes have the same name but not
the same vrefresh frequency.
This patch give the possibility to select a mode by its name
and optionally by its refresh frequency.

Signed-off-by: Vincent Abriou <vincent.abriou@st.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-01-12 08:24:00 -05:00
Hyungwon Hwang 3732ef59eb tests/kmstest: support exynos
In this patch, to support exynos for KMS, Exynos KMS driver is newly added.
Also, Exynos is added to the list of kmstest supported modules.

Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-01-12 08:23:38 -05:00
Ilia Mirkin d8954154fe modetest: allow setting a scaling factor when showing plane
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Rob Clark <robdclark@gmail.com>
2013-09-11 11:25:32 -04:00
Ilia Mirkin b50826dbd6 modetest: add a -D option to specify a device to be used
This is helpful for differentiating between multiple devices that use
the same module.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Rob Clark <robdclark@gmail.com>
2013-09-11 11:25:17 -04:00
Emil Velikov 4a8da02e52 tests/modetest: silence compiler warning about uninitialised variables
The compiler is unaware of that we have at least one crts/connector/plane
thus it complains that some of our variables will be used uninitialised.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
2013-08-30 11:37:05 -04:00
Emil Velikov 0100473de6 tests/*version: add missing string.h header
Prodives memset() and strlen(), used in tests/setversion
tests/getversion respectively.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
2013-08-30 11:36:20 -04:00
Rob Clark dba6bec3ab tests: add msm
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-08-30 11:36:20 -04:00
Laurent Pinchart 3c967e7155 modetest: Allocate NV buffers large enough for the two planes
Multiple the image height by 1.5 for NV12/NV21 and by 2 for NV16/NV61 to
make room for the chroma plane.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2013-08-05 14:21:45 +02:00
Laurent Pinchart 1ef179d09c modetest: Fix line stride in SMPTE YUV packet pattern generator
The line stride passed to the function is expressed in bytes, there's no
need to multiply it by 2.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2013-08-05 14:21:45 +02:00
Laurent Pinchart a4f2f1b9d1 modetest: Try all possible encoders for a connector
When building the pipeline, instead of using only the encoders attached
to a connector, take all possible encoders into account to locate a
CRTC.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2013-08-05 14:21:45 +02:00
Laurent Pinchart 2c5ee84d30 modetest: Support pipes with multiple connectors
The -s argument can now take a list of connectors. Configure all of them
in cloned mode using a single CRTC.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2013-08-05 14:21:45 +02:00
Laurent Pinchart b1e0bdeb70 modetest: Rename struct connector_arg to struct pipe_arg
This prepares the code for handling multiple connectors in a single
pipeline in a cloned configuration.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2013-08-05 14:21:45 +02:00
Laurent Pinchart 3813e0f8e1 modetest: Split mode setting and plane setup
There's not reason to require setting a mode to test planes. Split the
two operations.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2013-08-05 14:21:45 +02:00