summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/tests/drm_probe_helper_test.c
AgeCommit message (Collapse)AuthorFilesLines
2023-07-31drm/tests: probe-helper: Remove call to drm_kunit_helper_free_device()Maxime Ripard1-8/+0
Calling drm_kunit_helper_free_device() to clean up the resources allocated by drm_kunit_helper_alloc_device() is now optional and not needed in most cases. Remove it. Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Reviewed-by: Maíra Canal <mairacanal@riseup.net> Link: https://lore.kernel.org/r/20230728-kms-kunit-actions-rework-v3-4-952565ccccfe@kernel.org Signed-off-by: Maxime Ripard <mripard@kernel.org>
2022-12-08drm/tests: helpers: Allow for a custom device struct to be allocatedMaxime Ripard1-2/+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-2/+3
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-12-01drm/tests: probe_helper: Fix uninitialized variableMaxime Ripard1-0/+1
The len variable is used while uninitialized. Initialize it. Fixes: 1e4a91db109f ("drm/probe-helper: Provide a TV get_modes helper") Reported-by: kernel test robot <lkp@intel.com> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://lore.kernel.org/r/20221201090736.290935-1-maxime@cerno.tech Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2022-11-24drm/probe-helper: Provide a TV get_modes helperNoralf Trønnes1-0/+205
Most of the TV connectors will need a similar get_modes implementation that will, depending on the drivers' capabilities, register the 480i and 576i modes. That implementation will also need to set the preferred flag and order the modes based on the driver and users preferrence. This is especially important to guarantee that a userspace stack such as Xorg can start and pick up the preferred mode while maintaining a working output. Signed-off-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-12-256dad125326@cerno.tech Signed-off-by: Maxime Ripard <maxime@cerno.tech>