linux-block.git
2 months agodrm/shmem-helper: Use refcount_t for pages_use_count
Dmitry Osipenko [Sat, 22 Mar 2025 21:26:06 +0000 (00:26 +0300)]
drm/shmem-helper: Use refcount_t for pages_use_count

Use atomic refcount_t helper for pages_use_count to optimize pin/unpin
functions by skipping reservation locking while GEM's pin refcount > 1.

Acked-by: Maxime Ripard <mripard@kernel.org>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Suggested-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Thomas Zimmermann <tzimmermann@suse.d>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250322212608.40511-9-dmitry.osipenko@collabora.com
2 months agodrm/shmem-helper: Add and use pages_pin_count
Dmitry Osipenko [Sat, 22 Mar 2025 21:26:05 +0000 (00:26 +0300)]
drm/shmem-helper: Add and use pages_pin_count

Add separate pages_pin_count for tracking of whether drm-shmem pages are
moveable or not. With the addition of memory shrinker support to drm-shmem,
the pages_use_count will no longer determine whether pages are hard-pinned
in memory, but whether pages exist and are soft-pinned (and could be swapped
out). The pages_pin_count > 1 will hard-pin pages in memory.

Acked-by: Maxime Ripard <mripard@kernel.org>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Suggested-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Thomas Zimmermann <tzimmermann@suse.d>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250322212608.40511-8-dmitry.osipenko@collabora.com
2 months agodrm/shmem-helper: Remove obsoleted is_iomem test
Dmitry Osipenko [Sat, 22 Mar 2025 21:26:04 +0000 (00:26 +0300)]
drm/shmem-helper: Remove obsoleted is_iomem test

Everything that uses the mapped buffer should be agnostic to is_iomem.
The only reason for the is_iomem test is that we're setting shmem->vaddr
to the returned map->vaddr. Now that the shmem->vaddr code is gone, remove
the obsoleted is_iomem test to clean up the code.

Acked-by: Maxime Ripard <mripard@kernel.org>
Suggested-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Thomas Zimmermann <tzimmermann@suse.d>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250322212608.40511-7-dmitry.osipenko@collabora.com
2 months agodrm/shmem-helper: Refactor locked/unlocked functions
Dmitry Osipenko [Sat, 22 Mar 2025 21:26:03 +0000 (00:26 +0300)]
drm/shmem-helper: Refactor locked/unlocked functions

Add locked and remove unlocked postfixes from drm-shmem function names,
making names consistent with the drm/gem core code.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Suggested-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Thomas Zimmermann <tzimmermann@suse.d>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250322212608.40511-6-dmitry.osipenko@collabora.com
2 months agodrm/shmem-helper: Make all exported symbols GPL
Dmitry Osipenko [Sat, 22 Mar 2025 21:26:02 +0000 (00:26 +0300)]
drm/shmem-helper: Make all exported symbols GPL

Make all drm-shmem exported symbols GPL to make them consistent with
the rest of drm-shmem symbols.

Acked-by: Maxime Ripard <mripard@kernel.org>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Thomas Zimmermann <tzimmermann@suse.d>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250322212608.40511-5-dmitry.osipenko@collabora.com
2 months agodrm/gem: Document locking rule of vmap and evict callbacks
Dmitry Osipenko [Sat, 22 Mar 2025 21:26:01 +0000 (00:26 +0300)]
drm/gem: Document locking rule of vmap and evict callbacks

The vmap/vunmap/evict GEM callbacks are always invoked with a held GEM's
reservation lock. Document this locking rule for clarity.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Acked-by: Thomas Zimmermann <tzimmermann@suse.d>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250322212608.40511-4-dmitry.osipenko@collabora.com
2 months agodrm/gem: Add _locked postfix to functions that have unlocked counterpart
Dmitry Osipenko [Sat, 22 Mar 2025 21:26:00 +0000 (00:26 +0300)]
drm/gem: Add _locked postfix to functions that have unlocked counterpart

Add _locked postfix to drm_gem functions that have unlocked counterpart
functions to make GEM functions naming more consistent and intuitive in
regards to the locking requirements.

Acked-by: Maxime Ripard <mripard@kernel.org>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Suggested-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Acked-by: Thomas Zimmermann <tzimmermann@suse.d>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250322212608.40511-3-dmitry.osipenko@collabora.com
2 months agodrm/gem: Change locked/unlocked postfix of drm_gem_v/unmap() function names
Dmitry Osipenko [Sat, 22 Mar 2025 21:25:59 +0000 (00:25 +0300)]
drm/gem: Change locked/unlocked postfix of drm_gem_v/unmap() function names

Make drm/gem API function names consistent by having locked function
use the _locked postfix in the name, while the unlocked variants don't
use the _unlocked postfix. Rename drm_gem_v/unmap() function names to
make them consistent with the rest of the API functions.

Acked-by: Maxime Ripard <mripard@kernel.org>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Suggested-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Acked-by: Thomas Zimmermann <tzimmermann@suse.d>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250322212608.40511-2-dmitry.osipenko@collabora.com
2 months agodrm/vc4: hdmi: Add jack detection to HDMI audio driver
David Turner [Mon, 17 Mar 2025 17:12:24 +0000 (17:12 +0000)]
drm/vc4: hdmi: Add jack detection to HDMI audio driver

Add ALSA jack detection to the vc4-hdmi audio driver so userspace knows
when to add/remove HDMI audio devices.

Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
Reviewed-by: Maxime Ripard <mripard@kernel.org>
Signed-off-by: David Turner <david.turner@raspberrypi.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250317-vc4_hotplug-v4-3-2af625629186@raspberrypi.com
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2 months agodrm/vc4: hdmi: Call HDMI hotplug helper on disconnect
Stefan Wahren [Mon, 17 Mar 2025 17:12:23 +0000 (17:12 +0000)]
drm/vc4: hdmi: Call HDMI hotplug helper on disconnect

drm_atomic_helper_connector_hdmi_hotplug() must be called
regardless of the connection status, otherwise the HDMI audio
disconnect event won't be notified.

Fixes: 2ea9ec5d2c20 ("drm/vc4: hdmi: use drm_atomic_helper_connector_hdmi_hotplug()")
Suggested-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
Reviewed-by: Maxime Ripard <mripard@kernel.org>
Signed-off-by: David Turner <david.turner@raspberrypi.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250317-vc4_hotplug-v4-2-2af625629186@raspberrypi.com
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2 months agodrm/display: Update comment on hdmi hotplug helper
David Turner [Mon, 17 Mar 2025 17:12:22 +0000 (17:12 +0000)]
drm/display: Update comment on hdmi hotplug helper

Update the comment on drm_atomic_helper_connector_hdmi_hotplug() to
clarify that it must be called for all status updates.

Signed-off-by: David Turner <david.turner@raspberrypi.com>
Reviewed-by: Maxime Ripard <mripard@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250317-vc4_hotplug-v4-1-2af625629186@raspberrypi.com
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2 months agodrm/display: dp-tunnel: use new DCPD access helpers
Dmitry Baryshkov [Mon, 24 Mar 2025 11:51:24 +0000 (13:51 +0200)]
drm/display: dp-tunnel: use new DCPD access helpers

Switch drm_dp_tunnel.c to use new set of DPCD read / write helpers.

Reviewed-by: Lyude Paul <lyude@redhat.com>
Acked-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20250324-drm-rework-dpcd-access-v4-6-e80ff89593df@oss.qualcomm.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
2 months agodrm/display: dp-mst-topology: use new DCPD access helpers
Dmitry Baryshkov [Mon, 24 Mar 2025 11:51:23 +0000 (13:51 +0200)]
drm/display: dp-mst-topology: use new DCPD access helpers

Switch drm_dp_mst_topology.c to use new set of DPCD read / write helpers.

Reviewed-by: Lyude Paul <lyude@redhat.com>
Acked-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20250324-drm-rework-dpcd-access-v4-5-e80ff89593df@oss.qualcomm.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
2 months agodrm/display: dp-cec: use new DCPD access helpers
Dmitry Baryshkov [Mon, 24 Mar 2025 11:51:22 +0000 (13:51 +0200)]
drm/display: dp-cec: use new DCPD access helpers

Switch drm_dp_cec.c to use new set of DPCD read / write helpers.

Reviewed-by: Lyude Paul <lyude@redhat.com>
Acked-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20250324-drm-rework-dpcd-access-v4-4-e80ff89593df@oss.qualcomm.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
2 months agodrm/display: dp: use new DCPD access helpers
Dmitry Baryshkov [Mon, 24 Mar 2025 11:51:21 +0000 (13:51 +0200)]
drm/display: dp: use new DCPD access helpers

Switch drm_dp_helper.c to use new set of DPCD read / write helpers.

Reviewed-by: Lyude Paul <lyude@redhat.com>
Acked-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20250324-drm-rework-dpcd-access-v4-3-e80ff89593df@oss.qualcomm.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
2 months agodrm/display: dp: change drm_dp_dpcd_read_link_status() return value
Dmitry Baryshkov [Mon, 24 Mar 2025 11:51:20 +0000 (13:51 +0200)]
drm/display: dp: change drm_dp_dpcd_read_link_status() return value

drm_dp_dpcd_read_link_status() follows the "return error code or number
of bytes read" protocol, with the code returning less bytes than
requested in case of some errors. However most of the drivers
interpreted that as "return error code in case of any error". Switch
drm_dp_dpcd_read_link_status() to drm_dp_dpcd_read_data() and make it
follow that protocol too.

Acked-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20250324-drm-rework-dpcd-access-v4-2-e80ff89593df@oss.qualcomm.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
2 months agodrm/display: dp: implement new access helpers
Dmitry Baryshkov [Mon, 24 Mar 2025 11:51:19 +0000 (13:51 +0200)]
drm/display: dp: implement new access helpers

Existing DPCD access functions return an error code or the number of
bytes being read / write in case of partial access. However a lot of
drivers either (incorrectly) ignore partial access or mishandle error
codes. In other cases this results in a boilerplate code which compares
returned value with the size.

Implement new set of DPCD access helpers, which ignore partial access,
always return 0 or an error code.

Suggested-by: Jani Nikula <jani.nikula@linux.intel.com>
Acked-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20250324-drm-rework-dpcd-access-v4-1-e80ff89593df@oss.qualcomm.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
2 months agodrm/ci: arm64.config: mediatek: enable PHY drivers
Vignesh Raman [Fri, 14 Mar 2025 08:58:52 +0000 (14:28 +0530)]
drm/ci: arm64.config: mediatek: enable PHY drivers

The mediatek display driver fails to probe on mt8173-elm-hana and
mt8183-kukui-jacuzzi-juniper-sku16 in v6.14-rc4 due to missing PHY
configurations.

Enable the following PHY drivers for MediaTek platforms:
- CONFIG_PHY_MTK_HDMI=y for HDMI display
- CONFIG_PHY_MTK_MIPI_DSI=y for DSI display

Signed-off-by: Vignesh Raman <vignesh.raman@collabora.com>
Acked-by: Helen Koike <helen.fornazier@gmail.com>
Link: https://lore.kernel.org/r/20250314085858.39328-4-vignesh.raman@collabora.com
2 months agodrm/ci: uprev IGT
Vignesh Raman [Fri, 14 Mar 2025 08:58:51 +0000 (14:28 +0530)]
drm/ci: uprev IGT

Uprev IGT to the latest version and update expectation files.

Signed-off-by: Vignesh Raman <vignesh.raman@collabora.com>
Acked-by: Helen Koike <helen.fornazier@gmail.com>
Link: https://lore.kernel.org/r/20250314085858.39328-3-vignesh.raman@collabora.com
2 months agodrm/ci: uprev mesa
Vignesh Raman [Fri, 14 Mar 2025 08:58:50 +0000 (14:28 +0530)]
drm/ci: uprev mesa

LAVA was recently patched [1] with a fix on how parameters are parsed in
`lava-test-case`, so we don't need to repeat quotes to send the
arguments properly to it. Uprev mesa to fix this issue.

[1] https://gitlab.com/lava/lava/-/commit/18c9cf79

Signed-off-by: Vignesh Raman <vignesh.raman@collabora.com>
Acked-by: Helen Koike <helen.fornazier@gmail.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Link: https://lore.kernel.org/r/20250314085858.39328-2-vignesh.raman@collabora.com
2 months agodrm/panel/synaptics-r63353: Use _multi variants
Anusha Srivatsa [Tue, 18 Mar 2025 14:37:07 +0000 (10:37 -0400)]
drm/panel/synaptics-r63353: Use _multi variants

Move away from using deprecated API and use _multi
variants if available. Use mipi_dsi_msleep()
and mipi_dsi_usleep_range() instead of msleep()
and usleep_range() respectively.

Used Coccinelle to find the _multi variant APIs,
replacing mpi_dsi_msleep() where necessary and for returning
dsi_ctx.accum_err in these functions. Manually handled the
reset step before returning from r63353_panel_activate()

v2: Do not skip the reset in case of error during
panel activate (Dmitry)
- Convert all usleep_range()

v3: mipi_dsi_usleep_range() is to be used only when in
between _multi commands(Doug)
- Check for error once in the end while using _multi
variants (Doug)

v4: Change return type of r63353_panel_deactivate() to void (Doug)

@rule_1@
identifier dsi_var;
identifier r;
identifier func;
type t;
position p;
expression dsi_device;
expression list es;
@@
t func(...) {
...
struct mipi_dsi_device *dsi_var = dsi_device;
+struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi_var };
<+...
(
-r = mipi_dsi_dcs_nop(dsi_var)@p;
+mipi_dsi_dcs_nop_multi(&dsi_ctx);
|
-r = mipi_dsi_dcs_exit_sleep_mode(dsi_var)@p;
+mipi_dsi_dcs_exit_sleep_mode_multi(&dsi_ctx);
|
-r = mipi_dsi_dcs_enter_sleep_mode(dsi_var)@p;
+mipi_dsi_dcs_enter_sleep_mode_multi(&dsi_ctx);
|
-r = mipi_dsi_dcs_write_buffer(dsi_var,es)@p;
+mipi_dsi_dcs_write_buffer_multi(&dsi_ctx,es);
|
-r = mipi_dsi_dcs_set_display_off(dsi_var,es)@p;
+mipi_dsi_dcs_set_display_off_multi(&dsi_ctx,es);
|
-r = mipi_dsi_compression_mode_ext(dsi_var,es)@p;
+mipi_dsi_compression_mode_ext_multi(&dsi_ctx,es);
|
-r = mipi_dsi_compression_mode(dsi_var,es)@p;
+mipi_dsi_compression_mode_multi(&dsi_ctx,es);
|
-r = mipi_dsi_picture_parameter_set(dsi_var,es)@p;
+mipi_dsi_picture_parameter_set_multi(&dsi_ctx,es);
|
-r = mipi_dsi_dcs_set_display_on(dsi_var,es)@p;
+mipi_dsi_dcs_set_display_on_multi(&dsi_ctx,es);
|
-r = mipi_dsi_dcs_set_tear_on(dsi_var)@p;
+mipi_dsi_dcs_set_tear_on_multi(&dsi_ctx);
|
-r = mipi_dsi_turn_on_peripheral(dsi_var)@p;
+mipi_dsi_turn_on_peripheral_multi(&dsi_ctx);
|
-r = mipi_dsi_dcs_soft_reset(dsi_var)@p;
+mipi_dsi_dcs_soft_reset_multi(&dsi_ctx);
|
-r = mipi_dsi_dcs_set_display_brightness(dsi_var,es)@p;
+mipi_dsi_dcs_set_display_brightness_multi(&dsi_ctx,es);
|
-r = mipi_dsi_dcs_set_pixel_format(dsi_var,es)@p;
+mipi_dsi_dcs_set_pixel_format_multi(&dsi_ctx,es);
|
-r = mipi_dsi_dcs_set_column_address(dsi_var,es)@p;
+mipi_dsi_dcs_set_column_address_multi(&dsi_ctx,es);
|
-r = mipi_dsi_dcs_set_page_address(dsi_var,es)@p;
+mipi_dsi_dcs_set_page_address_multi(&dsi_ctx,es);
|
-r = mipi_dsi_dcs_set_tear_scanline(dsi_var,es)@p;
+mipi_dsi_dcs_set_tear_scanline_multi(&dsi_ctx,es);
)
-if(r < 0) {
-...
-}
...+>
}

@rule_2@
identifier dsi_var;
identifier r;
identifier func;
type t;
position p;
expression dsi_device;
expression list es;
@@
t func(...) {
...
struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi_var };
<+...
(
-r = msleep(es)@p;
+r = mipi_dsi_msleep(&dsi_ctx,es);
|
-msleep(es)@p;
+mipi_dsi_msleep(&dsi_ctx,es);
|
-r = usleep_range(es)@p;
+r = mipi_dsi_usleep_range(&dsi_ctx,es);
|
-usleep_range(es)@p;
+mipi_dsi_usleep_range(&dsi_ctx,es);
)
...+>
}

@rule_3@
identifier dsi_var;
identifier func;
type t;
position p;
expression list es;
@@
t func(...) {
...
struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi_var };
...
-return 0;
+return dsi_ctx.accum_err;
}

Cc: Maxime Ripard <mripard@kernel.org>
Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: Tejas Vipin <tejasvipin76@gmail.com>
Cc: Douglas Anderson <dianders@chromium.org>
Cc: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Anusha Srivatsa <asrivats@redhat.com>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250318-synaptic-expt-v1-1-fa3831a7d883@redhat.com
2 months agodrm/panel: novatek-nt36523: transition to mipi_dsi wrapped functions
Tejas Vipin [Sat, 15 Mar 2025 18:25:22 +0000 (23:55 +0530)]
drm/panel: novatek-nt36523: transition to mipi_dsi wrapped functions

Changes the novatek-nt36523 panel to use multi style functions for
improved error handling.

Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Tejas Vipin <tejasvipin76@gmail.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250315182522.628187-1-tejasvipin76@gmail.com
2 months agodrm/panel: samsung-s6d7aa0: transition to mipi_dsi wrapped functions
Tejas Vipin [Wed, 19 Mar 2025 18:31:06 +0000 (00:01 +0530)]
drm/panel: samsung-s6d7aa0: transition to mipi_dsi wrapped functions

Changes the samsung-s6d7aa0 panel to use multi style functions for
improved error handling.

Signed-off-by: Tejas Vipin <tejasvipin76@gmail.com>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
[dianders: fixed whitespace errors]
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250319183106.12613-1-tejasvipin76@gmail.com
2 months agodrm/bridge: ti-sn65dsi86: Check bridge connection failure
Wolfram Sang [Tue, 18 Mar 2025 15:52:56 +0000 (16:52 +0100)]
drm/bridge: ti-sn65dsi86: Check bridge connection failure

Read out and check the ID registers, so we can bail out if I2C
communication does not work or if the device is unknown. Tested on a
Renesas GrayHawk board (R-Car V4M) by using a wrong I2C address and by
not enabling RuntimePM for the device.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250318155549.19625-2-wsa+renesas@sang-engineering.com
2 months agodrm/bridge: ti-sn65dsi86: make use of debugfs_init callback
Wolfram Sang [Sat, 15 Mar 2025 20:15:11 +0000 (21:15 +0100)]
drm/bridge: ti-sn65dsi86: make use of debugfs_init callback

Do not create a custom directory in debugfs-root, but use the
debugfs_init callback to create a custom directory at the given place
for the bridge. The new directory layout looks like this on a Renesas
GrayHawk-Single with a R-Car V4M SoC:

/sys/kernel/debug/dri/feb00000.display/DP-1/1-002c

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250315201651.7339-2-wsa+renesas@sang-engineering.com
2 months agodrm/sched: Add a basic test for checking credit limit
Tvrtko Ursulin [Mon, 24 Mar 2025 09:26:33 +0000 (09:26 +0000)]
drm/sched: Add a basic test for checking credit limit

Add a basic test for checking whether scheduler respects the configured
credit limit.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Danilo Krummrich <dakr@kernel.org>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Philipp Stanner <phasta@kernel.org>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250324092633.49746-7-tvrtko.ursulin@igalia.com
2 months agodrm/sched: Add a basic test for modifying entities scheduler list
Tvrtko Ursulin [Mon, 24 Mar 2025 09:26:32 +0000 (09:26 +0000)]
drm/sched: Add a basic test for modifying entities scheduler list

Add a basic test for exercising modifying the entities scheduler list at
runtime.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Danilo Krummrich <dakr@kernel.org>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Philipp Stanner <phasta@kernel.org>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250324092633.49746-6-tvrtko.ursulin@igalia.com
2 months agodrm/sched: Add basic priority tests
Tvrtko Ursulin [Mon, 24 Mar 2025 09:26:31 +0000 (09:26 +0000)]
drm/sched: Add basic priority tests

Add some basic tests for exercising entity priority handling.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Danilo Krummrich <dakr@kernel.org>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Philipp Stanner <phasta@kernel.org>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250324092633.49746-5-tvrtko.ursulin@igalia.com
2 months agodrm/sched: Add a simple timeout test
Tvrtko Ursulin [Mon, 24 Mar 2025 09:26:30 +0000 (09:26 +0000)]
drm/sched: Add a simple timeout test

Add a very simple timeout test which submits a single job and verifies
that the timeout handling will run if the backend failed to complete the
job in time.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Danilo Krummrich <dakr@kernel.org>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Philipp Stanner <phasta@kernel.org>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250324092633.49746-4-tvrtko.ursulin@igalia.com
2 months agodrm/sched: Add scheduler unit testing infrastructure and some basic tests
Tvrtko Ursulin [Mon, 24 Mar 2025 09:26:29 +0000 (09:26 +0000)]
drm/sched: Add scheduler unit testing infrastructure and some basic tests

Implement a mock scheduler backend and add some basic test to exercise the
core scheduler code paths.

Mock backend (kind of like a very simple mock GPU) can either process jobs
by tests manually advancing the "timeline" job at a time, or alternatively
jobs can be configured with a time duration in which case they get
completed asynchronously from the unit test code.

Core scheduler classes are subclassed to support this mock implementation.

The tests added are just a few simple submission patterns.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Suggested-by: Philipp Stanner <phasta@kernel.org>
Cc: Christian König <christian.koenig@amd.com>
Cc: Danilo Krummrich <dakr@kernel.org>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Philipp Stanner <phasta@kernel.org>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250324092633.49746-3-tvrtko.ursulin@igalia.com
2 months agodrm: Move some options to separate new Kconfig
Tvrtko Ursulin [Mon, 24 Mar 2025 09:26:28 +0000 (09:26 +0000)]
drm: Move some options to separate new Kconfig

Move some options out into a new debug specific kconfig file in order to
make things a bit cleaner.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Danilo Krummrich <dakr@kernel.org>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Philipp Stanner <phasta@kernel.org>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250324092633.49746-2-tvrtko.ursulin@igalia.com
2 months agodrm/probe-helper: Do not fail from drmm_kms_helper_poll_init()
Thomas Zimmermann [Mon, 3 Mar 2025 14:52:58 +0000 (15:52 +0100)]
drm/probe-helper: Do not fail from drmm_kms_helper_poll_init()

Failing to set up connector polling is not significant enough to
fail device probing. Print a warning and return nothing from the
init helper.

This only affects the managed init function. The unmanaged init
already never fails with an error.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250303145604.62962-4-tzimmermann@suse.de
2 months agodrm/udl: Switch poll helpers to managed cleanup
Thomas Zimmermann [Mon, 3 Mar 2025 14:52:57 +0000 (15:52 +0100)]
drm/udl: Switch poll helpers to managed cleanup

Call drmm_kms_helper_poll_init() to set up managed cleanup for
connector polling.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250303145604.62962-3-tzimmermann@suse.de
2 months agodrm/udl: Unregister device before cleaning up on disconnect
Thomas Zimmermann [Mon, 3 Mar 2025 14:52:56 +0000 (15:52 +0100)]
drm/udl: Unregister device before cleaning up on disconnect

Disconnecting a DisplayLink device results in the following kernel
error messages

[   93.041748] [drm:udl_urb_completion [udl]] *ERROR* udl_urb_completion - nonzero write bulk status received: -115
[   93.055299] [drm:udl_submit_urb [udl]] *ERROR* usb_submit_urb error fffffffe
[   93.065363] [drm:udl_urb_completion [udl]] *ERROR* udl_urb_completion - nonzero write bulk status received: -115
[   93.078207] [drm:udl_submit_urb [udl]] *ERROR* usb_submit_urb error fffffffe

coming from KMS poll helpers. Shutting down poll helpers runs them
one final time when the USB device is already gone.

Run drm_dev_unplug() first in udl's USB disconnect handler. Udl's
polling code already handles disconnects gracefully if the device has
been marked as unplugged.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Fixes: b1a981bd5576 ("drm/udl: drop drm_driver.release hook")
Cc: dri-devel@lists.freedesktop.org
Cc: <stable@vger.kernel.org> # v5.8+
Reviewed-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250303145604.62962-2-tzimmermann@suse.de
2 months agodrm/bridge: fsl-ldb: make warning message more informative
Luca Ceresoli [Thu, 6 Mar 2025 17:28:41 +0000 (18:28 +0100)]
drm/bridge: fsl-ldb: make warning message more informative

This warning notifies a clock was set to an inaccurate value. Modify the
string to also show the clock name.

While doing that also rewrap the entire function call.

Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Acked-by: Liu Ying <victor.liu@nxp.com>
Signed-off-by: Liu Ying <victor.liu@nxp.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250306-drm-two-ldb-improvements-v1-2-f139d768b92c@bootlin.com
2 months agodrm/bridge: imx8qxp-ldb: cleanup return value
Luca Ceresoli [Thu, 6 Mar 2025 17:28:40 +0000 (18:28 +0100)]
drm/bridge: imx8qxp-ldb: cleanup return value

'ret' can only be 0 at this point, being preceded by a 'if (ret) return
ret;'. So return 0 for clarity.

Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Reviewed-by: Liu Ying <victor.liu@nxp.com>
Signed-off-by: Liu Ying <victor.liu@nxp.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250306-drm-two-ldb-improvements-v1-1-f139d768b92c@bootlin.com
2 months agodrm/v3d: Use V3D_SMS registers for power on/off and reset on V3D 7.x
Maíra Canal [Tue, 18 Mar 2025 01:01:13 +0000 (22:01 -0300)]
drm/v3d: Use V3D_SMS registers for power on/off and reset on V3D 7.x

In addition to the standard reset controller, V3D 7.x requires configuring
the V3D_SMS registers for proper power on/off and reset. Add the new
registers to `v3d_regs.h` and ensure they are properly configured during
device probing, removal, and reset.

This change fixes GPU reset issues on the Raspberry Pi 5 (BCM2712).
Without exposing these registers, a GPU reset causes the GPU to hang,
stopping any further job execution and freezing the desktop GUI. The same
issue occurs when unloading and loading the v3d driver.

Link: https://github.com/raspberrypi/linux/issues/6660
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Signed-off-by: Maíra Canal <mcanal@igalia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250317-v3d-gpu-reset-fixes-v6-5-f3ee7717ed17@igalia.com
2 months agodt-bindings: gpu: v3d: Add V3D driver maintainer as DT maintainer
Maíra Canal [Tue, 18 Mar 2025 01:01:12 +0000 (22:01 -0300)]
dt-bindings: gpu: v3d: Add V3D driver maintainer as DT maintainer

As established in commit 89d04995f76c ("MAINTAINERS: Drop Emma Anholt
from all M lines."), Emma is no longer active in the Linux kernel and
dropped the V3D maintainership. Therefore, remove Emma as one of the DT
maintainers and add the current V3D driver maintainer.

Acked-by: Emma Anholt <emma@anholt.net>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Maíra Canal <mcanal@igalia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250317-v3d-gpu-reset-fixes-v6-4-f3ee7717ed17@igalia.com
2 months agodt-bindings: gpu: v3d: Add SMS register to BCM2712 compatible
Maíra Canal [Tue, 18 Mar 2025 01:01:11 +0000 (22:01 -0300)]
dt-bindings: gpu: v3d: Add SMS register to BCM2712 compatible

V3D 7.1 exposes a new register block, called V3D_SMS. As BCM2712 has a
V3D 7.1 core, add a new register item to its compatible. Similar to the
GCA, which is specific for V3D 3.3, SMS should only be added for V3D 7.1
variants (such as brcm,2712-v3d).

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Maíra Canal <mcanal@igalia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250317-v3d-gpu-reset-fixes-v6-3-f3ee7717ed17@igalia.com
2 months agodt-bindings: gpu: v3d: Add per-compatible register restrictions
Maíra Canal [Tue, 18 Mar 2025 01:01:10 +0000 (22:01 -0300)]
dt-bindings: gpu: v3d: Add per-compatible register restrictions

In order to enforce per-SoC register rules, add per-compatible
restrictions. For example, V3D 3.3 (used in brcm,7268-v3d) has a cache
controller (GCA), which is not present in other V3D generations. Declaring
these differences helps ensure the DTB accurately reflect the hardware
design.

The example was using an incorrect order for the register names. This
commit corrects that by enforcing the order established in the register
items description.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Maíra Canal <mcanal@igalia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250317-v3d-gpu-reset-fixes-v6-2-f3ee7717ed17@igalia.com
2 months agodrm/v3d: Associate a V3D tech revision to all supported devices
Maíra Canal [Tue, 18 Mar 2025 01:01:09 +0000 (22:01 -0300)]
drm/v3d: Associate a V3D tech revision to all supported devices

The V3D driver currently determines the GPU tech version (33, 41...)
by reading a register. This approach has worked so far since this
information wasn’t needed before powering on the GPU.

V3D 7.1 introduces new registers that must be written to power on the
GPU, requiring us to know the V3D version beforehand. To address this,
associate each supported SoC with the corresponding VideoCore GPU version
as part of the device data.

To prevent possible mistakes, add an assertion to verify that the version
specified in the device data matches the one reported by the hardware.
If there is a mismatch, the kernel will trigger a warning.

With the goal of maintaining consistency around the driver, use `enum
v3d_gen` to assign values to `v3d->ver` and for comparisons with other
V3D generations. Note that all mentions of unsupported or non-existing V3D
generations (such as V3D 4.0) were removed by this commit and replaced
with supported generations without functional changes.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Stefan Wahren <wahrenst@gmx.net>
Signed-off-by: Maíra Canal <mcanal@igalia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250317-v3d-gpu-reset-fixes-v6-1-f3ee7717ed17@igalia.com
3 months agodrm/bridge: ti-sn65dsi86: Remove drm_encoder->crtc use
Maxime Ripard [Thu, 13 Mar 2025 12:00:10 +0000 (13:00 +0100)]
drm/bridge: ti-sn65dsi86: Remove drm_encoder->crtc use

The TI sn65dsi86 driver follows the drm_encoder->crtc pointer that is
deprecated and shouldn't be used by atomic drivers.

Fortunately, the atomic hooks provide the drm_atomic_state and we can
access our current CRTC from that, going from the bridge to its encoder,
to its connector, and to its CRTC.

This bridge driver uses the atomic hooks already, but dereferences the
drm_encoder->crtc pointer in functions that don't have access to it.

Let's rework the driver to pass the state where needed, and remove the
need for the drm_encoder->crtc dereference.

Reviewed-by: Douglas Anderson <dianders@chromium.org>
Tested-by: Douglas Anderson <dianders@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250313-bridge-connector-v6-16-511c54a604fb@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
3 months agodrm/bridge: tc358768: Convert to atomic helpers
Maxime Ripard [Thu, 13 Mar 2025 12:00:09 +0000 (13:00 +0100)]
drm/bridge: tc358768: Convert to atomic helpers

The tc358768 driver follows the drm_encoder->crtc pointer that is
deprecated and shouldn't be used by atomic drivers.

Fortunately, the atomic hooks provide the drm_atomic_state and we can
access our current CRTC from that, going from the bridge to its encoder,
to its connector, and to its CRTC.

Let's convert this bridge driver to atomic so we can get rid of the
drm_encoder->crtc dereference.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250313-bridge-connector-v6-15-511c54a604fb@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
3 months agodrm/bridge: tc358768: Stop disabling when failing to enable
Maxime Ripard [Thu, 13 Mar 2025 12:00:08 +0000 (13:00 +0100)]
drm/bridge: tc358768: Stop disabling when failing to enable

The tc358768 bridge driver, if enabling it fails, tries to disable it.
This is pretty uncommon in bridge drivers, and also stands in the way
for further reworks.

Worse, since pre_enable and enable aren't expected to fail, disable and
post_disable might be called twice: once to handle the failure, and once
to actually disable the bridge.

Since post_disable uses regulators and clocks, this would lead to enable
count imbalances.

In order to prevent that imbalance, and to allow further reworks, let's
drop the calls to disable and post_disable, but keep the warning to let
users know about what's going on.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250313-bridge-connector-v6-14-511c54a604fb@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
3 months agodrm/bridge: tc358775: Switch to atomic commit
Maxime Ripard [Thu, 13 Mar 2025 12:00:07 +0000 (13:00 +0100)]
drm/bridge: tc358775: Switch to atomic commit

The tc358775 driver follows the drm_encoder->crtc pointer that is
deprecated and shouldn't be used by atomic drivers.

Fortunately, the atomic hooks provide the drm_atomic_state and we can
access our current CRTC from that, going from the bridge to its encoder,
to its connector, and to its CRTC.

Let's convert this bridge driver to atomic so we can get rid of the
drm_encoder->crtc dereference.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250313-bridge-connector-v6-13-511c54a604fb@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
3 months agodrm/bridge: cdns-csi: Switch to atomic helpers
Maxime Ripard [Thu, 13 Mar 2025 12:00:06 +0000 (13:00 +0100)]
drm/bridge: cdns-csi: Switch to atomic helpers

The Cadence DSI driver follows the drm_encoder->crtc pointer that is
deprecated and shouldn't be used by atomic drivers.

Fortunately, the atomic hooks provide the drm_atomic_state and we can
access our current CRTC from that, going from the bridge to its encoder,
to its connector, and to its CRTC.

Let's convert this bridge driver to atomic so we can get rid of the
drm_encoder->crtc dereference.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250313-bridge-connector-v6-12-511c54a604fb@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
3 months agodrm/bridge: Introduce drm_bridge_is_atomic() helper
Maxime Ripard [Thu, 13 Mar 2025 12:00:05 +0000 (13:00 +0100)]
drm/bridge: Introduce drm_bridge_is_atomic() helper

We test for whether the bridge is atomic in several places in the source
code, so let's consolidate them.

Suggested-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250313-bridge-connector-v6-11-511c54a604fb@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
3 months agodrm/bridge: ti-sn65dsi83: Switch to drm_bridge_helper_reset_crtc
Maxime Ripard [Thu, 13 Mar 2025 12:00:04 +0000 (13:00 +0100)]
drm/bridge: ti-sn65dsi83: Switch to drm_bridge_helper_reset_crtc

Now that we have a helper for bridge drivers to call to reset the output
pipeline, let's use it.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Herve Codina <herve.codina@bootlin.com>
Tested-by: Herve Codina <herve.codina@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250313-bridge-connector-v6-10-511c54a604fb@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
3 months agodrm/tests: bridge: Provide tests for drm_bridge_helper_reset_crtc
Maxime Ripard [Thu, 13 Mar 2025 12:00:03 +0000 (13:00 +0100)]
drm/tests: bridge: Provide tests for drm_bridge_helper_reset_crtc

Let's provide a bunch of kunit tests to make sure
drm_bridge_helper_reset_crtc() works as expected.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250313-bridge-connector-v6-9-511c54a604fb@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
3 months agodrm/bridge: Add helper to reset bridge pipeline
Maxime Ripard [Thu, 13 Mar 2025 12:00:02 +0000 (13:00 +0100)]
drm/bridge: Add helper to reset bridge pipeline

Let's provide an helper to make it easier for bridge drivers to
power-cycle their bridge.

In order to avoid a circular dependency between that new helper and
drm_atomic_helper_reset_crtc(), this new helper will be in a
drm_bridge_helper.c file to follow the pattern we have for other
objects.

Reviewed-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Simona Vetter <simona.vetter@ffwll.ch>
Tested-by: Herve Codina <herve.codina@bootlin.com>
Co-developed-by: Simona Vetter <simona.vetter@intel.com>
Signed-off-by: Simona Vetter <simona.vetter@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250313-bridge-connector-v6-8-511c54a604fb@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
3 months agodrm/tests: Create tests for drm_atomic
Maxime Ripard [Thu, 13 Mar 2025 12:00:01 +0000 (13:00 +0100)]
drm/tests: Create tests for drm_atomic

We don't have a set of kunit tests for the functions under drm_atomic.h.
Let's use the introduction of drm_atomic_get_connector_for_encoder() to
create some tests for it and thus create that set.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250313-bridge-connector-v6-7-511c54a604fb@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
3 months agodrm/tests: hdmi_state_helpers: Switch to new helper
Maxime Ripard [Thu, 13 Mar 2025 12:00:00 +0000 (13:00 +0100)]
drm/tests: hdmi_state_helpers: Switch to new helper

We introduced a new helper that supersedes the light_up_connector()
function in drm_hdmi_state_helper_test, so let's convert all our tests
to it.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250313-bridge-connector-v6-6-511c54a604fb@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
3 months agodrm/tests: helpers: Create new helper to enable output
Maxime Ripard [Thu, 13 Mar 2025 11:59:59 +0000 (12:59 +0100)]
drm/tests: helpers: Create new helper to enable output

We'll need the HDMI state tests light_up_connector() function in more
tests, so let's promote it to a helper.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250313-bridge-connector-v6-5-511c54a604fb@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
3 months agodrm/atomic: Introduce helper to lookup connector by encoder
Maxime Ripard [Thu, 13 Mar 2025 11:59:58 +0000 (12:59 +0100)]
drm/atomic: Introduce helper to lookup connector by encoder

With the bridges switching over to drm_bridge_connector, the direct
association between a bridge driver and its connector was lost.

This is mitigated for atomic bridge drivers by the fact you can access
the encoder, and then call drm_atomic_get_old_connector_for_encoder() or
drm_atomic_get_new_connector_for_encoder() with drm_atomic_state.

This was also made easier by providing drm_atomic_state directly to all
atomic hooks bridges can implement.

However, bridge drivers don't have a way to access drm_atomic_state
outside of the modeset path, like from the hotplug interrupt path or any
interrupt handler.

Let's introduce a function to retrieve the connector currently assigned
to an encoder, without using drm_atomic_state, to make these drivers'
life easier.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Simona Vetter <simona.vetter@ffwll.ch>
Tested-by: Herve Codina <herve.codina@bootlin.com>
Co-developed-by: Simona Vetter <simona.vetter@intel.com>
Signed-off-by: Simona Vetter <simona.vetter@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250313-bridge-connector-v6-4-511c54a604fb@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
3 months agodrm/tests: Add kunit tests for bridges
Maxime Ripard [Thu, 13 Mar 2025 11:59:57 +0000 (12:59 +0100)]
drm/tests: Add kunit tests for bridges

None of the drm_bridge function have kunit tests so far. Let's change
that, starting with drm_bridge_get_current_state().

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250313-bridge-connector-v6-3-511c54a604fb@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
3 months agodrm/bridge: Provide a helper to retrieve current bridge state
Maxime Ripard [Thu, 13 Mar 2025 11:59:56 +0000 (12:59 +0100)]
drm/bridge: Provide a helper to retrieve current bridge state

The current bridge state is accessible from the drm_bridge structure,
but since it's fairly indirect it's not easy to figure out.

Provide a helper to retrieve it.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250313-bridge-connector-v6-2-511c54a604fb@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
3 months agodrm/bridge: Add encoder parameter to drm_bridge_funcs.attach
Maxime Ripard [Thu, 13 Mar 2025 11:59:55 +0000 (12:59 +0100)]
drm/bridge: Add encoder parameter to drm_bridge_funcs.attach

The drm_bridge structure contains an encoder pointer that is widely used
by bridge drivers. This pattern is largely documented as deprecated in
other KMS entities for atomic drivers.

However, one of the main use of that pointer is done in attach to just
call drm_bridge_attach on the next bridge to add it to the bridge list.
While this dereferences the bridge->encoder pointer, it's effectively
the same encoder the bridge was being attached to.

We can make it more explicit by adding the encoder the bridge is
attached to to the list of attach parameters. This also removes the need
to dereference bridge->encoder in most drivers.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Tested-by: Douglas Anderson <dianders@chromium.org>
Tested-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250313-bridge-connector-v6-1-511c54a604fb@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
3 months agoMAINTAINERS: update Microchip's Atmel-HLCDC driver maintainers
Manikandan Muralidharan [Thu, 20 Jun 2024 09:58:56 +0000 (15:28 +0530)]
MAINTAINERS: update Microchip's Atmel-HLCDC driver maintainers

Drop Sam Ravnborg and Boris Brezillon as they are no longer interested in
maintaining the drivers. Add myself and Dharma Balasubiramani as the
Maintainer and co-maintainer for Microchip's Atmel-HLCDC driver.
Thanks for their work.

Signed-off-by: Manikandan Muralidharan <manikandan.m@microchip.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240620095856.777390-1-manikandan.m@microchip.com
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
3 months agoDocumentation: vgaarbiter: Fix grammar
Pranav Tyagi [Tue, 18 Mar 2025 04:12:50 +0000 (11:12 +0700)]
Documentation: vgaarbiter: Fix grammar

Correct grammar issues:

- Fix "co-exist" subject-verb agreement
- Correct plural form of "server" in context of more than one legacy
  devices
- Use passive mood for intro sentence of libpciaccess section

Signed-off-by: Pranav Tyagi <pranav.tyagi03@gmail.com>
Reviewed-by: Bagas Sanjaya <bagasdotme@gmail.com>
Link: https://lore.kernel.org/r/20250220164946.18007-1-pranav.tyagi03@gmail.com
[Bagas: massage commit message]
Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250318041249.20786-2-bagasdotme@gmail.com
Signed-off-by: Maxime Ripard <mripard@kernel.org>
3 months agodrm/vmwgfx: Switch to exclusively using GEM references
Ian Forbes [Fri, 31 Jan 2025 20:03:21 +0000 (14:03 -0600)]
drm/vmwgfx: Switch to exclusively using GEM references

Currently we use a combination of TTM and GEM reference counting which is
cumbersome. TTM references are used for kernel internal BOs and operations
like validation. Simply switching the ttm_bo_(get|put) calls to their
GEM equivalents is insufficient as not all BOs are GEM BOs so we must set
the GEM vtable for all BOs even if they are not exposed to userspace.

Suggested-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Ian Forbes <ian.forbes@broadcom.com>
Reviewed-by: Zack Rusin <zack.rusin@broadcom.com>
Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250131200321.193939-1-ian.forbes@broadcom.com
3 months agodrm/vmwgfx: Fix dumb buffer leak
Ian Forbes [Thu, 23 Jan 2025 20:44:24 +0000 (14:44 -0600)]
drm/vmwgfx: Fix dumb buffer leak

Dumb buffers were not being freed because the GEM reference that was
acquired in gb_surface_define was not dropped like it is in the 2D case.
Dropping this ref uncovered a few additional issues with freeing the
resources associated with dirty tracking in vmw_bo_free/release.

Additionally the TTM object associated with the surface were also leaking
which meant that when the ttm_object_file was closed at process exit the
destructor unreferenced an already destroyed surface.

The solution is to remove the destructor from the vmw_user_surface
associated with the dumb_buffer and immediately unreferencing the TTM
object which his removes it from the ttm_object_file.

This also allows the early return in vmw_user_surface_base_release for the
dumb buffer case to be removed as it should no longer occur.

The chain of references now has the GEM handle(s) owning the dumb buffer.
The GEM handles have a singular GEM reference to the vmw_bo which is
dropped when all handles are closed. When the GEM reference count hits
zero the vmw_bo is freed which then unreferences the surface via
vmw_resource_release in vmw_bo_release.

Fixes: d6667f0ddf46 ("drm/vmwgfx: Fix handling of dumb buffers")
Signed-off-by: Ian Forbes <ian.forbes@broadcom.com>
Reviewed-by: Zack Rusin <zack.rusin@broadcom.com>
Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250123204424.836896-1-ian.forbes@broadcom.com
3 months agodrm: panel-orientation-quirks: Add ZOTAC Gaming Zone
Vicki Pfau [Thu, 13 Mar 2025 21:16:44 +0000 (14:16 -0700)]
drm: panel-orientation-quirks: Add ZOTAC Gaming Zone

Add a panel orientation quirk for the ZOTAC Gaming Zone handheld gaming device.

Signed-off-by: Vicki Pfau <vi@endrift.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250313211643.860786-2-vi@endrift.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
3 months agoaccel/qaic: Remove redundant 'flush_workqueue()' calls
Chen Ni [Wed, 12 Mar 2025 07:34:04 +0000 (15:34 +0800)]
accel/qaic: Remove redundant 'flush_workqueue()' calls

'destroy_workqueue()' already drains the queue before destroying it, so
there is no need to flush it explicitly.

Remove the redundant 'flush_workqueue()' calls.

This was generated with coccinelle:

@@
expression E;
@@
- flush_workqueue(E);
  destroy_workqueue(E);

Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Reviewed-by: Jeff Hugo <jeff.hugo@oss.qualcomm.com>
Signed-off-by: Jeff Hugo <jeff.hugo@oss.qualcomm.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250312073404.1429992-1-nichen@iscas.ac.cn
3 months agodrm: add modifiers for Apple GPU layouts
Alyssa Rosenzweig [Mon, 10 Mar 2025 19:28:02 +0000 (15:28 -0400)]
drm: add modifiers for Apple GPU layouts

Apple GPUs support non-linear "GPU-tiled" image layouts. Add modifiers
for these layouts. Mesa requires these modifiers to share non-linear
buffers across processes, but no other userspace or kernel support is
required/expected.

These layouts are notably not used for interchange across hardware
blocks (e.g. with the display controller). There are other layouts for
that but we don't support them either in userspace or kernelspace yet
(even downstream), so we don't add modifiers here.

Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Sven Peter <sven@svenpeter.dev>
Link: https://patchwork.freedesktop.org/patch/msgid/20250310-apple-twiddled-modifiers-v4-1-1ccac9544808@rosenzweig.io
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
3 months agodrm/sched: Clarify docu concerning drm_sched_job_arm()
Philipp Stanner [Thu, 13 Mar 2025 09:30:54 +0000 (10:30 +0100)]
drm/sched: Clarify docu concerning drm_sched_job_arm()

The documentation for drm_sched_job_arm() and especially
drm_sched_job_cleanup() does not make it very clear why
drm_sched_job_arm() is a point of no return, which it indeed is.

Make the nature of drm_sched_job_arm() in the docu as clear as possible.

Suggested-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250313093053.65001-2-phasta@kernel.org
3 months agodrm/display: hdmi: Mention Infoframes testing with edid-decode
Maxime Ripard [Wed, 12 Mar 2025 13:39:17 +0000 (14:39 +0100)]
drm/display: hdmi: Mention Infoframes testing with edid-decode

edid-decode gained recently support to check that infoframes are
compliant and match the EDID the monitor exposes.

Since the HDMI helpers provide those infoframes in debugfs, it makes it
easy to check from userspace that the drivers (and helpers) behave
properly.

Let's document it.

Cc: Hans Verkuil <hverkuil@xs4all.nl>
Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl>
Link: https://patchwork.freedesktop.org/patch/msgid/20250312-drm-hdmi-state-docs-v2-2-6352a5d68d5b@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
3 months agodrm/display: hdmi: Create documentation section
Maxime Ripard [Wed, 12 Mar 2025 13:39:16 +0000 (14:39 +0100)]
drm/display: hdmi: Create documentation section

We have had documentation for the public functions in the HDMI helpers,
but those were never referenced anywhere and thus not compiled as part
of the doc.

Let's add a section.

Reviewed-by: Dmitry Baryshkov <lumag@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250312-drm-hdmi-state-docs-v2-1-6352a5d68d5b@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
3 months agodrm/ttm/tests: fix incorrect assert in ttm_bo_unreserve_bulk()
Qasim Ijaz [Thu, 13 Mar 2025 16:14:24 +0000 (16:14 +0000)]
drm/ttm/tests: fix incorrect assert in ttm_bo_unreserve_bulk()

In the ttm_bo_unreserve_bulk() test function, resv is allocated using
kunit_kzalloc(), but the subsequent assertion mistakenly verifies the
ttm_dev pointer instead of the resv pointer.

Fix the assertion to properly verify the resv pointer.

Signed-off-by: Qasim Ijaz <qasdev00@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250313161424.10688-1-qasdev00@gmail.com
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
3 months agodrm/client: s/unsigned int i/int i/
Ville Syrjälä [Fri, 28 Feb 2025 21:14:54 +0000 (23:14 +0200)]
drm/client: s/unsigned int i/int i/

Replace the 'unsigned int i' footguns with plain old signed
int. Avoids accidents if/when someone decides they need
to iterate backwards.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250228211454.8138-9-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
3 months agodrm/client: Move variables to tighter scope
Ville Syrjälä [Fri, 28 Feb 2025 21:14:53 +0000 (23:14 +0200)]
drm/client: Move variables to tighter scope

Bunch of variables are only needed inside loops and whatnot.
Move them to a tighter scope to make the code less confusing.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250228211454.8138-8-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
3 months agodrm/client: s/new_crtc/crtc/
Ville Syrjälä [Fri, 28 Feb 2025 21:14:52 +0000 (23:14 +0200)]
drm/client: s/new_crtc/crtc/

Rename the 'new_crtc' variable to just 'crtc' in
drm_client_firmware_config(). We don't call any of the other
stuff in here new or old so this feels out of place.

v2: Rebase

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250228211454.8138-7-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
3 months agodrm/client: Stop using the legacy crtc->mode
Ville Syrjälä [Fri, 28 Feb 2025 21:14:51 +0000 (23:14 +0200)]
drm/client: Stop using the legacy crtc->mode

crtc->mode is legacy junk and shouldn't really be used with
atomic drivers.

Most (all?) atomic drivers do end up still calling
drm_atomic_helper_update_legacy_modeset_state() at some
point, so crtc->mode does still get populated, and this
does work for now. But now that the modes[] lifetime issues
have been sorted out we can just switch over to the
proper crtc->state->mode.

v2: Rebase

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250228211454.8138-6-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
3 months agodrm/client: Make copies of modes
Ville Syrjälä [Fri, 28 Feb 2025 21:14:50 +0000 (23:14 +0200)]
drm/client: Make copies of modes

drm_client_firmware_config() is currently picking up the current
mode of the crtc via the legacy crtc->mode, which is not supposed
to be used by atomic drivers at all. We can't simply switch over
to the proper crtc->state->mode because we drop the crtc->mutex
(which protects crtc->state) before the mode gets used.

The most straightforward solution to extend the lifetime of
modes[] seem to be to make full copies of the modes.

And with this we can undo also commit 3eadd887dbac
("drm/client:Fully protect modes[] with dev->mode_config.mutex")
as the lifetime of modes[] no longer has anything to do with
that lock.

v2: Don't try to copy NULL modes
v3: Keep storing pointers and use drm_mode_{duplicate,destroy}()

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250228211454.8138-5-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
3 months agodrm/client: Streamline mode selection debugs
Ville Syrjälä [Fri, 28 Feb 2025 21:14:49 +0000 (23:14 +0200)]
drm/client: Streamline mode selection debugs

Get rid of all the redundant debugs and just wait until the end
to print which mode (and of which type) we picked.

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250228211454.8138-4-ville.syrjala@linux.intel.com
3 months agodrm/client: Use array notation for function arguments
Ville Syrjälä [Fri, 28 Feb 2025 21:14:48 +0000 (23:14 +0200)]
drm/client: Use array notation for function arguments

Use the array notation rather that the pointer notation for
function arguments. This makes it clear to the reader that
we are in fact dealing with an array rather than a single
pointer. Functionally the two are equivalent.

Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250228211454.8138-3-ville.syrjala@linux.intel.com
3 months agodrm/client: Constify modes
Ville Syrjälä [Mon, 3 Mar 2025 09:38:47 +0000 (11:38 +0200)]
drm/client: Constify modes

The modes used by the client code live on the connectors' mode
lists, which are not owned by the client code, and thus it has
no business modifying the modes. Mark the modes const to make
that fact abundantly clear.

v2: Fix up the kunit test

Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250303093847.7698-1-ville.syrjala@linux.intel.com
3 months agodrm/ci: fix merge request rules
Vignesh Raman [Fri, 28 Feb 2025 13:26:18 +0000 (18:56 +0530)]
drm/ci: fix merge request rules

Merge request pipelines were only created when changes
were made to drivers/gpu/drm/ci/, causing MRs that
didn't touch this path to break. Fix MR pipeline rules
to trigger jobs for all changes.

Run jobs automatically for marge-bot and scheduled
pipelines, but in all other cases run manually. Also
remove CI_PROJECT_NAMESPACE checks specific to mesa.

Fixes: df54f04f2020 ("drm/ci: update gitlab rules")
Signed-off-by: Vignesh Raman <vignesh.raman@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Helen Koike <helen.fornazier@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250228132620.556079-1-vignesh.raman@collabora.com
3 months agodrm: xlnx: zynqmp_dpsub: fix Kconfig dependencies for ASoC
Arnd Bergmann [Thu, 27 Feb 2025 13:20:32 +0000 (14:20 +0100)]
drm: xlnx: zynqmp_dpsub: fix Kconfig dependencies for ASoC

The new audio code fails to build when sounds support is in a loadable
module but the GPU driver is built-in:

x86_64-linux-ld: zynqmp_dp_audio.c:(.text+0x6a8): undefined reference to `devm_snd_soc_register_card'
x86_64-linux-ld: drivers/gpu/drm/xlnx/zynqmp_dp_audio.o:(.rodata+0x1bc): undefined reference to `snd_soc_info_volsw'
x86_64-linux-ld: drivers/gpu/drm/xlnx/zynqmp_dp_audio.o:(.rodata+0x1f0): undefined reference to `snd_soc_get_volsw'
x86_64-linux-ld: drivers/gpu/drm/xlnx/zynqmp_dp_audio.o:(.rodata+0x1f4): undefined reference to `snd_soc_put_volsw'

Change the Kconfig dependency to disallow the sound support in this
configuration.

Fixes: 3ec5c1579305 ("drm: xlnx: zynqmp_dpsub: Add DP audio support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250227132036.1136600-1-arnd@kernel.org
3 months agodrm/sched: revert "drm_sched_job_cleanup(): correct false doc"
Christian König [Wed, 12 Mar 2025 13:44:00 +0000 (14:44 +0100)]
drm/sched: revert "drm_sched_job_cleanup(): correct false doc"

This reverts commit 44d2f310f008613c1dbe5e234c2cf2be90cbbfab.

The function drm_sched_job_arm() is indeed the point of no return. The
background is that it is nearly impossible for the driver to correctly
retract the fence and signal it in the order enforced by the dma_fence
framework.

The code in drm_sched_job_cleanup() is for the purpose to cleanup after
the job was armed through drm_sched_job_arm() *and* processed by the
scheduler.

We can certainly improve the documentation, but removing the warning is
clearly not a good idea.

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250312134400.2176393-1-christian.koenig@amd.com
3 months agodrm/debugfs: add top-level 'bridges' file showing all added bridges
Luca Ceresoli [Wed, 26 Feb 2025 21:23:53 +0000 (22:23 +0100)]
drm/debugfs: add top-level 'bridges' file showing all added bridges

The global bridges_list holding all the bridges between drm_bridge_add()
and drm_bridge_remove() cannot be inspected via debugfs. Add a file showing
it.

To avoid code duplication, move the code printing a bridge info to a common
function.

Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250226-drm-debugfs-show-all-bridges-v8-2-bb511cc49d83@bootlin.com
Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com>
3 months agodrm/bridge: move bridges_show logic from drm_debugfs.c
Luca Ceresoli [Wed, 26 Feb 2025 21:23:52 +0000 (22:23 +0100)]
drm/bridge: move bridges_show logic from drm_debugfs.c

In preparation to expose more info about bridges in debugfs, which will
require more insight into drm_bridge data structures, move the bridges_show
code to drm_bridge.c.

Suggested-by: Jani Nikula <jani.nikula@linux.intel.com>
Suggested-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250226-drm-debugfs-show-all-bridges-v8-1-bb511cc49d83@bootlin.com
Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com>
3 months agodrm/panel: simple: Add POWERTIP PH128800T004-ZZA01 panel entry
Antonin Godard [Tue, 11 Mar 2025 16:40:06 +0000 (17:40 +0100)]
drm/panel: simple: Add POWERTIP PH128800T004-ZZA01 panel entry

Add support for the POWERTIP PH128800T004-ZZA01 10.1" (1280x800)
LCD-TFT panel. Its panel description is very much like the POWERTIP
PH128800T006-ZHC01 configured below this one, only its timings are
different.

Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
Reviewed-by: Dmitry Baryshkov <lumag@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250311-add-powertip-ph128800t004-v1-2-7f95e6984cea@bootlin.com
Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com>
3 months agodt-bindings: display: simple: Add POWERTIP PH128800T004-ZZA01 panel
Antonin Godard [Tue, 11 Mar 2025 16:40:05 +0000 (17:40 +0100)]
dt-bindings: display: simple: Add POWERTIP PH128800T004-ZZA01 panel

Add POWERTIP PH128800T004-ZZA01 10.1" LCD-TFT LVDS panel compatible
string.

Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
Acked-by: "Rob Herring (Arm)" <robh@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250311-add-powertip-ph128800t004-v1-1-7f95e6984cea@bootlin.com
Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com>
3 months agodrm/mxsfb: Remove generic DRM drivers in probe function
Dario Binacchi [Wed, 5 Mar 2025 14:09:16 +0000 (15:09 +0100)]
drm/mxsfb: Remove generic DRM drivers in probe function

Use aperture helpers to remove all generic graphics drivers before
loading mxsfb. Makes mxsfb compatible with simpledrm.

Co-developed-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20250305140929.174398-1-dario.binacchi@amarulasolutions.com
3 months agodrm/udl: Set struct drm_device.dma_dev
Thomas Zimmermann [Fri, 7 Mar 2025 08:04:03 +0000 (09:04 +0100)]
drm/udl: Set struct drm_device.dma_dev

Set the dma_dev field provided by the DRM device. Required for PRIME
dma-buf import. Remove the driver's implementation.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250307080836.42848-6-tzimmermann@suse.de
3 months agodrm/gud: Set struct drm_device.dma_dev
Thomas Zimmermann [Fri, 7 Mar 2025 08:04:02 +0000 (09:04 +0100)]
drm/gud: Set struct drm_device.dma_dev

Set the dma_dev field provided by the DRM device. Required for PRIME
dma-buf import. Remove the driver's implementation.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250307080836.42848-5-tzimmermann@suse.de
3 months agodrm/gm12u320: Set struct drm_device.dma_dev
Thomas Zimmermann [Fri, 7 Mar 2025 08:04:01 +0000 (09:04 +0100)]
drm/gm12u320: Set struct drm_device.dma_dev

Set the dma_dev field provided by the DRM device. Required for PRIME
dma-buf import. Remove the driver's implementation.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250307080836.42848-4-tzimmermann@suse.de
3 months agodrm/appletbdrm: Set struct drm_device.dma_dev
Thomas Zimmermann [Fri, 7 Mar 2025 08:04:00 +0000 (09:04 +0100)]
drm/appletbdrm: Set struct drm_device.dma_dev

Set the dma_dev field provided by the DRM device. Required for PRIME
dma-buf import. Remove the driver's implementation.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Tested-by: Aditya Garg <gargaditya08@live.com>
Reviewed-by: Aditya Garg <gargaditya08@live.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250307080836.42848-3-tzimmermann@suse.de
3 months agodrm/prime: Support dedicated DMA device for dma-buf imports
Thomas Zimmermann [Fri, 7 Mar 2025 08:03:59 +0000 (09:03 +0100)]
drm/prime: Support dedicated DMA device for dma-buf imports

Importing dma-bufs via PRIME requires a DMA-capable device. Devices on
peripheral busses, such as USB, often cannot perform DMA by themselves.
Without DMA-capable device PRIME import fails. DRM drivers for USB
devices already use a separate DMA device for dma-buf imports. Make the
mechanism generally available.

Besides the case of USB, there are embedded DRM devices without DMA
capability. DMA is performed by a separate controller. DRM drivers should
set this accordingly.

Add the field dma_dev to struct drm_device to refer to the device's DMA
device. For USB this should be the USB controller. Use dma_dev in the
PRIME import helpers, if set.

v2:
- acquire internal reference on dma_dev (Jani)
- add DMA-controller usecase to docs (Maxime)

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Maxime Ripard <mripard@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250307080836.42848-2-tzimmermann@suse.de
3 months agodrm/ast: cursor: Drop page alignment
Thomas Zimmermann [Wed, 5 Mar 2025 16:30:46 +0000 (17:30 +0100)]
drm/ast: cursor: Drop page alignment

The cursor scanout address requires alignment to a multiple of 8,
but does not require page alignment. Change the offset calculation
accordingly. Frees up a few more bytes for the primary framebuffer.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250305163207.267650-8-tzimmermann@suse.de
3 months agodrm/ast: Remove vram_fb_available from struct ast_device
Thomas Zimmermann [Wed, 5 Mar 2025 16:30:45 +0000 (17:30 +0100)]
drm/ast: Remove vram_fb_available from struct ast_device

Helpers compute the offset and size of the available framebuffer
memory. Remove the obsolete field vram_fb_available from struct
ast_device. Also define the cursor-signature size next to its only
user.

v2:
- initialize plane size

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250305163207.267650-7-tzimmermann@suse.de
3 months agodrm/ast: Add helper for computing framebuffer location in video memory
Thomas Zimmermann [Wed, 5 Mar 2025 16:30:44 +0000 (17:30 +0100)]
drm/ast: Add helper for computing framebuffer location in video memory

The ast driver stores the primary plane's image in the framebuffer
memory up to where the cursor is located. Add helpers to calculate
the offset and size.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250305163207.267650-6-tzimmermann@suse.de
3 months agodrm/ast: cursor: Add helpers for computing location in video memory
Thomas Zimmermann [Wed, 5 Mar 2025 16:30:43 +0000 (17:30 +0100)]
drm/ast: cursor: Add helpers for computing location in video memory

The ast drivers stores the cursor image at the end of the video memory.
Add helpers to calculate the offset and size.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250305163207.267650-5-tzimmermann@suse.de
3 months agodrm/ast: Add VGACR99 register constants
Thomas Zimmermann [Wed, 5 Mar 2025 16:30:42 +0000 (17:30 +0100)]
drm/ast: Add VGACR99 register constants

Add register constants for VGACR99 and use them when detecting the
size of the VGA memory. Aligns the code with the programming manual.
Also replace literal size values with Linux' SZ_ size constants.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250305163207.267650-4-tzimmermann@suse.de
3 months agodrm/ast: Add VGACRAA register constants
Thomas Zimmermann [Wed, 5 Mar 2025 16:30:41 +0000 (17:30 +0100)]
drm/ast: Add VGACRAA register constants

Add register constants for VGACRAA and use them when detecting the
size of the VGA memory. Aligns the code with the programming manual.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250305163207.267650-3-tzimmermann@suse.de
3 months agodrm/ast: Replace AST_VIDMEM_SIZE_ with Linux SZ_ constants
Thomas Zimmermann [Wed, 5 Mar 2025 16:30:40 +0000 (17:30 +0100)]
drm/ast: Replace AST_VIDMEM_SIZE_ with Linux SZ_ constants

Ast's AST_VIDMEM_SIZE_ constants enumerate supported video-memory
sizes from 8 MiB to 128 MiB. Replace them with Linux' SZ_ constants
of the same value. When expanded, the literal values remain the same.

The size constant for 128 MiB is unused and the default size is not
necessary. Remove both of them.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250305163207.267650-2-tzimmermann@suse.de
3 months agodrm/ci: enable lockdep detection
Vignesh Raman [Mon, 17 Feb 2025 05:37:12 +0000 (11:07 +0530)]
drm/ci: enable lockdep detection

We have enabled PROVE_LOCKING (which enables LOCKDEP) in drm-ci.
This will output warnings when kernel locking errors are encountered
and will continue executing tests. To detect if lockdep has been
triggered, check the debug_locks value in /proc/lockdep_stats after
the tests have run. When debug_locks is 0, it indicates that lockdep
has detected issues and turned itself off. Check this value, and if
lockdep is detected, exit with an error and configure it as a warning
in GitLab CI.

GitLab CI ignores exit codes other than 1 by default. Pass the correct
exit code with variable FF_USE_NEW_BASH_EVAL_STRATEGY set to true or
exit on failure.

Also update the documentation.

Acked-by: Helen Koike <helen.fornazier@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250217053719.442644-4-vignesh.raman@collabora.com
Signed-off-by: Vignesh Raman <vignesh.raman@collabora.com>
3 months agodrm/ci: enable CONFIG_DEBUG_WW_MUTEX_SLOWPATH
Vignesh Raman [Mon, 17 Feb 2025 05:37:11 +0000 (11:07 +0530)]
drm/ci: enable CONFIG_DEBUG_WW_MUTEX_SLOWPATH

Enable CONFIG_DEBUG_WW_MUTEX_SLOWPATH for mutex
slowpath debugging.

Acked-by: Helen Koike <helen.fornazier@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250217053719.442644-3-vignesh.raman@collabora.com
Signed-off-by: Vignesh Raman <vignesh.raman@collabora.com>
3 months agodrm/ci: refactor software-driver stage jobs
Vignesh Raman [Mon, 17 Feb 2025 05:37:10 +0000 (11:07 +0530)]
drm/ci: refactor software-driver stage jobs

Move common job configuration for software-driver
stage jobs to separate job.

Acked-by: Helen Koike <helen.fornazier@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250217053719.442644-2-vignesh.raman@collabora.com
Signed-off-by: Vignesh Raman <vignesh.raman@collabora.com>
3 months agoDocumentation: Update the todo
Anusha Srivatsa [Tue, 4 Mar 2025 21:05:37 +0000 (16:05 -0500)]
Documentation: Update the todo

Update the Documentation to be more precise.

v2: Update for clarity
v3: Further details in Todo

Cc: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Anusha Srivatsa <asrivats@redhat.com>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/640856/?series=144073&rev=5