summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/tests/drm_exec_test.c
AgeCommit message (Collapse)AuthorFilesLines
2023-12-10drm/exec: Pass in initial # of objectsRob Clark1-8/+8
In cases where the # is known ahead of time, it is silly to do the table resize dance. Signed-off-by: Rob Clark <robdclark@chromium.org> Reviewed-by: Christian König <christian.koenig@amd.com> Patchwork: https://patchwork.freedesktop.org/patch/568338/
2023-08-10drm/test: drm_exec: fix memory leak on object prepareDanilo Krummrich1-2/+5
drm_exec_prepare_obj() and drm_exec_prepare_array() both reserve dma-fence slots and hence a dma_resv_list without ever freeing it. Make sure to call drm_gem_private_object_fini() for each GEM object passed to drm_exec_prepare_obj()/drm_exec_prepare_array() throughout the test to fix this up. While at it, remove some trailing empty lines. Fixes: 9710631cc8f3 ("drm: add drm_exec selftests v4") Signed-off-by: Danilo Krummrich <dakr@redhat.com> Reviewed-by: Christian König <christian.koenig@amd.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230809225034.8803-1-dakr@redhat.com Signed-off-by: Christian König <christian.koenig@amd.com>
2023-08-10drm/exec: add test case for using a drm_exec multiple timesChristian König1-0/+21
Not really a common use case, but let's make sure that we don't accidentially break that somehow. CC: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230731123625.3766-2-christian.koenig@amd.com
2023-08-01drm/tests: Alloc drm_device on drm_exec testsArthur Grillo1-7/+37
The drm_exec tests where crashing[0] because of a null dereference. This is caused by a new access of the `driver` attribute of `struct drm_driver` on drm_gem_private_object_init(). Alloc the drm_device to fix that. [0] [15:05:24] ================== drm_exec (6 subtests) =================== [15:05:24] [PASSED] sanitycheck ^CERROR:root:Build interruption occurred. Cleaning console. [15:05:50] [ERROR] Test: drm_exec: missing expected subtest! [15:05:50] BUG: kernel NULL pointer dereference, address: 00000000000000b0 [15:05:50] #PF: supervisor read access in kernel mode [15:05:50] #PF: error_code(0x0000) - not-present page [15:05:50] PGD 0 P4D 0 [15:05:50] Oops: 0000 [#1] PREEMPT NOPTI [15:05:50] CPU: 0 PID: 23 Comm: kunit_try_catch Tainted: G N 6.4.0-rc7-02032-ge6303f323b1a #69 [15:05:50] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-1.fc37 04/01/2014 [15:05:50] RIP: 0010:drm_gem_private_object_init+0x60/0xc0 Fixes: e6303f323b1a ("drm: manager to keep track of GPUs VA mappings") Signed-off-by: Arthur Grillo <arthurgrillo@riseup.net> Tested-by: Danilo Krummrich <dakr@redhat.com> Acked-by: Danilo Krummrich <dakr@redhat.com> Reviewed-by: Maíra Canal <mcanal@igalia.com> Signed-off-by: Maxime Ripard <mripard@kernel.org> Link: https://patchwork.freedesktop.org/patch/msgid/20230731182241.240556-1-arthurgrillo@riseup.net
2023-07-12drm: add drm_exec selftests v4Christian König1-0/+159
Exercise at least all driver facing functions of this new component. v2: add array test as well v3: some kunit cleanups v4: more tests and cleanups Signed-off-by: Christian König <christian.koenig@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230711133122.3710-3-christian.koenig@amd.com