summaryrefslogtreecommitdiff
path: root/drivers/gpu
AgeCommit message (Collapse)AuthorFilesLines
2022-12-12drm: atmel-hlcdc: Remove #ifdef guards for PM related functionsPaul Cercueil1-5/+4
Use the DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() macros to handle the .suspend/.resume callbacks. These macros allow the suspend and resume functions to be automatically dropped by the compiler when CONFIG_SUSPEND is disabled, without having to use #ifdef guards. This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Acked-by: Sam Ravnborg <sam@ravnborg.org> Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com> Link: https://patchwork.freedesktop.org/patch/msgid/20221129191733.137897-9-paul@crapouillou.net
2022-12-09drm/bridge: tfp410: Convert to i2c's .probe_new()Uwe Kleine-König1-3/+2
The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Link: https://lore.kernel.org/r/20221118224540.619276-38-uwe@kleine-koenig.org Signed-off-by: Robert Foss <robert.foss@linaro.org>
2022-12-09drm/bridge/tc358775: Convert to i2c's .probe_new()Uwe Kleine-König1-2/+2
The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Link: https://lore.kernel.org/r/20221118224540.619276-35-uwe@kleine-koenig.org Signed-off-by: Robert Foss <robert.foss@linaro.org>
2022-12-09drm/bridge: tc358768: Convert to i2c's .probe_new()Uwe Kleine-König1-3/+2
The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Link: https://lore.kernel.org/r/20221118224540.619276-34-uwe@kleine-koenig.org Signed-off-by: Robert Foss <robert.foss@linaro.org>
2022-12-09drm/bridge: tc358767: Convert to i2c's .probe_new()Uwe Kleine-König1-2/+2
The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Link: https://lore.kernel.org/r/20221118224540.619276-33-uwe@kleine-koenig.org Signed-off-by: Robert Foss <robert.foss@linaro.org>
2022-12-09drm/bridge: sii8620: Convert to i2c's .probe_new()Uwe Kleine-König1-3/+2
The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Link: https://lore.kernel.org/r/20221118224540.619276-32-uwe@kleine-koenig.org Signed-off-by: Robert Foss <robert.foss@linaro.org>
2022-12-09drm/bridge: sii9234: Convert to i2c's .probe_new()Uwe Kleine-König1-3/+2
The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Link: https://lore.kernel.org/r/20221118224540.619276-31-uwe@kleine-koenig.org Signed-off-by: Robert Foss <robert.foss@linaro.org>
2022-12-09drm/bridge: sii902x: Convert to i2c's .probe_new()Uwe Kleine-König1-3/+2
The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Link: https://lore.kernel.org/r/20221118224540.619276-30-uwe@kleine-koenig.org Signed-off-by: Robert Foss <robert.foss@linaro.org>
2022-12-09drm/bridge: nxp-ptn3460: Convert to i2c's .probe_new()Uwe Kleine-König1-3/+2
The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Link: https://lore.kernel.org/r/20221118224540.619276-28-uwe@kleine-koenig.org Signed-off-by: Robert Foss <robert.foss@linaro.org>
2022-12-09drm/bridge: megachips: Convert to i2c's .probe_new()Uwe Kleine-König1-6/+4
The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Link: https://lore.kernel.org/r/20221118224540.619276-27-uwe@kleine-koenig.org Signed-off-by: Robert Foss <robert.foss@linaro.org>
2022-12-09drm/bridge: lt9611uxc: Convert to i2c's .probe_new()Uwe Kleine-König1-3/+2
The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Link: https://lore.kernel.org/r/20221118224540.619276-26-uwe@kleine-koenig.org Signed-off-by: Robert Foss <robert.foss@linaro.org>
2022-12-09drm/bridge: lt9611: Convert to i2c's .probe_new()Uwe Kleine-König1-3/+2
The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Link: https://lore.kernel.org/r/20221118224540.619276-25-uwe@kleine-koenig.org Signed-off-by: Robert Foss <robert.foss@linaro.org>
2022-12-09drm/bridge: lt9211: Convert to i2c's .probe_new()Uwe Kleine-König1-3/+2
The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Link: https://lore.kernel.org/r/20221118224540.619276-24-uwe@kleine-koenig.org Signed-off-by: Robert Foss <robert.foss@linaro.org>
2022-12-09drm/bridge: lt8912b: Convert to i2c's .probe_new()Uwe Kleine-König1-3/+2
The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Link: https://lore.kernel.org/r/20221118224540.619276-23-uwe@kleine-koenig.org Signed-off-by: Robert Foss <robert.foss@linaro.org>
2022-12-09drm/bridge: it66121: Convert to i2c's .probe_new()Uwe Kleine-König1-3/+2
The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Link: https://lore.kernel.org/r/20221118224540.619276-22-uwe@kleine-koenig.org Signed-off-by: Robert Foss <robert.foss@linaro.org>
2022-12-09drm/bridge: it6505: Convert to i2c's .probe_new()Uwe Kleine-König1-3/+2
The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Link: https://lore.kernel.org/r/20221118224540.619276-21-uwe@kleine-koenig.org Signed-off-by: Robert Foss <robert.foss@linaro.org>
2022-12-09drm/bridge: icn6211: Convert to i2c's .probe_new()Uwe Kleine-König1-3/+2
The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Link: https://lore.kernel.org/r/20221118224540.619276-19-uwe@kleine-koenig.org Signed-off-by: Robert Foss <robert.foss@linaro.org>
2022-12-09drm/bridge: anx7625: Convert to i2c's .probe_new()Uwe Kleine-König1-3/+2
The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Link: https://lore.kernel.org/r/20221118224540.619276-18-uwe@kleine-koenig.org Signed-off-by: Robert Foss <robert.foss@linaro.org>
2022-12-09drm/bridge/analogix/anx78xx: Convert to i2c's .probe_new()Uwe Kleine-König1-3/+2
The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Link: https://lore.kernel.org/r/20221118224540.619276-17-uwe@kleine-koenig.org Signed-off-by: Robert Foss <robert.foss@linaro.org>
2022-12-09drm/bridge/analogix/anx6345: Convert to i2c's .probe_new()Uwe Kleine-König1-3/+2
The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Link: https://lore.kernel.org/r/20221118224540.619276-16-uwe@kleine-koenig.org Signed-off-by: Robert Foss <robert.foss@linaro.org>
2022-12-08drm/bridge: lt8912b: Add hot plug detectionStefan Eichenberger1-2/+19
Enable hot plug detection when it is available on the HDMI port. Without this connecting to a different monitor with incompatible timing before the 10 seconds poll period will lead to a broken display output. Fixes: 30e2ae943c26 ("drm/bridge: Introduce LT8912B DSI to HDMI bridge") Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com> Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com> Reviewed-by: Adrien Grassein <adrien.grassein@gmail.com> Reviewed-by: Robert Foss <robert.foss@linaro.org> Signed-off-by: Robert Foss <robert.foss@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20221128112320.25708-1-francesco@dolcini.it
2022-12-08drm/bridge: chrontel-ch7033: Convert to i2c's .probe_new()Uwe Kleine-König1-3/+2
The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Robert Foss <robert.foss@linaro.org> Link: https://lore.kernel.org/all/20221118224540.619276-20-uwe@kleine-koenig.org/
2022-12-08drm/gud: Fix missing includeNoralf Trønnes1-0/+1
Add missing vmalloc.h include. Fixes: c17d048609bf ("drm/gud: Use the shadow plane helper") Reported-by: kernel test robot <lkp@intel.com> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Signed-off-by: Noralf Trønnes <noralf@tronnes.org> Link: https://patchwork.freedesktop.org/patch/msgid/20221207-gud-missing-include-v1-0-c5b32c9c59da@tronnes.org
2022-12-08drm/bridge: Document the expected behaviour of DSI host controllersDave Stevenson1-0/+39
The exact behaviour of DSI host controllers is not specified, therefore define it. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Link: https://lore.kernel.org/r/20221205173328.1395350-7-dave.stevenson@raspberrypi.com Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2022-12-08drm/panel: Add prepare_prev_first flag to drm_panelDave Stevenson1-0/+2
Mapping to the drm_bridge flag pre_enable_prev_first, add a new flag prepare_prev_first to drm_panel to allow the panel driver to request that the upstream bridge should be pre_enabled before the panel prepare. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Link: https://lore.kernel.org/r/20221205173328.1395350-6-dave.stevenson@raspberrypi.com Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2022-12-08drm/bridge: Introduce pre_enable_prev_first to alter bridge init orderDave Stevenson1-24/+121
DSI sink devices typically want the DSI host powered up and configured before they are powered up. pre_enable is the place this would normally happen, but they are called in reverse order from panel/connector towards the encoder, which is the "wrong" order. Add a new flag pre_enable_prev_first that any bridge can set to swap the order of pre_enable (and post_disable) for that and the immediately previous bridge. Should the immediately previous bridge also set the pre_enable_prev_first flag, the previous bridge to that will be called before either of those which requested pre_enable_prev_first. eg: - Panel - Bridge 1 - Bridge 2 pre_enable_prev_first - Bridge 3 - Bridge 4 pre_enable_prev_first - Bridge 5 pre_enable_prev_first - Bridge 6 - Encoder Would result in pre_enable's being called as Panel, Bridge 1, Bridge 3, Bridge 2, Bridge 6, Bridge 5, Bridge 4, Encoder. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Tested-by: Frieder Schrempf <frieder.schrempf@kontron.de> Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de> Link: https://lore.kernel.org/r/20221205173328.1395350-5-dave.stevenson@raspberrypi.com Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2022-12-08drm/bridge: Drop unused drm_bridge_chain functionsSam Ravnborg1-110/+0
The drm_bridge_chain_{pre_enable,enable,disable,post_disable} has no users left and we have atomic variants that should be used. Drop them so they do not gain new users. Adjust a few comments to avoid references to the dropped functions. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Reviewed-by: Maxime Ripard <mripard@kernel.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Maxime Ripard <mripard@kernel.org> Cc: Thomas Zimmermann <tzimmermann@suse.de> Cc: Andrzej Hajda <a.hajda@samsung.com> Cc: Neil Armstrong <narmstrong@baylibre.com> Cc: Robert Foss <robert.foss@linaro.org> Cc: Daniel Vetter <daniel@ffwll.ch> Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Link: https://lore.kernel.org/r/20221205173328.1395350-4-dave.stevenson@raspberrypi.com Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2022-12-08drm/mediatek: dp: Replace usage of drm_bridge_chain_ functionsDave Stevenson1-2/+2
Commit f70ac097a2cf ("drm/mediatek: Add MT8195 Embedded DisplayPort driver") added usage of the drm_bridge_chain_ functions which are to be deprecated. Replace with the drm_atomic_bridge_chain_ variants using the current state. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Link: https://lore.kernel.org/r/20221205173328.1395350-3-dave.stevenson@raspberrypi.com Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2022-12-08drm/bridge: ps8640: Use atomic variants of drm_bridge_funcsSam Ravnborg1-6/+12
The atomic variants of enable/disable in drm_bridge_funcs are the preferred operations - introduce these. The ps8640 driver used the non-atomic variants of the drm_bridge_chain_pre_enable/ drm_bridge_chain_post_disable - convert these to the atomic variants. v2: - Init state operations in drm_bridge_funcs (Laurent) Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Reviewed-by: Maxime Ripard <mripard@kernel.org> Cc: Jitao Shi <jitao.shi@mediatek.com> Cc: Philip Chen <philipchen@chromium.org> Cc: Neil Armstrong <narmstrong@baylibre.com> Cc: Robert Foss <robert.foss@linaro.org> Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com> Cc: Jonas Karlman <jonas@kwiboo.se> Cc: Jernej Skrabec <jernej.skrabec@gmail.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Link: https://lore.kernel.org/r/20221205173328.1395350-2-dave.stevenson@raspberrypi.com Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2022-12-08drm/vc4: tests: Add unit test suite for the PV muxingMaxime Ripard4-9/+1091
The HVS to PixelValve muxing code is fairly error prone and has a bunch of arbitrary constraints due to the hardware setup. Let's create a test suite that makes sure that the possible combinations work and the invalid ones don't. Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Reviewed-by: Maíra Canal <mcanal@igalia.com> Link: https://lore.kernel.org/r/20221123-rpi-kunit-tests-v3-19-4615a663a84a@cerno.tech Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2022-12-08drm/vc4: tests: Fail the current test if we access a registerMaxime Ripard7-13/+81
Accessing a register when running under kunit is a bad idea since our device is completely mocked. Fail the current test if we ever access any of our hardware registers. Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Reviewed-by: Maíra Canal <mcanal@igalia.com> Link: https://lore.kernel.org/r/20221123-rpi-kunit-tests-v3-18-4615a663a84a@cerno.tech Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2022-12-08drm/vc4: tests: Introduce a mocking infrastructureMaxime Ripard12-13/+511
In order to test the current atomic_check hooks we need to have a DRM device that has roughly the same capabilities and layout that the actual hardware. We'll also need a bunch of functions to create arbitrary atomic states. Let's create some helpers to create a device that behaves like the real one, and some helpers to maintain the atomic state we want to check. Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Reviewed-by: Maíra Canal <mcanal@igalia.com> Link: https://lore.kernel.org/r/20221123-rpi-kunit-tests-v3-17-4615a663a84a@cerno.tech Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2022-12-08drm/vc4: hvs: Provide a function to initialize the HVS structureMaxime Ripard2-30/+44
We'll need to initialize the HVS structure without a backing device to create a mock we'll use for testing. Split the structure initialization part into a separate function. Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://lore.kernel.org/r/20221123-rpi-kunit-tests-v3-16-4615a663a84a@cerno.tech Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2022-12-08drm/vc4: crtc: Make encoder lookup helper publicMaxime Ripard2-16/+17
We'll need a function that looks up an encoder by its vc4_encoder_type. Such a function is already present in the CRTC code, so let's make it public so that we can reuse it in the unit tests. Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Reviewed-by: Maíra Canal <mcanal@igalia.com> Link: https://lore.kernel.org/r/20221123-rpi-kunit-tests-v3-15-4615a663a84a@cerno.tech Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2022-12-08drm/vc4: crtc: Introduce a lower-level crtc init helperMaxime Ripard2-19/+57
The current vc4_crtc_init() helper assumes that we will be using hardware planes and calls vc4_plane_init(). While it's a reasonable assumption, we'll want to mock the plane and thus provide our own. Let's create a helper that will take the plane as an argument. Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Reviewed-by: Maíra Canal <mcanal@igalia.com> Link: https://lore.kernel.org/r/20221123-rpi-kunit-tests-v3-14-4615a663a84a@cerno.tech Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2022-12-08drm/vc4: Move HVS state to main headerMaxime Ripard2-22/+26
In order to introduce unit tests for the HVS state computation, we'll need access to the vc4_hvs_state struct definition and its associated helpers. Let's move them in our driver header. Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Reviewed-by: Maíra Canal <mcanal@igalia.com> Link: https://lore.kernel.org/r/20221123-rpi-kunit-tests-v3-13-4615a663a84a@cerno.tech Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2022-12-08drm/tests: Add a test for DRM managed actionsMaxime Ripard2-0/+72
DRM-managed actions are supposed to be ran whenever the device is released. Let's introduce a basic unit test to make sure it happens. Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Reviewed-by: Maíra Canal <mcanal@igalia.com> Link: https://lore.kernel.org/r/20221123-rpi-kunit-tests-v3-12-4615a663a84a@cerno.tech Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2022-12-08drm/tests: helpers: Allow to pass a custom drm_driverMaxime Ripard1-10/+5
Some tests will need to provide their own drm_driver instead of relying on the dumb one in the helpers, so let's create a helper that allows to do so. Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://lore.kernel.org/r/20221123-rpi-kunit-tests-v3-11-4615a663a84a@cerno.tech Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2022-12-08drm/tests: helpers: Allow for a custom device struct to be allocatedMaxime Ripard4-36/+18
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: Make sure the device is boundMaxime Ripard1-1/+25
The device managed resources are freed when the device is detached, so it has to be bound in the first place. Let's create a fake driver that we will bind to our fake device to benefit from the device managed cleanups in our tests. Reviewed-by: Maíra Canal <mcanal@igalia.com> Link: https://lore.kernel.org/r/20221123-rpi-kunit-tests-v3-9-4615a663a84a@cerno.tech Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2022-12-08drm/tests: helpers: Switch to a platform_deviceMaxime Ripard1-2/+14
The device managed resources are ran if the device has bus, which is not the case of a root_device. Let's use a platform_device instead. Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Reviewed-by: Maíra Canal <mcanal@igalia.com> Link: https://lore.kernel.org/r/20221123-rpi-kunit-tests-v3-8-4615a663a84a@cerno.tech Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2022-12-08drm/tests: helpers: Create the device in another functionMaxime Ripard4-26/+73
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 Ripard4-9/+7
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 Ripard4-7/+12
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: Switch to EXPORT_SYMBOL_GPLMaxime Ripard1-1/+1
drm_kunit_device_init() among other things will allocate a device and wrap around root_device_register. This function is exported with EXPORT_SYMBOL_GPL, so we can't really change the license. Fixes: a77a3ffa151b ("drm/tests: helpers: Add missing export") Suggested-by: Javier Martinez Canillas <javierm@redhat.com> Reviewed-by: Maíra Canal <mcanal@igalia.com> Link: https://lore.kernel.org/r/20221123-rpi-kunit-tests-v3-4-4615a663a84a@cerno.tech Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2022-12-08drm/tests: helpers: Document drm_kunit_device_init()Maxime Ripard1-0/+17
Commit 44a3928324e9 ("drm/tests: Add Kunit Helpers") introduced the drm_kunit_device_init() function but didn't document it properly. Add that documentation. Reviewed-by: Maíra Canal <mcanal@igalia.com> Link: https://lore.kernel.org/r/20221123-rpi-kunit-tests-v3-3-4615a663a84a@cerno.tech Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2022-12-08drm/tests: Introduce a config option for the KUnit helpersMaxime Ripard3-2/+11
Driver-specific tests will need access to the helpers without pulling every DRM framework test. Let's create an intermediate Kconfig options for the helpers. Suggested-by: Maíra Canal <mcanal@igalia.com> Reviewed-by: Maíra Canal <mcanal@igalia.com> Link: https://lore.kernel.org/r/20221123-rpi-kunit-tests-v3-2-4615a663a84a@cerno.tech Signed-off-by: Maxime Ripard <maxime@cerno.tech>
2022-12-08drm/tests: helpers: Move the helper header to include/drmMaxime Ripard5-19/+4
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-07drm: panel-orientation-quirks: Add quirk for DynaBook K50Allen Ballway1-7/+13
Like the ASUS T100HAN for which there is already a quirk, the DynaBook K50 has a 800x1280 portrait screen mounted in the tablet part of a landscape oriented 2-in-1. Update the quirk to be more generic and apply to this device. Signed-off-by: Allen Ballway <ballway@chromium.org> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20221130170811.1.Iee9a494547541dade9eeee9521cc8b811e76a8a0@changeid
2022-12-07drm: panel-orientation-quirks: Add quirk for Lenovo Yoga Tab 3 X90FHans de Goede1-0/+13
The Lenovo Yoga Tab 3 X90F has a portrait 1600x2560 LCD used in landscape mode, add a quirk for this. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20221127181539.104223-1-hdegoede@redhat.com