aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/selftests
AgeCommit message (Collapse)AuthorFilesLines
2022-07-11drm: selftest: convert drm_mm selftest to KUnitArthur Grillo5-2667/+0
Considering the current adoption of the KUnit framework, convert the DRM mm selftest to the KUnit API. Signed-off-by: Arthur Grillo <[email protected]> Tested-by: David Gow <[email protected]> Acked-by: Daniel Latypov <[email protected]> Reviewed-by: Javier Martinez Canillas <[email protected]> Signed-off-by: Maíra Canal <[email protected]> Signed-off-by: Javier Martinez Canillas <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2022-07-11drm: selftest: convert drm_buddy selftest to KUnitMaíra Canal3-1010/+1
Considering the current adoption of the KUnit framework, convert the DRM buddy selftest to the KUnit API. Tested-by: David Gow <[email protected]> Acked-by: Daniel Latypov <[email protected]> Reviewed-by: Javier Martinez Canillas <[email protected]> Signed-off-by: Maíra Canal <[email protected]> Signed-off-by: Javier Martinez Canillas <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2022-07-11drm: selftest: convert drm_framebuffer selftest to KUnitMaíra Canal5-416/+1
Considering the current adoption of the KUnit framework, convert the DRM framebuffer selftest to the KUnit API. Tested-by: David Gow <[email protected]> Acked-by: Daniel Latypov <[email protected]> Reviewed-by: Javier Martinez Canillas <[email protected]> Signed-off-by: Maíra Canal <[email protected]> Signed-off-by: Javier Martinez Canillas <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2022-07-11drm: selftest: convert drm_dp_mst_helper selftest to KUnitMaíra Canal4-281/+1
Considering the current adoption of the KUnit framework, convert the DRM DP MST helper selftest to the KUnit API. Co-developed-by: Rubens Gomes Neto <[email protected]> Signed-off-by: Rubens Gomes Neto <[email protected]> Tested-by: David Gow <[email protected]> Acked-by: Daniel Latypov <[email protected]> Reviewed-by: Javier Martinez Canillas <[email protected]> Signed-off-by: Maíra Canal <[email protected]> Signed-off-by: Javier Martinez Canillas <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2022-07-11drm: selftest: convert drm_plane_helper selftest to KUnitMaíra Canal4-228/+2
Considering the current adoption of the KUnit framework, convert the DRM plane helper selftest to the KUnit API. Co-developed-by: Djakson C. G. Filho <[email protected]> Signed-off-by: Djakson C. G. Filho <[email protected]> Co-developed-by: Anderson Fraga <[email protected]> Signed-off-by: Anderson Fraga <[email protected]> Tested-by: David Gow <[email protected]> Acked-by: Daniel Latypov <[email protected]> Reviewed-by: Javier Martinez Canillas <[email protected]> Signed-off-by: Maíra Canal <[email protected]> Signed-off-by: Javier Martinez Canillas <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2022-07-11drm: selftest: convert drm_format selftest to KUnitMaíra Canal4-288/+1
Considering the current adoption of the KUnit framework, convert the DRM format selftest to the KUnit API. Tested-by: David Gow <[email protected]> Acked-by: Daniel Latypov <[email protected]> Reviewed-by: Javier Martinez Canillas <[email protected]> Signed-off-by: Maíra Canal <[email protected]> Signed-off-by: Javier Martinez Canillas <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2022-07-11drm: selftest: convert drm_rect selftest to KUnitMaíra Canal4-232/+1
Considering the current adoption of the KUnit framework, convert the DRM rect selftest to the KUnit API. Co-developed-by: Carlos Veras <[email protected]> Signed-off-by: Carlos Veras <[email protected]> Co-developed-by: Matheus Vieira <[email protected]> Signed-off-by: Matheus Vieira <[email protected]> Tested-by: David Gow <[email protected]> Acked-by: Daniel Latypov <[email protected]> Reviewed-by: Javier Martinez Canillas <[email protected]> Signed-off-by: Maíra Canal <[email protected]> Signed-off-by: Javier Martinez Canillas <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2022-07-11drm: selftest: convert drm_cmdline_parser selftest to KUnitMaíra Canal3-1210/+1
Considering the current adoption of the KUnit framework, convert the DRM cmdline parser selftest to the KUnit API. Co-developed-by: Arthur Grillo <[email protected]> Signed-off-by: Arthur Grillo <[email protected]> Tested-by: David Gow <[email protected]> Acked-by: Daniel Latypov <[email protected]> Reviewed-by: Javier Martinez Canillas <[email protected]> Signed-off-by: Maíra Canal <[email protected]> Signed-off-by: Javier Martinez Canillas <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2022-07-11drm: selftest: convert drm_damage_helper selftest to KUnitMaíra Canal4-712/+1
Considering the current adoption of the KUnit framework, convert the DRM damage helper selftest to the KUnit API. Co-developed-by: Arthur Grillo <[email protected]> Signed-off-by: Arthur Grillo <[email protected]> Tested-by: David Gow <[email protected]> Acked-by: Daniel Latypov <[email protected]> Reviewed-by: Javier Martinez Canillas <[email protected]> Signed-off-by: Maíra Canal <[email protected]> Signed-off-by: Javier Martinez Canillas <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2022-06-28drm/display/selftests: drop extra word 'for' in comments for MST selftestsJiang Jian1-1/+1
there is an unexpected word 'for' in the comments that need to be dropped file - ./drivers/gpu/drm/selftests/test-drm_dp_mst_helper.c line - 3 * Test cases for for the DRM DP MST helpers changed to: * Test cases for the DRM DP MST helpers Signed-off-by: Jiang Jian <[email protected]> Reviewed-by: Lyude Paul <[email protected]> Signed-off-by: Lyude Paul <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2022-06-20drm: Drop drm_framebuffer.h from drm_crtc.hVille Syrjälä2-0/+2
drm_crtc.h has no need for drm_frambuffer.h, so don't include it. Avoids useless rebuilds of the entire universe when touching drm_framebuffer.h. Quite a few placs do currently depend on drm_framebuffer.h without actually including it directly. All of those need to be fixed up. v2: Fix up msm some more v2: Deal with ingenic and shmobile as well Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Acked-by: Sam Ravnborg <[email protected]> Acked-by: Jani Nikula <[email protected]>
2022-04-25drm: Rename dp/ to display/Thomas Zimmermann1-2/+2
Rename dp/ to display/ to account for additional display-related helpers, such as HDMI. Update all related include statements. No functional changes. Various drivers, such as i915 and amdgpu, use similar naming scheme by putting code for video-output standards into a local display/ directory. The new directory's name is aligned with this convention. v2: * update commit message (Javier) Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Lyude Paul <[email protected]> Reviewed-by: Javier Martinez Canillas <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2022-04-05Merge drm/drm-next into drm-misc-nextMaxime Ripard1-4/+4
Let's start the 5.19 development cycle. Signed-off-by: Maxime Ripard <[email protected]>
2022-03-21drm/selftest: plane_helper: Put test structures in static storageNathan Chancellor1-4/+4
Clang warns on certain 32-bit architectures: drivers/gpu/drm/selftests/test-drm_plane_helper.c:76:5: warning: stack frame size (1064) exceeds limit (1024) in 'igt_check_plane_state' [-Wframe-larger-than] int igt_check_plane_state(void *ignored) ^ 1 warning generated. The structures in igt_check_plane_state() total 1008 bytes, so any small amount of inlining will cause the stack frame to exceed the 32-bit limit of 1024, triggering the warning. Move these structures to static storage, which dramatically reduces the amount of stack space in igt_check_plane_state(). There is no testing impact, as igt_check_plane_state() is only called once in the driver. Fixes: 943e6a8beeac ("mock a drm_plane in igt_check_plane_state to make the test more robust") Link: https://github.com/ClangBuiltLinux/linux/issues/1600 Reported-by: kernel test robot <[email protected]> Suggested-by: Nick Desaulniers <[email protected]> Signed-off-by: Nathan Chancellor <[email protected]> Reviewed-by: Nick Desaulniers <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2022-03-07drm/selftests: missing error code in igt_buddy_alloc_smoke()Dan Carpenter1-1/+3
Set the error code to -ENOMEM if drm_random_order() fails. Fixes: e6ff5ef81170 ("drm/selftests: add drm buddy smoke testcase") Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Arunpravin <[email protected]> Signed-off-by: Christian König <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/20220307125458.GA16710@kili
2022-03-04drm/selftests: fix a shift-out-of-bounds bugArunpravin1-3/+3
pass the correct size value computed using the max_order. <log snip> [ 68.124177][ T1] UBSAN: shift-out-of-bounds in include/linux/log2.h:67:13 [ 68.125333][ T1] shift exponent 4294967295 is too large for 32-bit type 'long unsigned int' [ 68.126563][ T1] CPU: 0 PID: 1 Comm: swapper Not tainted 5.17.0-rc2-00311-g39ec47bbfd5d #2 [ 68.127758][ T1] Call Trace: [ 68.128187][ T1] dump_stack_lvl (lib/dump_stack.c:108) [ 68.128793][ T1] dump_stack (lib/dump_stack.c:114) [ 68.129331][ T1] ubsan_epilogue (lib/ubsan.c:152) [ 68.129958][ T1] __ubsan_handle_shift_out_of_bounds.cold (arch/x86/include/asm/smap.h:85) [ 68.130791][ T1] ? drm_block_alloc+0x28/0x80 [ 68.131582][ T1] ? rcu_read_lock_sched_held (kernel/rcu/update.c:125) [ 68.132215][ T1] ? kmem_cache_alloc (include/trace/events/kmem.h:54 mm/slab.c:3501) [ 68.132878][ T1] ? mark_free+0x2e/0x80 [ 68.133524][ T1] drm_buddy_init.cold (include/linux/log2.h:67 drivers/gpu/drm/drm_buddy.c:131) [ 68.134145][ T1] ? test_drm_cmdline_init (drivers/gpu/drm/selftests/test-drm_buddy.c:87) [ 68.134770][ T1] igt_buddy_alloc_limit (drivers/gpu/drm/selftests/test-drm_buddy.c:30) [ 68.135472][ T1] ? vprintk_default (kernel/printk/printk.c:2257) [ 68.136057][ T1] ? test_drm_cmdline_init (drivers/gpu/drm/selftests/test-drm_buddy.c:87) [ 68.136812][ T1] test_drm_buddy_init (drivers/gpu/drm/selftests/drm_selftest.c:77 drivers/gpu/drm/selftests/test-drm_buddy.c:95) [ 68.137475][ T1] do_one_initcall (init/main.c:1300) [ 68.138111][ T1] ? parse_args (kernel/params.c:609 kernel/params.c:146 kernel/params.c:188) [ 68.138717][ T1] do_basic_setup (init/main.c:1372 init/main.c:1389 init/main.c:1408) [ 68.139366][ T1] kernel_init_freeable (init/main.c:1617) [ 68.140040][ T1] ? rest_init (init/main.c:1494) [ 68.140634][ T1] kernel_init (init/main.c:1504) [ 68.141155][ T1] ret_from_fork (arch/x86/entry/entry_32.S:772) [ 68.141607][ T1] ================================================================================ [ 68.146730][ T1] ------------[ cut here ]------------ [ 68.147460][ T1] kernel BUG at drivers/gpu/drm/drm_buddy.c:140! [ 68.148280][ T1] invalid opcode: 0000 [#1] [ 68.148895][ T1] CPU: 0 PID: 1 Comm: swapper Not tainted 5.17.0-rc2-00311-g39ec47bbfd5d #2 [ 68.149896][ T1] EIP: drm_buddy_init (drivers/gpu/drm/drm_buddy.c:140 (discriminator 1)) For more details: https://lists.01.org/hyperkitty/list/[email protected]/thread/FDIF3HCILZNN5UQAZMOR7E3MQSMHHKWU/ Signed-off-by: Arunpravin <[email protected]> Reported-by: kernel test robot <[email protected]> Acked-by: Christian König <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Christian König <[email protected]>
2022-02-23drm/selftests: add drm buddy pathological testcaseArunpravin2-0/+131
create a pot-sized mm, then allocate one of each possible order within. This should leave the mm with exactly one page left. Free the largest block, then whittle down again. Eventually we will have a fully 50% fragmented mm. v2(Matthew Auld): - removed unnecessary test succeeded print - replace list_del()/list_add_tail() with list_move_tail() Signed-off-by: Arunpravin <[email protected]> Reviewed-by: Matthew Auld <[email protected]> Acked-by: Christian König <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Christian König <[email protected]>
2022-02-23drm/selftests: add drm buddy smoke testcaseArunpravin2-0/+140
- add a test to ascertain that the critical functionalities of the program is working fine - add a timeout helper function v2: - removed unnecessary test succeeded print - replace list_del()/list_add_tail() with list_move_tail() Signed-off-by: Arunpravin <[email protected]> Reviewed-by: Matthew Auld <[email protected]> Acked-by: Christian König <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Christian König <[email protected]>
2022-02-23drm/selftests: add drm buddy pessimistic testcaseArunpravin2-0/+148
create a pot-sized mm, then allocate one of each possible order within. This should leave the mm with exactly one page left. v2: - removed unnecessary test succeeded print - replace list_del()/list_add_tail() with list_move_tail() Signed-off-by: Arunpravin <[email protected]> Reviewed-by: Matthew Auld <[email protected]> Acked-by: Christian König <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Christian König <[email protected]>
2022-02-23drm/selftests: add drm buddy optimistic testcaseArunpravin2-0/+81
create a mm with one block of each order available, and try to allocate them all. v2(Matthew Auld): - removed unnecessary test succeeded print - replace list_del()/list_add_tail() with list_move_tail() Signed-off-by: Arunpravin <[email protected]> Reviewed-by: Matthew Auld <[email protected]> Acked-by: Christian König <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Christian König <[email protected]>
2022-02-23drm/selftests: add drm buddy alloc range testcaseArunpravin2-0/+389
- add a test to check the range allocation - export get_buddy() function in drm_buddy.c - export drm_prandom_u32_max_state() in lib/drm_random.c - include helper functions - include prime number header file v2: - add drm_get_buddy() function description (Matthew Auld) - removed unnecessary test succeeded print Signed-off-by: Arunpravin <[email protected]> Reviewed-by: Matthew Auld <[email protected]> Acked-by: Christian König <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Christian König <[email protected]>
2022-02-23drm/selftests: add drm buddy alloc limit testcaseArunpravin2-0/+60
add a test to check the maximum allocation limit v2(Matthew Auld): - added err = -EINVAL in block NULL check - removed unnecessary test succeeded print Signed-off-by: Arunpravin <[email protected]> Reviewed-by: Matthew Auld <[email protected]> Acked-by: Christian König <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Christian König <[email protected]>
2022-02-23drm/selftests: Move i915 buddy selftests into drmArunpravin3-1/+60
- move i915 buddy selftests into drm selftests folder - add Makefile and Kconfig support - add sanitycheck testcase Prerequisites - These series of selftests patches are created on top of drm buddy series - Enable kselftests for DRM as a module in .config Signed-off-by: Arunpravin <[email protected]> Acked-by: Christian König <[email protected]> Acked-by: Matthew Auld <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Christian König <[email protected]>
2022-01-31drm: remove allow_fb_modifiersTomohito Esaki1-1/+0
The allow_fb_modifiers flag is unnecessary since it has been replaced with fb_modifiers_not_supported flag. v3: - change the order as follows: 1. add fb_modifiers_not_supported flag 2. add default modifiers 3. remove allow_fb_modifiers flag v5: - keep a sanity check in plane init func Signed-off-by: Tomohito Esaki <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2022-01-19drm/selftests/test-drm_dp_mst_helper: Fix memory leak in ↵José Expósito1-1/+3
sideband_msg_req_encode_decode Avoid leaking the "out" variable if it is not possible to allocate the "txmsg" variable. Fixes: 09234b88ef55 ("drm/selftests/test-drm_dp_mst_helper: Move 'sideband_msg_req_encode_decode' onto the heap") Addresses-Coverity-ID: 1475685 ("Resource leak") Signed-off-by: José Expósito <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2022-01-17drm/dp: Move public DisplayPort headers into dp/Thomas Zimmermann1-1/+1
Move all public DisplayPort headers into dp/ and update users. No functional changes. v3: * rebased onto latest drm-tip Signed-off-by: Thomas Zimmermann <[email protected]> Acked-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2022-01-17drm/dp: Move DisplayPort helpers into separate helper moduleThomas Zimmermann1-1/+1
Move DisplayPort functions into a separate module to reduce the size of the KMS helpers. Select DRM_DP_HELPER for all users of the code. To avoid naming conflicts, rename drm_dp_helper.c to drm_dp.c This change can help to reduce the size of the kernel binary. Some numbers from a x86-64 test build: Before: drm_kms_helper.ko: 447480 bytes After: drm_dp_helper.ko: 216632 bytes drm_kms_helper.ko: 239424 bytes For early-boot graphics, generic DRM drivers, such as simpledrm, require DRM KMS helpers to be built into the kernel. Generic helper functions for DisplayPort take up a significant portion of DRM KMS helper library. These functions are not used by generic drivers and can be loaded as a module. v3: * fix include statement in DRM selftests v2: * move DP helper code into dp/ (Jani) Signed-off-by: Thomas Zimmermann <[email protected]> Acked-by: Lyude Paul <[email protected]> Acked-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2021-12-20mock a drm_plane in igt_check_plane_state to make the test more robustClaudio Suarez1-0/+4
igt_check_plane_state test crashes in drm_atomic_helper_check_plane_state when trying to de-reference drm_plane_state->plane->dev due to the lack of a struct drm_plane in the mock struct drm_plane_state. Since drm_plane_state always should contain a plane, the mock also needs a plane to be the test more robust and realistic. Add it. Signed-off-by: Claudio Suarez <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2021-10-22drm/i915/selftests: Properly reset mock object propers for each testDaniel Vetter1-0/+1
I forgot to do this properly in commit 6f11f37459d8f9f74ff1c299c0bedd50b458057a Author: Daniel Vetter <[email protected]> Date: Fri Jul 23 10:34:55 2021 +0200 drm/plane: remove drm_helper_get_plane_damage_clips intel-gfx CI didn't spot this because we run each selftest in each own invocations, which means reloading i915.ko. But if you just run all the selftests in one go at boot-up, then it falls apart and eventually we cross over the hardcoded limited of how many properties can be attached to a single object. Fix this by resetting the property count. Nothing else to clean up since it's all static storage anyway. Reported-and-tested-by: Sebastian Andrzej Siewior <[email protected]> Cc: Sebastian Andrzej Siewior <[email protected]> Fixes: 6f11f37459d8 ("drm/plane: remove drm_helper_get_plane_damage_clips") Cc: José Roberto de Souza <[email protected]> Cc: Ville Syrjälä <[email protected]> Cc: Gwan-gyeong Mun <[email protected]> Cc: Hans de Goede <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: Maarten Lankhorst <[email protected]> Cc: Maxime Ripard <[email protected]> Cc: Thomas Zimmermann <[email protected]> Acked-by: Thomas Zimmermann <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2021-08-02drm: Fix oops in damage self-tests by mocking damage propertyDaniel Vetter1-216/+71
I've added a new check to make sure that drivers which insepct the damage property have it set up correctly, but somehow missed that this borke the damage selftest in the CI result noise. Fix it up by mocking enough of drm_device and drm_plane so we can call drm_plane_enable_fb_damage_clips() to make the new check happy. Since there's a lot of duplicated mock code already copy-pasted into each test I've also refactored this a bit to trim it down. v2: Squash in fixup from 0day for drivers/gpu/drm/selftests/test-drm_damage_helper.c:15:19: warning: symbol 'mock_device' was not declared. Should it be static? drivers/gpu/drm/selftests/test-drm_damage_helper.c:16:30: warning: symbol 'mock_obj_props' was not declared. Should it be static? drivers/gpu/drm/selftests/test-drm_damage_helper.c:17:18: warning: symbol 'mock_plane' was not declared. Should it be static? drivers/gpu/drm/selftests/test-drm_damage_helper.c:18:21: warning: symbol 'mock_prop' was not declared. Should it be static? Reported-by: kernel test robot <[email protected]> Signed-off-by: kernel test robot <[email protected]> Reviewed-by: Maarten Lankhorst <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Fixes: c7fcbf251397 ("drm/plane: check that fb_damage is set up when used") Cc: José Roberto de Souza <[email protected]> (v1) Cc: Ville Syrjälä <[email protected]> Cc: Gwan-gyeong Mun <[email protected]> Cc: José Roberto de Souza <[email protected]> Cc: Hans de Goede <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: Maarten Lankhorst <[email protected]> Cc: Maxime Ripard <[email protected]> Cc: Thomas Zimmermann <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Link: https://patchwork.freedesktop.org/patch/msgid/20210730141948.GA11955@243d74413310
2021-06-23drm: allow drm_atomic_print_state() to accept any drm_printerAbhinav Kumar1-0/+1
Currently drm_atomic_print_state() internally allocates and uses a drm_info printer. Allow it to accept any drm_printer type so that the API can be leveraged even for taking drm snapshot. Rename the drm_atomic_print_state() to drm_atomic_print_new_state() so that it reflects its functionality better. changes in v5: - none Reported-by: kernel test robot <[email protected]> Signed-off-by: Abhinav Kumar <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Rob Clark <[email protected]>
2020-11-17drm/selftests/test-drm_dp_mst_helper: Move 'sideband_msg_req_encode_decode' ↵Lee Jones1-3/+8
onto the heap There is too much data being stored on the stack. Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/selftests/test-drm_dp_mst_helper.c: In function ‘sideband_msg_req_encode_decode’: drivers/gpu/drm/selftests/test-drm_dp_mst_helper.c:168:1: warning: the frame size of 1072 bytes is larger than 1024 bytes [-Wframe-larger-than=] Cc: David Airlie <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: [email protected] Signed-off-by: Lee Jones <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-11-17drm/selftests/test-drm_dp_mst_helper: Place 'struct ↵Lee Jones1-11/+20
drm_dp_sideband_msg_req_body' onto the heap The stack is too full. Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/selftests/test-drm_dp_mst_helper.c: In function ‘sideband_msg_req_encode_decode’: drivers/gpu/drm/selftests/test-drm_dp_mst_helper.c:161:1: warning: the frame size of 1176 bytes is larger than 1024 bytes [-Wframe-larger-than=] Cc: David Airlie <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: Lyude Paul <[email protected]> Cc: David Francis <[email protected]> Cc: [email protected] Reviewed-by: Lyude Paul <[email protected]> Signed-off-by: Lee Jones <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-11-17drm/selftests/test-drm_framebuffer: Remove set but unused variable 'fb'Lee Jones1-2/+1
Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/selftests/test-drm_framebuffer.c: In function ‘execute_drm_mode_fb_cmd2’: drivers/gpu/drm/selftests/test-drm_framebuffer.c:333:26: warning: variable ‘fb’ set but not used [-Wunused-but-set-variable] Cc: David Airlie <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: [email protected] Signed-off-by: Lee Jones <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-11-17drm/selftests/test-drm_mm: Mark 'hole_end' as always_unusedLee Jones1-1/+1
In the macro drm_mm_for_each_hole() 'hole_end' is provided as a container for 'hole_start + pos->hole_size', but is not utilised in this use-case. We cannot simply delete the variable, so here we tell the compiler that we're intentionally discarding the read value. Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/selftests/test-drm_mm.c: In function ‘assert_no_holes’: drivers/gpu/drm/selftests/test-drm_mm.c:57:18: warning: variable ‘hole_end’ set but not used [-Wunused-but-set-variable] Cc: David Airlie <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: "Christian König" <[email protected]> Cc: Nirmoy Das <[email protected]> Cc: [email protected] Signed-off-by: Lee Jones <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-09-01drm/mst: Add support for QUERY_STREAM_ENCRYPTION_STATUS MST sideband messageSean Paul1-0/+17
Used to query whether an MST stream is encrypted or not. Cc: Lyude Paul <[email protected]> Reviewed-by: Anshuman Gupta <[email protected]> Reviewed-by: Lyude Paul <[email protected]> Signed-off-by: Sean Paul <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] #v4 Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] #v5 Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] #v6 Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] #v7 Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] #v8 Changes in v4: -Added to the set Changes in v5: -None Changes in v6: -Use FIELD_PREP to generate request buffer bitfields (Lyude) -Add mst selftest and dump/decode_sideband_req for QSES (Lyude) Changes in v7: -None Changes in v8: -Reverse the parsing on the hdcp_*x_device_present bits and leave breadcrumb in case this is incorrect (Anshuman) Changes in v8.5: -s/DRM_DEBUG_KMS/drm_dbg_kms/ (Lyude) Signed-off-by: Ramalingam C <[email protected]> Acked-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-06-23drm/mm/selftests: fix wrong return type castingNirmoy Das1-14/+7
Function prepare_igt_frag() and get_insert_time() were casting signed value to unsigned value before returning error. So error check in igt_frag() would not work with unsigned return value from get_insert_time() compared against negative value. Addresses-Coverity: ("Unsigned compared against 0, no effect") Signed-off-by: Nirmoy Das <[email protected]> Reported-by: Colin Ian King <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Christian König <[email protected]> Link: https://patchwork.freedesktop.org/patch/370636/
2020-06-23drm/mm: optimize find_hole() as wellChristian König1-11/+0
Abort early if there isn't enough space to allocate from a subtree. Signed-off-by: Christian König <[email protected]> Acked-by: Nirmoy Das <[email protected]> Link: https://patchwork.freedesktop.org/patch/370297/
2020-06-16drm/kselftest: fix spellint typo in test-drm_mm.cMasanari Iida1-1/+1
This patch fix a spelling typo in test-drm_mm.c Signed-off-by: Masanari Iida <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-06-08drm/mm: add ig_frag selftestNirmoy Das2-0/+125
This patch introduces fragmentation in the address range and measures time taken by 10k and 20k insertions. ig_frag() will fail if the time taken by 20k insertions takes more than 4 times of 10k insertions as we know that insertions should at most scale quadratically. v2: introduce fragmentation by freeing every other node. only test bottom-up and top-down for now. v3: fix incorrect mode check Signed-off-by: Nirmoy Das <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Christian König <[email protected]> Link: https://patchwork.freedesktop.org/patch/369076/
2020-02-12drm/modes: Make sure to parse valid rotation value from cmdlineStephan Gerhold2-2/+14
A rotation value should have exactly one rotation angle. At the moment there is no validation for this when parsing video= parameters from the command line. This causes problems later on when we try to combine the command line rotation with the panel orientation. To make sure that we generate a valid rotation value: - Set DRM_MODE_ROTATE_0 by default (if no rotate= option is set) - Validate that there is exactly one rotation angle set (i.e. specifying the rotate= option multiple times is invalid) Signed-off-by: Stephan Gerhold <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-01-13Merge tag 'amd-drm-next-5.6-2020-01-10-dp-mst-dsc' of ↵Dave Airlie1-4/+8
git://people.freedesktop.org/~agd5f/linux into drm-next amd-drm-next-5.6-2020-01-10-dp-mst-dsc: drm: - Add MST helper for PBN calculation of DSC modes - Parse FEC caps on MST ports - Add MST DPCD R/W functions - Add MST helpers for virtual DPCD aux - Add MST HUB quirk - Add MST DSC enablement helpers amdgpu: - Enable MST DSC - Add fair share algo for DSC bandwidth calcs - Fix for 32 bit builds Signed-off-by: Dave Airlie <[email protected]> From: Alex Deucher <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-01-09drm/dp_mst: Add PBN calculation for DSC modesDavid Francis1-4/+8
With DSC, bpp can be fractional in multiples of 1/16. Change drm_dp_calc_pbn_mode to reflect this, adding a new parameter bool dsc. When this parameter is true, treat the bpp parameter as having units not of bits per pixel, but 1/16 of a bit per pixel v2: Don't add separate function for this v3: In the equation divide bpp by 16 as it is expected not to leave any remainder v4: Added DSC test parameters for selftest Reviewed-by: Manasi Navare <[email protected]> Reviewed-by: Lyude Paul <[email protected]> Reviewed-by: Harry Wentland <[email protected]> Signed-off-by: David Francis <[email protected]> Signed-off-by: Mikita Lipski <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
2019-12-16drm/modes: parse_cmdline: Add support for specifying panel_orientation (v2)Hans de Goede2-0/+23
Sometimes we want to override a connector's panel_orientation from the kernel commandline. Either for testing and for special cases, e.g. a kiosk like setup which uses a TV mounted in portrait mode. Users can already specify a "rotate" option through a video= kernel cmdline option. But that only supports 0/180 degrees (see drm_client_modeset TODO) and only works for in kernel modeset clients, not for userspace kms users. The "panel-orientation" connector property OTOH does support 90/270 degrees as it leaves dealing with the rotation up to userspace and this does work for userspace kms clients (at least those which support this property). Changes in v2: -Add missing ':' after @panel_orientation (reported by kbuild test robot) BugLink: https://gitlab.freedesktop.org/plymouth/plymouth/merge_requests/83 Acked-by: Maxime Ripard <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-12-16drm/modes: parse_cmdline: Allow specifying stand-alone optionsHans de Goede2-0/+52
Some options which can be specified on the commandline, such as margin_right=..., margin_left=..., etc. are applied not only to the specified mode, but to all modes. As such it would be nice if the user can simply say e.g. video=HDMI-1:margin_right=14,margin_left=24,margin_bottom=36,margin_top=42 This commit refactors drm_mode_parse_command_line_for_connector() to add support for this, and as a nice side effect also cleans up the function a bit. Acked-by: Maxime Ripard <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-12-16drm/modes: parse_cmdline: Accept extras directly after mode combined with ↵Hans de Goede2-0/+25
options Before this commit it was impossible to combine an extra mode argument specified directly after the resolution with an option, e.g. video=HDMI-1:720x480e,rotate=180 would not work, either the "e" to force enable would need to be dropped or the ",rotate=180", otherwise the mode_option would not be accepted. This commit fixes this by setting parse_extras to true in this case, so that drm_mode_parse_cmdline_res_mode() parses the extra arguments directly after the resolution. Acked-by: Maxime Ripard <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-12-16drm/modes: parse_cmdline: Stop parsing extras after bpp / refresh at ', 'Hans de Goede2-0/+27
Before this commit it was impossible to add an extra mode argument after a bpp or refresh specifier, combined with an option, e.g. video=HDMI-1:720x480-24e,rotate=180 would not work, either the "e" to force enable would need to be dropped or the ",rotate=180", otherwise the mode_option would not be accepted. This commit fixes this by fixing the length calculation if extras_ptr is set to stop the extra parsing at the start of the options (stop at the ',' options_ptr points to). Acked-by: Maxime Ripard <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-11-28drm/selftests: Add drm_rect selftestsVille Syrjälä4-1/+236
Add selftests for drm_rect. A few basic ones for clipped and unclipped cases, and a few special ones for specific bugs we had in the code. I'm too lazy to think of more corner cases to check at this time. Maybe later. Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Daniel Vetter <[email protected]> Reviewed-by: Benjamin Gaignard <[email protected]>
2019-10-04drm/mm: Use helpers for drm_mm_node booleansChris Wilson1-7/+7
In preparation for rearranging the booleans into a flags field, ensure all the current users are using the inline helpers and not directly accessing the members. Signed-off-by: Chris Wilson <[email protected]> Reviewed-by: Tvrtko Ursulin <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-10-03Merge drm/drm-next into drm-misc-nextMaxime Ripard2-0/+137
We haven't done any backmerge for a while due to the merge window, and it starts to become an issue for komeda. Let's bring 5.4-rc1 in. Signed-off-by: Maxime Ripard <[email protected]>