summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/tests/drm_client_modeset_test.c
AgeCommit message (Collapse)AuthorFilesLines
2022-12-08drm/tests: helpers: Allow for a custom device struct to be allocatedMaxime Ripard1-1/+3
The current helper to allocate a DRM device doesn't allow for any subclassing by drivers, which is going to be troublesome as we work on getting some kunit testing on atomic modesetting code. Let's use a similar pattern to the other allocation helpers by providing the structure size and offset as arguments. Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://lore.kernel.org/r/20221123-rpi-kunit-tests-v3-10-4615a663a84a@cerno.tech Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2022-12-08drm/tests: helpers: Create the device in another functionMaxime Ripard1-1/+13
We'll need in some tests to control when the device needs to be added and removed, so let's split the device creation from the DRM device creation function. Reviewed-by: Maíra Canal <mcanal@igalia.com> Link: https://lore.kernel.org/r/20221123-rpi-kunit-tests-v3-7-4615a663a84a@cerno.tech Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2022-12-08drm/tests: helpers: Remove the name parameterMaxime Ripard1-2/+1
The device name isn't really useful, we can just define it instead of exposing it in the API. Reviewed-by: Maíra Canal <mcanal@igalia.com> Link: https://lore.kernel.org/r/20221123-rpi-kunit-tests-v3-6-4615a663a84a@cerno.tech Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2022-12-08drm/tests: helpers: Rename the device init helperMaxime Ripard1-1/+2
The name doesn't really fit the conventions for the other helpers in DRM/KMS, so let's rename it to make it obvious that we allocate a new DRM device. Reviewed-by: Maíra Canal <mcanal@igalia.com> Link: https://lore.kernel.org/r/20221123-rpi-kunit-tests-v3-5-4615a663a84a@cerno.tech Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2022-12-08drm/tests: helpers: Move the helper header to include/drmMaxime Ripard1-2/+1
We'll need to use those helpers from drivers too, so let's move it to a more visible location. Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://lore.kernel.org/r/20221123-rpi-kunit-tests-v3-1-4615a663a84a@cerno.tech Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2022-11-24drm/modes: Introduce more named modesMaxime Ripard1-0/+2
Now that we can easily extend the named modes list, let's add a few more analog TV modes that were used in the wild, and some unit tests to make sure it works as intended. Reviewed-by: Noralf Trønnes <noralf@tronnes.org> Tested-by: Mateusz Kwiatkowski <kfyatek+publicgit@gmail.com> Acked-in-principle-or-something-like-that-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://lore.kernel.org/r/20220728-rpi-analog-tv-properties-v10-11-256dad125326@cerno.tech Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2022-11-24drm/modes: Properly generate a drm_display_mode from a named modeMaxime Ripard1-1/+83
The framework will get the drm_display_mode from the drm_cmdline_mode it got by parsing the video command line argument by calling drm_connector_pick_cmdline_mode(). The heavy lifting will then be done by the drm_mode_create_from_cmdline_mode() function. In the case of the named modes though, there's no real code to make that translation and we rely on the drivers to guess which actual display mode we meant. Let's modify drm_mode_create_from_cmdline_mode() to properly generate the drm_display_mode we mean when passing a named mode. Reviewed-by: Noralf Trønnes <noralf@tronnes.org> Tested-by: Mateusz Kwiatkowski <kfyatek+publicgit@gmail.com> Acked-in-principle-or-something-like-that-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://lore.kernel.org/r/20220728-rpi-analog-tv-properties-v10-9-256dad125326@cerno.tech Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2022-11-24drm/tests: client: Mention that we can't use MODULE_ macrosMaxime Ripard1-0/+5
That file is included directly, so we can't use any MODULE macro. Let's leave a comment to avoid any future mistake. Reviewed-by: Noralf Trønnes <noralf@tronnes.org> Acked-in-principle-or-something-like-that-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://lore.kernel.org/r/20220728-rpi-analog-tv-properties-v10-1-256dad125326@cerno.tech Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2022-11-17drm/tests: client: Remove extra blank linesMaxime Ripard1-2/+0
Some extra blank lines slipped through, remove them. Fixes: 8fc0380f6ba7 ("drm/client: Add some tests for drm_connector_pick_cmdline_mode()") Reviewed-by: Maíra Canal <mairacanal@riseup.net> Link: https://lore.kernel.org/r/20221116151833.1679379-1-maxime@cerno.tech Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2022-11-15drm/client: Add some tests for drm_connector_pick_cmdline_mode()Maxime Ripard1-0/+100
drm_connector_pick_cmdline_mode() is in charge of finding a proper drm_display_mode from the definition we got in the video= command line argument. Let's add some unit tests to make sure we're not getting any regressions there. Acked-by: Noralf Trønnes <noralf@tronnes.org> Tested-by: Mateusz Kwiatkowski <kfyatek+publicgit@gmail.com> Link: https://lore.kernel.org/r/20220728-rpi-analog-tv-properties-v9-8-24b168e5bcd5@cerno.tech Signed-off-by: Maxime Ripard <maxime@cerno.tech>