]> git.ipfire.org Git - thirdparty/kernel/linux.git/log
thirdparty/kernel/linux.git
2 months agodrm/vboxvideo: Switch to drm_atomic_get_new_crtc_state()
Maxime Ripard [Tue, 30 Sep 2025 10:59:46 +0000 (12:59 +0200)] 
drm/vboxvideo: Switch to drm_atomic_get_new_crtc_state()

The vboxvideo atomic_check implementation uses the deprecated
drm_atomic_get_existing_crtc_state() helper.

This hook is called as part of the global atomic_check, thus before the
states are swapped. The existing state thus points to the new state, and
we can use drm_atomic_get_new_crtc_state() instead.

Reviewed-by: Hans de Goede <hansg@kernel.org>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://lore.kernel.org/r/20250930-drm-no-more-existing-state-v5-31-eeb9e1287907@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
2 months agodrm/tilcdc: Switch to drm_atomic_get_new_crtc_state()
Maxime Ripard [Tue, 30 Sep 2025 10:59:45 +0000 (12:59 +0200)] 
drm/tilcdc: Switch to drm_atomic_get_new_crtc_state()

The tilcdc atomic_check implementation uses the deprecated
drm_atomic_get_existing_crtc_state() helper.

This hook is called as part of the global atomic_check, thus before the
states are swapped. The existing state thus points to the new state, and
we can use drm_atomic_get_new_crtc_state() instead.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Acked-by: Jyri Sarha <jyri.sarha@iki.fi>
Link: https://lore.kernel.org/r/20250930-drm-no-more-existing-state-v5-30-eeb9e1287907@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
2 months agodrm/tegra: Switch to drm_atomic_get_new_crtc_state()
Maxime Ripard [Tue, 30 Sep 2025 10:59:44 +0000 (12:59 +0200)] 
drm/tegra: Switch to drm_atomic_get_new_crtc_state()

The tegra atomic_check implementation uses the deprecated
drm_atomic_get_existing_crtc_state() helper.

This hook is called as part of the global atomic_check, thus before the
states are swapped. The existing state thus points to the new state, and
we can use drm_atomic_get_new_crtc_state() instead.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://lore.kernel.org/r/20250930-drm-no-more-existing-state-v5-29-eeb9e1287907@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
2 months agodrm/sun4i: Switch to drm_atomic_get_new_crtc_state()
Maxime Ripard [Tue, 30 Sep 2025 10:59:43 +0000 (12:59 +0200)] 
drm/sun4i: Switch to drm_atomic_get_new_crtc_state()

The sun4i atomic_check implementation uses the deprecated
drm_atomic_get_existing_crtc_state() helper.

This hook is called as part of the global atomic_check, thus before the
states are swapped. The existing state thus points to the new state, and
we can use drm_atomic_get_new_crtc_state() instead.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://lore.kernel.org/r/20250930-drm-no-more-existing-state-v5-28-eeb9e1287907@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
2 months agodrm/rockchip: Switch to drm_atomic_get_new_crtc_state()
Maxime Ripard [Tue, 30 Sep 2025 10:59:42 +0000 (12:59 +0200)] 
drm/rockchip: Switch to drm_atomic_get_new_crtc_state()

The rockchip atomic_check implementation uses the deprecated
drm_atomic_get_existing_crtc_state() helper.

This hook is called as part of the global atomic_check, thus before the
states are swapped. The existing state thus points to the new state, and
we can use drm_atomic_get_new_crtc_state() instead.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://lore.kernel.org/r/20250930-drm-no-more-existing-state-v5-27-eeb9e1287907@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
2 months agodrm/omap: Switch to drm_atomic_get_new_crtc_state()
Maxime Ripard [Tue, 30 Sep 2025 10:59:41 +0000 (12:59 +0200)] 
drm/omap: Switch to drm_atomic_get_new_crtc_state()

The omap atomic_check implementation uses the deprecated
drm_atomic_get_existing_crtc_state() helper.

This hook is called as part of the global atomic_check, thus before the
states are swapped. The existing state thus points to the new state, and
we can use drm_atomic_get_new_crtc_state() instead.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://lore.kernel.org/r/20250930-drm-no-more-existing-state-v5-26-eeb9e1287907@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
2 months agodrm/msm/mdp5: Switch to drm_atomic_get_new_crtc_state()
Maxime Ripard [Tue, 30 Sep 2025 10:59:40 +0000 (12:59 +0200)] 
drm/msm/mdp5: Switch to drm_atomic_get_new_crtc_state()

The msm atomic_check implementation uses the deprecated
drm_atomic_get_existing_crtc_state() helper.

This hook is called as part of the global atomic_check, thus before the
states are swapped. The existing state thus points to the new state, and
we can use drm_atomic_get_new_crtc_state() instead.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Acked-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://lore.kernel.org/r/20250930-drm-no-more-existing-state-v5-25-eeb9e1287907@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
2 months agodrm/mediatek: Switch to drm_atomic_get_new_crtc_state()
Maxime Ripard [Tue, 30 Sep 2025 10:59:39 +0000 (12:59 +0200)] 
drm/mediatek: Switch to drm_atomic_get_new_crtc_state()

The mediatek atomic_check implementation uses the deprecated
drm_atomic_get_existing_crtc_state() helper.

This hook is called as part of the global atomic_check, thus before the
states are swapped. The existing state thus points to the new state, and
we can use drm_atomic_get_new_crtc_state() instead.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://lore.kernel.org/r/20250930-drm-no-more-existing-state-v5-24-eeb9e1287907@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
2 months agodrm/loongson: Switch to drm_atomic_get_new_crtc_state()
Maxime Ripard [Tue, 30 Sep 2025 10:59:38 +0000 (12:59 +0200)] 
drm/loongson: Switch to drm_atomic_get_new_crtc_state()

The loongson atomic_check implementation uses the deprecated
drm_atomic_get_existing_crtc_state() helper.

This hook is called as part of the global atomic_check, thus before the
states are swapped. The existing state thus points to the new state, and
we can use drm_atomic_get_new_crtc_state() instead.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://lore.kernel.org/r/20250930-drm-no-more-existing-state-v5-23-eeb9e1287907@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
2 months agodrm/logicvc: Switch to drm_atomic_get_new_crtc_state()
Maxime Ripard [Tue, 30 Sep 2025 10:59:37 +0000 (12:59 +0200)] 
drm/logicvc: Switch to drm_atomic_get_new_crtc_state()

The logicvc atomic_check implementation uses the deprecated
drm_atomic_get_existing_crtc_state() helper.

This hook is called as part of the global atomic_check, thus before the
states are swapped. The existing state thus points to the new state, and
we can use drm_atomic_get_new_crtc_state() instead.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://lore.kernel.org/r/20250930-drm-no-more-existing-state-v5-22-eeb9e1287907@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
2 months agodrm/kmb: Switch to drm_atomic_get_new_crtc_state()
Maxime Ripard [Tue, 30 Sep 2025 10:59:36 +0000 (12:59 +0200)] 
drm/kmb: Switch to drm_atomic_get_new_crtc_state()

The kmb atomic_check implementation uses the deprecated
drm_atomic_get_existing_crtc_state() helper.

This hook is called as part of the global atomic_check, thus before the
states are swapped. The existing state thus points to the new state, and
we can use drm_atomic_get_new_crtc_state() instead.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://lore.kernel.org/r/20250930-drm-no-more-existing-state-v5-21-eeb9e1287907@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
2 months agodrm/ingenic: Switch to drm_atomic_get_new_crtc_state()
Maxime Ripard [Tue, 30 Sep 2025 10:59:35 +0000 (12:59 +0200)] 
drm/ingenic: Switch to drm_atomic_get_new_crtc_state()

The ingenic atomic_check implementation uses the deprecated
drm_atomic_get_existing_crtc_state() helper.

This hook is called as part of the global atomic_check, thus before the
states are swapped. The existing state thus points to the new state, and
we can use drm_atomic_get_new_crtc_state() instead.

Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Tested-by: Paul Cercueil <paul@crapouillou.net>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://lore.kernel.org/r/20250930-drm-no-more-existing-state-v5-20-eeb9e1287907@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
2 months agodrm/imx-ipuv3: Switch to drm_atomic_get_new_crtc_state()
Maxime Ripard [Tue, 30 Sep 2025 10:59:34 +0000 (12:59 +0200)] 
drm/imx-ipuv3: Switch to drm_atomic_get_new_crtc_state()

The imx-ipuv3 atomic_check implementation uses the deprecated
drm_atomic_get_existing_crtc_state() helper.

This hook is called as part of the global atomic_check, thus before the
states are swapped. The existing state thus points to the new state, and
we can use drm_atomic_get_new_crtc_state() instead.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://lore.kernel.org/r/20250930-drm-no-more-existing-state-v5-19-eeb9e1287907@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
2 months agodrm/imx-dcss: Switch to drm_atomic_get_new_crtc_state()
Maxime Ripard [Tue, 30 Sep 2025 10:59:33 +0000 (12:59 +0200)] 
drm/imx-dcss: Switch to drm_atomic_get_new_crtc_state()

The imx-dcss atomic_check implementation uses the deprecated
drm_atomic_get_existing_crtc_state() helper.

This hook is called as part of the global atomic_check, thus before the
states are swapped. The existing state thus points to the new state, and
we can use drm_atomic_get_new_crtc_state() instead.

Reviewed-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://lore.kernel.org/r/20250930-drm-no-more-existing-state-v5-18-eeb9e1287907@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
2 months agodrm/imx-dc: Switch to drm_atomic_get_new_crtc_state()
Maxime Ripard [Tue, 30 Sep 2025 10:59:32 +0000 (12:59 +0200)] 
drm/imx-dc: Switch to drm_atomic_get_new_crtc_state()

The imx-dc atomic_check implementation uses the deprecated
drm_atomic_get_existing_crtc_state() helper.

This hook is called as part of the global atomic_check, thus before the
states are swapped. The existing state thus points to the new state, and
we can use drm_atomic_get_new_crtc_state() instead.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Liu Ying <victor.liu@nxp.com>
Link: https://lore.kernel.org/r/20250930-drm-no-more-existing-state-v5-17-eeb9e1287907@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
2 months agodrm/exynos: Switch to drm_atomic_get_new_crtc_state()
Maxime Ripard [Tue, 30 Sep 2025 10:59:31 +0000 (12:59 +0200)] 
drm/exynos: Switch to drm_atomic_get_new_crtc_state()

The exynos atomic_check implementation uses the deprecated
drm_atomic_get_existing_crtc_state() helper.

This hook is called as part of the global atomic_check, thus before the
states are swapped. The existing state thus points to the new state, and
we can use drm_atomic_get_new_crtc_state() instead.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://lore.kernel.org/r/20250930-drm-no-more-existing-state-v5-16-eeb9e1287907@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
2 months agodrm/atmel-hlcdc: Switch to drm_atomic_get_new_crtc_state()
Maxime Ripard [Tue, 30 Sep 2025 10:59:30 +0000 (12:59 +0200)] 
drm/atmel-hlcdc: Switch to drm_atomic_get_new_crtc_state()

The atmel-hlcdc atomic_check implementation uses the deprecated
drm_atomic_get_existing_crtc_state() helper.

This hook is called as part of the global atomic_check, thus before the
states are swapped. The existing state thus points to the new state, and
we can use drm_atomic_get_new_crtc_state() instead.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Manikandan Muralidharan <manikandan.m@microchip.com>
Link: https://lore.kernel.org/r/20250930-drm-no-more-existing-state-v5-15-eeb9e1287907@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
2 months agodrm/armada: Switch to drm_atomic_get_new_crtc_state()
Maxime Ripard [Tue, 30 Sep 2025 10:59:29 +0000 (12:59 +0200)] 
drm/armada: Switch to drm_atomic_get_new_crtc_state()

The armada atomic_check implementation uses the deprecated
drm_atomic_get_existing_crtc_state() helper.

This hook is called as part of the global atomic_check, thus before the
states are swapped. The existing state thus points to the new state, and
we can use drm_atomic_get_new_crtc_state() instead.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://lore.kernel.org/r/20250930-drm-no-more-existing-state-v5-14-eeb9e1287907@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
2 months agodrm/armada: Drop always true condition in atomic_check
Maxime Ripard [Tue, 30 Sep 2025 10:59:28 +0000 (12:59 +0200)] 
drm/armada: Drop always true condition in atomic_check

The drm_atomic_state pointer passed to atomic_check is always valid, so
checking if it's NULL or not is pointless. Remove the check.

Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://lore.kernel.org/r/20250930-drm-no-more-existing-state-v5-13-eeb9e1287907@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
2 months agodrm/arm/malidp: Switch to drm_atomic_get_new_crtc_state()
Maxime Ripard [Tue, 30 Sep 2025 10:59:27 +0000 (12:59 +0200)] 
drm/arm/malidp: Switch to drm_atomic_get_new_crtc_state()

The malidp atomic_check implementation uses the deprecated
drm_atomic_get_existing_crtc_state() helper.

This hook is called as part of the global atomic_check, thus before the
states are swapped. The existing state thus points to the new state, and
we can use drm_atomic_get_new_crtc_state() instead.

Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://lore.kernel.org/r/20250930-drm-no-more-existing-state-v5-12-eeb9e1287907@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
2 months agodrm/ingenic: ipu: Switch to drm_atomic_get_new_crtc_state()
Maxime Ripard [Tue, 30 Sep 2025 10:59:26 +0000 (12:59 +0200)] 
drm/ingenic: ipu: Switch to drm_atomic_get_new_crtc_state()

The ingenic IPU atomic_set_property implementation uses the deprecated
drm_atomic_get_existing_crtc_state() helper.

This hook is called during the state building process, before
atomic_check, and thus before the states are swapped. The existing state
thus points to the new state, and we can use
drm_atomic_get_new_crtc_state() instead.

Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Tested-by: Paul Cercueil <paul@crapouillou.net>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://lore.kernel.org/r/20250930-drm-no-more-existing-state-v5-11-eeb9e1287907@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
2 months agodrm/atomic: Convert drm_atomic_get_crtc_state() to use new connector state
Maxime Ripard [Tue, 30 Sep 2025 10:59:25 +0000 (12:59 +0200)] 
drm/atomic: Convert drm_atomic_get_crtc_state() to use new connector state

The drm_atomic_get_crtc_state() function calls the deprecated
drm_atomic_get_existing_crtc_state() helper to get find if a crtc state
had already been allocated and was part of the given drm_atomic_state.

At the point in time where drm_atomic_get_crtc_state() can be
called (ie, during atomic_check), the existing state is the new state
and drm_atomic_get_existing_crtc_state() can thus be replaced by
drm_atomic_get_new_crtc_state().

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://lore.kernel.org/r/20250930-drm-no-more-existing-state-v5-10-eeb9e1287907@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
2 months agodrm/atomic: Document __drm_planes_state state pointer
Maxime Ripard [Tue, 30 Sep 2025 10:59:24 +0000 (12:59 +0200)] 
drm/atomic: Document __drm_planes_state state pointer

While the old and new state pointers are somewhat self-explanatory, the
state pointer and its relation to the other two really isn't.

Now that we've cleaned up everything and it isn't used in any
modesetting path, we can document what it's still useful for: to free
the right state when we free the global state.

Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://lore.kernel.org/r/20250930-drm-no-more-existing-state-v5-9-eeb9e1287907@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
2 months agodrm/atomic: Remove unused drm_atomic_get_existing_plane_state()
Maxime Ripard [Tue, 30 Sep 2025 10:59:23 +0000 (12:59 +0200)] 
drm/atomic: Remove unused drm_atomic_get_existing_plane_state()

The drm_atomic_get_existing_plane_state() function is deprecated and
isn't used anymore, so let's remove it.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://lore.kernel.org/r/20250930-drm-no-more-existing-state-v5-8-eeb9e1287907@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
2 months agodrm/tilcdc: crtc: Use drm_atomic_helper_check_crtc_primary_plane()
Maxime Ripard [Tue, 30 Sep 2025 10:59:22 +0000 (12:59 +0200)] 
drm/tilcdc: crtc: Use drm_atomic_helper_check_crtc_primary_plane()

In the tilcdc_crtc_atomic_check(), the tilcdc driver hand-crafts its own
implementation of drm_atomic_helper_check_crtc_primary_plane(). And it
does so by accessing the state pointer in drm_atomic_state->planes which
is deprecated.

Let's use the right helper here.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Acked-by: Jyri Sarha <jyri.sarha@iki.fi>
Link: https://lore.kernel.org/r/20250930-drm-no-more-existing-state-v5-7-eeb9e1287907@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
2 months agodrm/vkms: Convert vkms_crtc_atomic_check() to use new plane state
Maxime Ripard [Tue, 30 Sep 2025 10:59:21 +0000 (12:59 +0200)] 
drm/vkms: Convert vkms_crtc_atomic_check() to use new plane state

The vkms_crtc_atomic_check() function calls the deprecated
drm_atomic_get_existing_plane_state() helper for its internal mode
checking logic.

During atomic_check, the existing state is the new state and
drm_atomic_get_existing_plane_state() can thus be replaced by
drm_atomic_get_new_plane_state().

Reviewed-by: Louis Chauvet <louis.chauvet@bootlin.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://lore.kernel.org/r/20250930-drm-no-more-existing-state-v5-6-eeb9e1287907@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
2 months agodrm/atomic: Convert drm_atomic_get_plane_state() to use new plane state
Maxime Ripard [Tue, 30 Sep 2025 10:59:20 +0000 (12:59 +0200)] 
drm/atomic: Convert drm_atomic_get_plane_state() to use new plane state

The drm_atomic_get_plane_state() function calls the deprecated
drm_atomic_get_existing_plane_state() helper to get find if a plane
state had already been allocated and was part of the given
drm_atomic_state.

At the point in time where drm_atomic_get_plane_state() can be called
(ie, during atomic_check), the existing state is the new state and
drm_atomic_get_existing_plane_state() can thus be replaced by
drm_atomic_get_new_plane_state().

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://lore.kernel.org/r/20250930-drm-no-more-existing-state-v5-5-eeb9e1287907@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
2 months agodrm/atomic: Convert __drm_atomic_get_current_plane_state() to modern accessor
Maxime Ripard [Tue, 30 Sep 2025 10:59:19 +0000 (12:59 +0200)] 
drm/atomic: Convert __drm_atomic_get_current_plane_state() to modern accessor

The __drm_atomic_get_current_plane_state() function tries to get and
return the existing plane state, and if it doesn't exist returns the one
stored in the drm_plane->state field.

Using the current nomenclature, it tries to get the existing plane state
with an ad-hoc implementation of drm_atomic_get_existing_plane_state(),
and falls back to either the old or new plane state, depending on
whether it is called before or after drm_atomic_helper_swap_state().

The existing plane state itself is deprecated, because it also changes
when swapping states from the new state to the old state.

Fortunately for us, we can simplify things. Indeed,
__drm_atomic_get_current_plane_state() is only used in two macros:
intel_atomic_crtc_state_for_each_plane_state and
drm_atomic_crtc_state_for_each_plane_state().

The intel variant is only used through the intel_wm_compute() function
that is only ever called in intel_crtc_atomic_check().

The generic variant is more widely used, and can be found in the malidp,
msm, tegra and vc4 drivers. All of these call sites though are during
atomic_check(), so we end up in the same situation than Intel's.

Thus, we only ever use the existing state as the new state, and
plane->state is always going to be the old state. Any plane isn't
guaranteed to be part of the state though, so we can't rely on
drm_atomic_get_old_plane_state() and we still need to use plane->state.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://lore.kernel.org/r/20250930-drm-no-more-existing-state-v5-4-eeb9e1287907@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
2 months agodrm/atomic: Document __drm_connectors_state state pointer
Maxime Ripard [Tue, 30 Sep 2025 10:59:18 +0000 (12:59 +0200)] 
drm/atomic: Document __drm_connectors_state state pointer

While the old and new state pointers are somewhat self-explanatory, the
state pointer and its relation to the other two really isn't.

Now that we've cleaned up everything and it isn't used in any
modesetting path, we can document what it's still useful for: to free
the right state when we free the global state.

Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://lore.kernel.org/r/20250930-drm-no-more-existing-state-v5-3-eeb9e1287907@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
2 months agodrm/atomic: Remove unused drm_atomic_get_existing_connector_state()
Maxime Ripard [Tue, 30 Sep 2025 10:59:17 +0000 (12:59 +0200)] 
drm/atomic: Remove unused drm_atomic_get_existing_connector_state()

The drm_atomic_get_existing_connector_state() function is deprecated and
isn't used anymore, so let's remove it.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Tested-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://lore.kernel.org/r/20250930-drm-no-more-existing-state-v5-2-eeb9e1287907@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
2 months agodrm/atomic: Convert drm_atomic_get_connector_state() to use new connector state
Maxime Ripard [Tue, 30 Sep 2025 10:59:16 +0000 (12:59 +0200)] 
drm/atomic: Convert drm_atomic_get_connector_state() to use new connector state

The drm_atomic_get_connector_state() function calls a hand-rolled
implementation of the deprecated
drm_atomic_get_existing_connector_state() helper to get find if a
connector state had already been allocated and was part of the given
drm_atomic_state.

At the point in time where drm_atomic_get_connector_state() can be
called (ie, during atomic_check), the existing state is the new state
and drm_atomic_get_existing_connector_state() can thus be replaced by
drm_atomic_get_new_connector_state().

Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Tested-by: Luca Ceresoli <luca.ceresoli@bootlin.com> # on imx8mp
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://lore.kernel.org/r/20250930-drm-no-more-existing-state-v5-1-eeb9e1287907@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
2 months agodrm/panthor: add custom ASN_HASH support for mt8196
Chia-I Wu [Sat, 13 Sep 2025 00:21:55 +0000 (17:21 -0700)] 
drm/panthor: add custom ASN_HASH support for mt8196

Add panthor_soc_data to control custom ASN_HASH. Add compatible string
for "mediatek,mt8196-mali" and enable custom ASN_HASH for the soc.

Without custom ASN_HASH, FW fails to boot

  panthor 48000000.gpu: [drm] *ERROR* Unhandled Page fault in AS0 at VA 0x0000000000000000
  panthor 48000000.gpu: [drm] *ERROR* Failed to boot MCU (status=fatal)
  panthor 48000000.gpu: probe with driver panthor failed with error -110

With custom ASN_HASH, panthor probes fine and userspace boots to ui just
fine as well

  panthor 48000000.gpu: [drm] clock rate = 0
  panthor 48000000.gpu: EM: created perf domain
  panthor 48000000.gpu: [drm] Mali-G925-Immortalis id 0xd830 major 0x0 minor 0x1 status 0x5
  panthor 48000000.gpu: [drm] Features: L2:0x8130306 Tiler:0x809 Mem:0x301 MMU:0x2830 AS:0xff
  panthor 48000000.gpu: [drm] shader_present=0xee0077 l2_present=0x1 tiler_present=0x1
  panthor 48000000.gpu: [drm] Firmware protected mode entry not be supported, ignoring
  panthor 48000000.gpu: [drm] Firmware git sha: 27713280172c742d467a4b7d11180930094092ec
  panthor 48000000.gpu: [drm] CSF FW using interface v3.13.0, Features 0x10 Instrumentation features 0x71
  [drm] Initialized panthor 1.5.0 for 48000000.gpu on minor 1

Note that the clock and the regulator drivers are not upstreamed yet.
They might as well take a different form when upstreamed.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Signed-off-by: Steven Price <steven.price@arm.com>
Link: https://lore.kernel.org/r/20250913002155.1163908-3-olvaffe@gmail.com
2 months agodt-bindings: gpu: mali-valhall-csf: add MediaTek MT8196 compatible
Chia-I Wu [Sat, 13 Sep 2025 00:21:54 +0000 (17:21 -0700)] 
dt-bindings: gpu: mali-valhall-csf: add MediaTek MT8196 compatible

MediaTek MT8196 has Mali-G925-Immortalis GPU. panthor drm driver gained
support for it recently.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Steven Price <steven.price@arm.com>
Link: https://lore.kernel.org/r/20250913002155.1163908-2-olvaffe@gmail.com
2 months agodrm: renesas: rz-du: Drop ARCH_RZG2L dependency
Lad Prabhakar [Thu, 2 Oct 2025 12:34:52 +0000 (13:34 +0100)] 
drm: renesas: rz-du: Drop ARCH_RZG2L dependency

The RZ/G2L DU driver is now also used on other Renesas SoCs such as
RZ/V2H(P) and RZ/V2N. Restricting it to ARCH_RZG2L prevents enabling it
on these newer platforms.

Replace the ARCH_RZG2L dependency with ARCH_RENESAS to allow the driver
to be built on all relevant Renesas SoCs.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/20251002123452.146610-1-prabhakar.mahadev-lad.rj@bp.renesas.com
2 months agodrm/sitronix/st7571-i2c: reset position before clearing display
Marcus Folkesson [Sat, 13 Sep 2025 06:09:40 +0000 (08:09 +0200)] 
drm/sitronix/st7571-i2c: reset position before clearing display

We cannot know where the write pointer is, always reset position to
(0,0) before clearing display.

Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://lore.kernel.org/r/20250913-st7571-reset-v1-1-ae5f58acdf8d@gmail.com
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2 months agodrm/bridge: refcount last_bridge in drm_atomic_bridge_chain_select_bus_fmts()
Luca Ceresoli [Wed, 24 Sep 2025 15:11:01 +0000 (17:11 +0200)] 
drm/bridge: refcount last_bridge in drm_atomic_bridge_chain_select_bus_fmts()

Get a reference for the last_bridge when it is obtained and release it
using a cleanup action.

Reviewed-by: Maxime Ripard <mripard@kernel.org>
Link: https://lore.kernel.org/r/20250924-b4-drm-bridge-alloc-getput-drm_atomic_bridge_chain_select_bus_fmts-v1-1-f8c2efdb783f@bootlin.com
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
2 months agodrm/display: bridge_connector: get/put the stored bridges
Luca Ceresoli [Fri, 26 Sep 2025 14:59:40 +0000 (16:59 +0200)] 
drm/display: bridge_connector: get/put the stored bridges

drm_bridge_connector_init() takes eight pointers to various bridges, some
of which can be identical, and stores them in pointers inside struct
drm_bridge_connector. Get a reference to each of the taken bridges and put
it on cleanup.

This is tricky because the pointers are currently stored directly in the
drm_bridge_connector in the loop, but there is no nice and clean way to put
those pointers on error return paths. To overcome this, store all pointers
in temporary local variables with a cleanup action, and only on success
copy them into struct drm_bridge_connector (getting another ref while
copying).

Additionally four of these pointers (edid, hpd, detect and modes) can be
written in multiple loop iterations, in order to eventually store the last
matching bridge. However, when one of those pointers is overwritten, we
need to put the reference that we got during the previous assignment. Add a
drm_bridge_put() before writing them to handle this.

Finally, there is also a function-local panel_bridge pointer taken inside
the loop and used after the loop. Use a cleanup action as well to ensure it
is put on return.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20250926-drm-bridge-alloc-getput-bridge-connector-v2-1-138b4bb70576@bootlin.com
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
2 months agogpu/drm: panel-edp: add AUO B116XAN02.0 panel entry
Svyatoslav Ryhel [Mon, 29 Sep 2025 14:24:54 +0000 (17:24 +0300)] 
gpu/drm: panel-edp: add AUO B116XAN02.0 panel entry

Add an eDP panel entry for AUO B116XAN02.0 used in Lenovo IdeaPad Yoga 11
with Tegra 3 SoC.

The raw edid of the panel is:

00 ff ff ff ff ff ff 00 06 af 5c 20 00 00 00 00
00 16 01 04 90 1a 0e 78 02 99 85 95 55 56 92 28
22 50 54 00 00 00 01 01 01 01 01 01 01 01 01 01
01 01 01 01 01 01 12 1b 56 5a 50 00 19 30 30 20
46 00 00 90 10 00 00 18 00 00 00 0f 00 00 00 00
00 00 00 00 00 00 00 00 00 20 00 00 00 fe 00 41
55 4f 0a 20 20 20 20 20 20 20 20 20 00 00 00 fe
00 42 31 31 36 58 41 4e 30 32 2e 30 20 0a 00 f1

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20250929142455.24883-9-clamor95@gmail.com
2 months agoaccel/ivpu: Fix DCT active percent format
Karol Wachowski [Wed, 1 Oct 2025 10:43:22 +0000 (12:43 +0200)] 
accel/ivpu: Fix DCT active percent format

The pcode MAILBOX STATUS register PARAM2 field expects DCT active
percent in U1.7 value format. Convert percentage value to this
format before writing to the register.

Fixes: a19bffb10c46 ("accel/ivpu: Implement DCT handling")
Reviewed-by: Lizhi Hou <lizhi.hou@amd.com>
Signed-off-by: Karol Wachowski <karol.wachowski@linux.intel.com>
Link: https://lore.kernel.org/r/20251001104322.1249896-1-karol.wachowski@linux.intel.com
2 months agoaccel/ivpu: Improve BO alloc/free warnings
Jacek Lawrynowicz [Thu, 25 Sep 2025 14:51:54 +0000 (16:51 +0200)] 
accel/ivpu: Improve BO alloc/free warnings

Add additional warnings related to allocation and
deallocation of buffer objects to better track possible
memory leaks and generally the BO's lifecycle.

Introduce checks for handle_count to ensure it is zero
before creating a new handle, and exactly one
after successfully creating a handle.

Introduce also a check to warn if the VMA node is not
empty when freeing the buffer object.

Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Signed-off-by: Maciej Falkowski <maciej.falkowski@linux.intel.com>
Reviewed-by: Karol Wachowski <karol.wachowski@linux.intel.com>
Signed-off-by: Karol Wachowski <karol.wachowski@linux.intel.com>
Link: https://lore.kernel.org/r/20250925145154.1446427-1-maciej.falkowski@linux.intel.com
2 months agoaccel/ivpu: Fix doc description of job structure
Andrzej Kacprowski [Thu, 25 Sep 2025 14:51:31 +0000 (16:51 +0200)] 
accel/ivpu: Fix doc description of job structure

Fix doc description of job structure as it is
improperly formatted. Align order of job structure's
fields according to the documentation.

Fixes: 0bf37f45d5c4 ("accel/ivpu: Add support for user-managed preemption buffer")
Signed-off-by: Andrzej Kacprowski <andrzej.kacprowski@linux.intel.com>
Signed-off-by: Maciej Falkowski <maciej.falkowski@linux.intel.com>
Reviewed-by: Karol Wachowski <karol.wachowski@linux.intel.com>
Signed-off-by: Karol Wachowski <karol.wachowski@linux.intel.com>
Link: https://lore.kernel.org/r/20250925145131.1446323-1-maciej.falkowski@linux.intel.com
2 months agoaccel/ivpu: Fix page fault in ivpu_bo_unbind_all_bos_from_context()
Jacek Lawrynowicz [Thu, 25 Sep 2025 14:51:14 +0000 (16:51 +0200)] 
accel/ivpu: Fix page fault in ivpu_bo_unbind_all_bos_from_context()

Don't add BO to the vdev->bo_list in ivpu_gem_create_object().
When failure happens inside drm_gem_shmem_create(), the BO is not
fully created and ivpu_gem_bo_free() callback will not be called
causing a deleted BO to be left on the list.

Fixes: 8d88e4cdce4f ("accel/ivpu: Use GEM shmem helper for all buffers")
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Signed-off-by: Maciej Falkowski <maciej.falkowski@linux.intel.com>
Reviewed-by: Karol Wachowski <karol.wachowski@linux.intel.com>
Signed-off-by: Karol Wachowski <karol.wachowski@linux.intel.com>
Link: https://lore.kernel.org/r/20250925145114.1446283-1-maciej.falkowski@linux.intel.com
2 months agoaccel/ivpu: Rework bind/unbind of imported buffers
Jacek Lawrynowicz [Thu, 25 Sep 2025 14:50:59 +0000 (16:50 +0200)] 
accel/ivpu: Rework bind/unbind of imported buffers

Ensure that imported buffers are properly mapped and unmapped in
the same way as regular buffers to properly handle buffers during
device's bind and unbind operations to prevent resource leaks and
inconsistent buffer states.

Imported buffers are now dma_mapped before submission and
dma_unmapped in ivpu_bo_unbind(), guaranteeing they are unmapped
when the device is unbound.

Add also imported buffers to vdev->bo_list for consistent unmapping
on device unbind. The bo->ctx_id is set in open() so imported
buffers have a valid context ID.

Debug logs have been updated to match the new code structure.
The function ivpu_bo_pin() has been renamed to ivpu_bo_bind()
to better reflect its purpose, and unbind tests have been refactored
for improved coverage and clarity.

Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Signed-off-by: Maciej Falkowski <maciej.falkowski@linux.intel.com>
Reviewed-by: Karol Wachowski <karol.wachowski@linux.intel.com>
Signed-off-by: Karol Wachowski <karol.wachowski@linux.intel.com>
Link: https://lore.kernel.org/r/20250925145059.1446243-1-maciej.falkowski@linux.intel.com
2 months agoaccel/ivpu: Enable MCA ECC signalling based on MSR
Tomasz Rusinowicz [Thu, 25 Sep 2025 14:50:20 +0000 (16:50 +0200)] 
accel/ivpu: Enable MCA ECC signalling based on MSR

Add new boot parameter for NPU5+ that enables
ECC signalling for on-chip memory based on the value
of MSR_INTEGRITY_CAPS register.

Signed-off-by: Tomasz Rusinowicz <tomasz.rusinowicz@intel.com>
Signed-off-by: Maciej Falkowski <maciej.falkowski@linux.intel.com>
Reviewed-by: Karol Wachowski <karol.wachowski@linux.intel.com>
Signed-off-by: Karol Wachowski <karol.wachowski@linux.intel.com>
Link: https://lore.kernel.org/r/20250925145020.1446208-1-maciej.falkowski@linux.intel.com
2 months agogpu/drm: panel: Add Sharp LQ079L1SX01 panel support
Svyatoslav Ryhel [Fri, 19 Sep 2025 15:38:39 +0000 (18:38 +0300)] 
gpu/drm: panel: Add Sharp LQ079L1SX01 panel support

This panel requires dual-channel mode. The device accepts video-mode data
on 8 lanes and will therefore need a dual-channel DSI controller. The two
interfaces that make up this device need to be instantiated in the
controllers that gang up to provide the dual-channel DSI host.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20250919153839.236241-3-clamor95@gmail.com
2 months agodt-bindings: display: panel: document Sharp LQ079L1SX01 panel
Svyatoslav Ryhel [Fri, 19 Sep 2025 15:38:38 +0000 (18:38 +0300)] 
dt-bindings: display: panel: document Sharp LQ079L1SX01 panel

Document Sharp LQ079L1SX01 panel found in Xiaomi Mi Pad.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20250919153839.236241-2-clamor95@gmail.com
2 months agodrm/dp: clamp PWM bit count to advertised MIN and MAX capabilities
Christopher Obbard [Thu, 14 Aug 2025 14:16:09 +0000 (16:16 +0200)] 
drm/dp: clamp PWM bit count to advertised MIN and MAX capabilities

According to the eDP specification (VESA Embedded DisplayPort Standard
v1.4b, Section 3.3.10.2), if the value of DP_EDP_PWMGEN_BIT_COUNT is
less than DP_EDP_PWMGEN_BIT_COUNT_CAP_MIN, the sink is required to use
the MIN value as the effective PWM bit count.

This commit updates the logic to clamp the reported
DP_EDP_PWMGEN_BIT_COUNT to the range defined by _CAP_MIN and _CAP_MAX.

As part of this change, the behavior is modified such that reading both
_CAP_MIN and _CAP_MAX registers is now required to succeed, otherwise
bl->max value could end up being not set although
drm_edp_backlight_probe_max() returned success.

This ensures correct handling of eDP panels that report a zero PWM
bit count but still provide valid non-zero MIN and MAX capability
values. Without this clamping, brightness values may be interpreted
incorrectly, leading to a dim or non-functional backlight.

For example, the Samsung ATNA40YK20 OLED panel used in the Lenovo
ThinkPad T14s Gen6 (Snapdragon) reports a PWM bit count of 0, but
supports AUX backlight control and declares a valid 11-bit range.
Clamping ensures brightness scaling works as intended on such panels.

Co-developed-by: Rui Miguel Silva <rui.silva@linaro.org>
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Signed-off-by: Christopher Obbard <christopher.obbard@linaro.org>
Tested-by: Christopher Obbard <christopher.obbard@linaro.org>
Reviewed-by: Christopher Obbard <christopher.obbard@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20250814-topic-x1e80100-t14s-oled-dp-brightness-v7-1-b3d7b4dfe8c5@linaro.org
2 months agodt-bindings: ili9881c: Allow port subnode
Marek Vasut [Thu, 4 Sep 2025 20:01:08 +0000 (22:01 +0200)] 
dt-bindings: ili9881c: Allow port subnode

The ILI9881C is a DSI panel, which can be tied to a DSI controller
using OF graph port/endpoint. Allow the port subnode in the binding.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20250904200130.168263-1-marek.vasut+renesas@mailbox.org
2 months agodrm/panel: visionox-rm69299: Add backlight support
Guido Günther [Wed, 10 Sep 2025 16:39:58 +0000 (18:39 +0200)] 
drm/panel: visionox-rm69299: Add backlight support

The shift6mq's variant supports controlling the backlight via DSI
commands. Use that if a max_brightness is set in the device specific
data.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Guido Günther <agx@sigxcpu.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20250910-shift6mq-panel-v3-3-a7729911afb9@sigxcpu.org
2 months agodrm/panel: visionox-rm69299: Don't clear all mode flags
Guido Günther [Wed, 10 Sep 2025 16:39:57 +0000 (18:39 +0200)] 
drm/panel: visionox-rm69299: Don't clear all mode flags

Don't clear all mode flags. We only want to maek sure we use HS mode
during unprepare.

Fixes: c7f66d32dd431 ("drm/panel: add support for rm69299 visionox panel")
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Guido Günther <agx@sigxcpu.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20250910-shift6mq-panel-v3-2-a7729911afb9@sigxcpu.org
2 months agodrm/panel: visionox-rm69299: Fix clock frequency for SHIFT6mq
Guido Günther [Wed, 10 Sep 2025 16:39:56 +0000 (18:39 +0200)] 
drm/panel: visionox-rm69299: Fix clock frequency for SHIFT6mq

Make the clock frequency match what the sdm845 downstream kernel
uses. Otherwise the panel stays black.

Fixes: 783334f366b18 ("drm/panel: visionox-rm69299: support the variant found in the SHIFT6mq")
Signed-off-by: Guido Günther <agx@sigxcpu.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20250910-shift6mq-panel-v3-1-a7729911afb9@sigxcpu.org
2 months agodrm/panel: ilitek-ili9881c: Add configuration for 5" Raspberry Pi 720x1280
Marek Vasut [Thu, 4 Sep 2025 20:56:57 +0000 (22:56 +0200)] 
drm/panel: ilitek-ili9881c: Add configuration for 5" Raspberry Pi 720x1280

Add configuration for the 5" Raspberry Pi 720x1280 DSI panel
based on ili9881. This uses 10px longer horizontal sync pulse
and 10px shorter HBP to avoid very short hsync pulse.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20250904205743.186177-2-marek.vasut+renesas@mailbox.org
2 months agodt-bindings: ili9881c: Document 5" Raspberry Pi 720x1280
Marek Vasut [Thu, 4 Sep 2025 20:56:56 +0000 (22:56 +0200)] 
dt-bindings: ili9881c: Document 5" Raspberry Pi 720x1280

Document the 5" Raspberry Pi 720x1280 DSI panel based on ili9881.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20250904205743.186177-1-marek.vasut+renesas@mailbox.org
2 months agodrm/panel: ilitek-ili9881c: Turn ILI9881C_COMMAND_INSTR() parameters lowercase
Marek Vasut [Thu, 4 Sep 2025 20:55:15 +0000 (22:55 +0200)] 
drm/panel: ilitek-ili9881c: Turn ILI9881C_COMMAND_INSTR() parameters lowercase

Make all ILI9881C_COMMAND_INSTR() parameters consistently lowercase.
No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20250904205541.186001-1-marek.vasut+renesas@mailbox.org
2 months agodrm/panel: simple: add JuTouch JT101TM023
Steffen Trumtrar [Thu, 21 Aug 2025 07:55:30 +0000 (09:55 +0200)] 
drm/panel: simple: add JuTouch JT101TM023

Add JuTouch Technology JT101TM023 10" 1280x800 LVDS panel support.

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20250821-v6-17-topic-imx8mp-skov-dts-jutouch-10inch-v1-3-b492ef807d12@pengutronix.de
2 months agodt-bindings: display: simple: Add JuTouch JT101TM023 panel
Steffen Trumtrar [Thu, 21 Aug 2025 07:55:29 +0000 (09:55 +0200)] 
dt-bindings: display: simple: Add JuTouch JT101TM023 panel

Add the JuTouch Technology Co. 10" JT101TM023 LVDS panel.

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20250821-v6-17-topic-imx8mp-skov-dts-jutouch-10inch-v1-2-b492ef807d12@pengutronix.de
2 months agodt-bindings: vendor-prefixes: Add JuTouch Technology Co, Ltd
Steffen Trumtrar [Thu, 21 Aug 2025 07:55:28 +0000 (09:55 +0200)] 
dt-bindings: vendor-prefixes: Add JuTouch Technology Co, Ltd

JuTouch is a chinese touch screen supplier dedicated to manufacturing
high-end touch display products for the global industrial market.
(www.jutouch.com)

Add a vendor prefix for it.

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20250821-v6-17-topic-imx8mp-skov-dts-jutouch-10inch-v1-1-b492ef807d12@pengutronix.de
2 months agodrm/hypervdrm: Use vblank timer
Thomas Zimmermann [Tue, 16 Sep 2025 08:36:22 +0000 (10:36 +0200)] 
drm/hypervdrm: Use vblank timer

HyperV's virtual hardware does not provide vblank interrupts. Use a
vblank timer to simulate the interrupt. Rate-limits the display's
update frequency to the display-mode settings. Avoids excessive CPU
overhead with compositors that do not rate-limit their output.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Tested-by: Michael Kelley <mhklinux@outlook.com>
Tested-by: Prasanna Kumar T S M <ptsm@linux.microsoft.com>
Link: https://lore.kernel.org/r/20250916083816.30275-5-tzimmermann@suse.de
2 months agodrm/vkms: Convert to DRM's vblank timer
Thomas Zimmermann [Tue, 16 Sep 2025 08:36:21 +0000 (10:36 +0200)] 
drm/vkms: Convert to DRM's vblank timer

Replace vkms' vblank timer with the DRM implementation. The DRM
code is identical in concept, but differs in implementation.

Vblank timers are covered in vblank helpers and initializer macros,
so remove the corresponding hrtimer in struct vkms_output. The
vblank timer calls vkms' custom timeout code via handle_vblank_timeout
in struct drm_crtc_helper_funcs.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Tested-by: Louis Chauvet <louis.chauvet@bootlin.com>
Reviewed-by: Louis Chauvet <louis.chauvet@bootlin.com>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://lore.kernel.org/r/20250916083816.30275-4-tzimmermann@suse.de
2 months agodrm/vblank: Add CRTC helpers for simple use cases
Thomas Zimmermann [Tue, 16 Sep 2025 08:36:20 +0000 (10:36 +0200)] 
drm/vblank: Add CRTC helpers for simple use cases

Implement atomic_flush, atomic_enable and atomic_disable of struct
drm_crtc_helper_funcs for vblank handling. Driver with no further
requirements can use these functions instead of adding their own.
Also simplifies the use of vblank timers.

The code has been adopted from vkms, which added the funtionality
in commit 3a0709928b17 ("drm/vkms: Add vblank events simulated by
hrtimers").

v3:
- mention vkms (Javier)
v2:
- fix docs

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Tested-by: Michael Kelley <mhklinux@outlook.com>
Link: https://lore.kernel.org/r/20250916083816.30275-3-tzimmermann@suse.de
2 months agodrm/vblank: Add vblank timer
Thomas Zimmermann [Tue, 16 Sep 2025 08:36:19 +0000 (10:36 +0200)] 
drm/vblank: Add vblank timer

The vblank timer simulates a vblank interrupt for hardware without
support. Rate-limits the display update frequency.

DRM drivers for hardware without vblank support apply display updates
ASAP. A vblank event informs DRM clients of the completed update.
Userspace compositors immediately schedule the next update, which
creates significant load on virtualization outputs. Display updates
are usually fast on virtualization outputs, as their framebuffers are
in regular system memory and there's no hardware vblank interrupt to
throttle the update rate.

The vblank timer is a HR timer that signals the vblank in software.
It limits the update frequency of a DRM driver similar to a hardware
vblank interrupt. The timer is not synchronized to the actual vblank
interval of the display.

The code has been adopted from vkms, which added the funtionality
in commit 3a0709928b17 ("drm/vkms: Add vblank events simulated by
hrtimers").

The new implementation is part of the existing vblank support,
which sets up the timer automatically. Drivers only have to start
and cancel the vblank timer as part of enabling and disabling the
CRTC. The new vblank helper library provides callbacks for struct
drm_crtc_funcs.

The standard way for handling vblank is to call drm_crtc_handle_vblank().
Drivers that require additional processing, such as vkms, can init
handle_vblank_timeout in struct drm_crtc_helper_funcs to refer to
their timeout handler.

There's a possible deadlock between drm_crtc_handle_vblank() and
hrtimer_cancel(). [1] The implementation avoids to call hrtimer_cancel()
directly and instead signals to the timer function to not restart
itself.

v4:
- fix possible race condition between timeout and atomic commit (Michael)
v3:
- avoid deadlock when cancelling timer (Ville, Lyude)
v2:
- implement vblank timer entirely in vblank helpers
- downgrade overrun warning to debug
- fix docs

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Tested-by: Louis Chauvet <louis.chauvet@bootlin.com>
Reviewed-by: Louis Chauvet <louis.chauvet@bootlin.com>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Tested-by: Michael Kelley <mhklinux@outlook.com>
Link: https://lore.kernel.org/all/20250510094757.4174662-1-zengheng4@huawei.com/
Link: https://lore.kernel.org/r/20250916083816.30275-2-tzimmermann@suse.de
2 months agodrm/tidss: crtc: Cleanup reset implementation
Maxime Ripard [Tue, 2 Sep 2025 08:32:50 +0000 (10:32 +0200)] 
drm/tidss: crtc: Cleanup reset implementation

The tidss_crtc_reset() function will (rightfully) destroy any
pre-existing state.

However, the tidss CRTC driver has its own CRTC state structure that
subclasses drm_crtc_state, and yet will destroy the previous state
by calling __drm_atomic_helper_crtc_destroy_state() and kfree() on its
drm_crtc_state pointer.

It works only because the drm_crtc_state is the first field in the
structure, and thus its offset is 0. It's incredibly fragile however, so
let's call our destroy implementation in such a case to deal with it
properly.

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://lore.kernel.org/r/20250902-drm-state-readout-v1-22-14ad5315da3f@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
Link: https://lore.kernel.org/r/20250902-drm-state-readout-v1-22-14ad5315da3f@kernel.org
2 months agodrm/tidss: crtc: Implement destroy_state
Maxime Ripard [Tue, 2 Sep 2025 08:32:49 +0000 (10:32 +0200)] 
drm/tidss: crtc: Implement destroy_state

The tidss crtc driver implements its own state, with its own
implementation of reset and duplicate_state, but uses the default
destroy_state helper.

This somewhat works for now because the drm_crtc_state field in
tidss_crtc_state is the first field so the offset is 0, but it's pretty
fragile and it should really have its own destroy_state implementation.

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://lore.kernel.org/r/20250902-drm-state-readout-v1-21-14ad5315da3f@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
Link: https://lore.kernel.org/r/20250902-drm-state-readout-v1-21-14ad5315da3f@kernel.org
2 months agodrm/tidss: crtc: Change variable name
Maxime Ripard [Tue, 2 Sep 2025 08:32:48 +0000 (10:32 +0200)] 
drm/tidss: crtc: Change variable name

The tidss_crtc_reset() function stores a pointer to struct
tidss_crtc_state in a variable called tcrtc, while it uses tcrtc as a
pointer to struct tidss_crtc in the rest of the driver.

This is confusing, so let's change the variable name.

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://lore.kernel.org/r/20250902-drm-state-readout-v1-20-14ad5315da3f@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
Link: https://lore.kernel.org/r/20250902-drm-state-readout-v1-20-14ad5315da3f@kernel.org
2 months agodrm/tidss: Remove ftrace-like logs
Maxime Ripard [Tue, 2 Sep 2025 08:32:47 +0000 (10:32 +0200)] 
drm/tidss: Remove ftrace-like logs

These logs don't really log any information and create checkpatch
warnings. Remove them.

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://lore.kernel.org/r/20250902-drm-state-readout-v1-19-14ad5315da3f@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
Link: https://lore.kernel.org/r/20250902-drm-state-readout-v1-19-14ad5315da3f@kernel.org
2 months agodrm/tidss: Convert to drm logging
Maxime Ripard [Tue, 2 Sep 2025 08:32:46 +0000 (10:32 +0200)] 
drm/tidss: Convert to drm logging

DRM drivers should prefer the drm logging functions to the dev logging
ones when possible. Let's convert the existing dev_* logs to their drm
counterparts.

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://lore.kernel.org/r/20250902-drm-state-readout-v1-18-14ad5315da3f@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
Link: https://lore.kernel.org/r/20250902-drm-state-readout-v1-18-14ad5315da3f@kernel.org
2 months agodrm/crtc: Drop no_vblank bit field
Maxime Ripard [Tue, 2 Sep 2025 08:32:39 +0000 (10:32 +0200)] 
drm/crtc: Drop no_vblank bit field

The no_vblank field in drm_crtc_state is defined as a bit-field with a
single bit.

This will create a syntax issue with the macros we'll introduce next,
and most other booleans but the *_changed ones in drm_crtc_state do not
use a bit field anyway.

Let's drop it.

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://lore.kernel.org/r/20250902-drm-state-readout-v1-11-14ad5315da3f@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
Link: https://lore.kernel.org/r/20250902-drm-state-readout-v1-11-14ad5315da3f@kernel.org
2 months agodrm/gma500: Remove unused helper psb_fbdev_fb_setcolreg()
Thomas Zimmermann [Mon, 29 Sep 2025 08:23:23 +0000 (10:23 +0200)] 
drm/gma500: Remove unused helper psb_fbdev_fb_setcolreg()

Remove psb_fbdev_fb_setcolreg(), which hasn't been called in almost
a decade.

Gma500 commit 4d8d096e9ae8 ("gma500: introduce the framebuffer support
code") added the helper psb_fbdev_fb_setcolreg() for setting the fbdev
palette via fbdev's fb_setcolreg callback. Later
commit 3da6c2f3b730 ("drm/gma500: use DRM_FB_HELPER_DEFAULT_OPS for
fb_ops") set several default helpers for fbdev emulation, including
fb_setcmap.

The fbdev subsystem always prefers fb_setcmap over fb_setcolreg. [1]
Hence, the gma500 code is no longer in use and gma500 has been using
drm_fb_helper_setcmap() for several years without issues.

Fixes: 3da6c2f3b730 ("drm/gma500: use DRM_FB_HELPER_DEFAULT_OPS for fb_ops")
Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Cc: Stefan Christ <contact@stefanchrist.eu>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org
Cc: <stable@vger.kernel.org> # v4.10+
Link: https://elixir.bootlin.com/linux/v6.16.9/source/drivers/video/fbdev/core/fbcmap.c#L246
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Link: https://lore.kernel.org/r/20250929082338.18845-1-tzimmermann@suse.de
2 months agodrm/xlnx: Compute dumb-buffer sizes with drm_mode_size_dumb()
Thomas Zimmermann [Thu, 21 Aug 2025 08:17:32 +0000 (10:17 +0200)] 
drm/xlnx: Compute dumb-buffer sizes with drm_mode_size_dumb()

Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and
buffer size. Align the pitch according to hardware requirements.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://lore.kernel.org/r/20250821081918.79786-26-tzimmermann@suse.de
2 months agodrm/xe: Compute dumb-buffer sizes with drm_mode_size_dumb()
Thomas Zimmermann [Thu, 21 Aug 2025 08:17:30 +0000 (10:17 +0200)] 
drm/xe: Compute dumb-buffer sizes with drm_mode_size_dumb()

Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch
and buffer size. Align the pitch to a multiple of 8. Align the
buffer size according to hardware requirements.

Xe's internal calculation allowed for 64-bit wide buffer sizes, but
the ioctl's internal checks always verified against 32-bit wide limits.
Hance, it is safe to limit the driver code to 32-bit calculations as
well.

v3:
- mention 32-bit calculation in commit description (Matthew)

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Acked-by: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://lore.kernel.org/r/20250821081918.79786-24-tzimmermann@suse.de
2 months agodrm/vmwgfx: Compute dumb-buffer sizes with drm_mode_size_dumb()
Thomas Zimmermann [Thu, 21 Aug 2025 08:17:29 +0000 (10:17 +0200)] 
drm/vmwgfx: Compute dumb-buffer sizes with drm_mode_size_dumb()

Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch
and buffer size. No alignment required.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Zack Rusin <zack.rusin@broadcom.com>
Cc: Zack Rusin <zack.rusin@broadcom.com>
Cc: Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>
Link: https://lore.kernel.org/r/20250821081918.79786-23-tzimmermann@suse.de
2 months agodrm/tegra: Compute dumb-buffer sizes with drm_mode_size_dumb()
Thomas Zimmermann [Thu, 21 Aug 2025 08:17:27 +0000 (10:17 +0200)] 
drm/tegra: Compute dumb-buffer sizes with drm_mode_size_dumb()

Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and
buffer size. Align the pitch according to hardware requirements.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Thierry Reding <treding@nvidia.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Mikko Perttunen <mperttunen@nvidia.com>
Link: https://lore.kernel.org/r/20250821081918.79786-21-tzimmermann@suse.de
2 months agodrm/rockchip: Compute dumb-buffer sizes with drm_mode_size_dumb()
Thomas Zimmermann [Thu, 21 Aug 2025 08:17:26 +0000 (10:17 +0200)] 
drm/rockchip: Compute dumb-buffer sizes with drm_mode_size_dumb()

Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and
buffer size. Align the pitch to a multiple of 64.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Heiko Stuebner <heiko@sntech.de>
Cc: Sandy Huang <hjc@rock-chips.com>
Cc: "Heiko Stübner" <heiko@sntech.de>
Cc: Andy Yan <andy.yan@rock-chips.com>
Link: https://lore.kernel.org/r/20250821081918.79786-20-tzimmermann@suse.de
2 months agodrm/renesas/rcar-du: Compute dumb-buffer sizes with drm_mode_size_dumb()
Thomas Zimmermann [Thu, 21 Aug 2025 08:17:24 +0000 (10:17 +0200)] 
drm/renesas/rcar-du: Compute dumb-buffer sizes with drm_mode_size_dumb()

Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and
buffer size. Align the pitch according to hardware requirements.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Link: https://lore.kernel.org/r/20250821081918.79786-18-tzimmermann@suse.de
2 months agodrm/omapdrm: Compute dumb-buffer sizes with drm_mode_size_dumb()
Thomas Zimmermann [Thu, 21 Aug 2025 08:17:22 +0000 (10:17 +0200)] 
drm/omapdrm: Compute dumb-buffer sizes with drm_mode_size_dumb()

Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and
buffer size. Align the pitch to a multiple of 8.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://lore.kernel.org/r/20250821081918.79786-16-tzimmermann@suse.de
2 months agodrm/nouveau: Compute dumb-buffer sizes with drm_mode_size_dumb()
Thomas Zimmermann [Thu, 21 Aug 2025 08:17:21 +0000 (10:17 +0200)] 
drm/nouveau: Compute dumb-buffer sizes with drm_mode_size_dumb()

Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and
buffer size. Align the pitch to a multiple of 256.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Cc: Karol Herbst <kherbst@redhat.com>
Cc: Lyude Paul <lyude@redhat.com>
Cc: Danilo Krummrich <dakr@kernel.org>
Link: https://lore.kernel.org/r/20250821081918.79786-15-tzimmermann@suse.de
2 months agodrm/msm: Compute dumb-buffer sizes with drm_mode_size_dumb()
Thomas Zimmermann [Thu, 21 Aug 2025 08:17:20 +0000 (10:17 +0200)] 
drm/msm: Compute dumb-buffer sizes with drm_mode_size_dumb()

Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch
and buffer size. Alignment is specified in bytes, but the hardware
requires the scanline pitch to be a multiple of 32 pixels. Therefore
compute the byte size of 32 pixels in the given color mode and align
the pitch accordingly. This replaces the existing code in the driver's
align_pitch() helper.

v3:
- clarify pitch alignment in commit message (Dmitry)

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: Rob Clark <robdclark@gmail.com>
Cc: Abhinav Kumar <quic_abhinavk@quicinc.com>
Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: Sean Paul <sean@poorly.run>
Cc: Marijn Suijten <marijn.suijten@somainline.org>
Link: https://lore.kernel.org/r/20250821081918.79786-14-tzimmermann@suse.de
2 months agodrm/loongson: Compute dumb-buffer sizes with drm_mode_size_dumb()
Thomas Zimmermann [Thu, 21 Aug 2025 08:17:18 +0000 (10:17 +0200)] 
drm/loongson: Compute dumb-buffer sizes with drm_mode_size_dumb()

Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and
buffer size. Align the pitch according to hardware requirements.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Sui Jingfeng <sui.jingfeng@linux.dev>
Cc: Sui Jingfeng <sui.jingfeng@linux.dev>
Link: https://lore.kernel.org/r/20250821081918.79786-12-tzimmermann@suse.de
2 months agodrm/imx/ipuv3: Compute dumb-buffer sizes with drm_mode_size_dumb()
Thomas Zimmermann [Thu, 21 Aug 2025 08:17:17 +0000 (10:17 +0200)] 
drm/imx/ipuv3: Compute dumb-buffer sizes with drm_mode_size_dumb()

Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and
buffer size. The hardware requires the framebuffer width to be a
multiple of 8. The scanline pitch has to be large enough to support
this. Therefore compute the byte size of 8 pixels in the given color
mode and align the pitch accordingly.

v5:
- fix typo in commit description

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
Cc: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20250821081918.79786-11-tzimmermann@suse.de
2 months agodrm/exynos: Compute dumb-buffer sizes with drm_mode_size_dumb()
Thomas Zimmermann [Thu, 21 Aug 2025 08:17:14 +0000 (10:17 +0200)] 
drm/exynos: Compute dumb-buffer sizes with drm_mode_size_dumb()

Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and
buffer size. No alignment required.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Inki Dae <inki.dae@samsung.com>
Cc: Seung-Woo Kim <sw0312.kim@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Krzysztof Kozlowski <krzk@kernel.org>
Cc: Alim Akhtar <alim.akhtar@samsung.com>
Acked-by: Inki Dae <inki.dae@samsung.com>
Link: https://lore.kernel.org/r/20250821081918.79786-8-tzimmermann@suse.de
2 months agodrm/gem-shmem: Compute dumb-buffer sizes with drm_mode_size_dumb()
Thomas Zimmermann [Thu, 21 Aug 2025 08:17:11 +0000 (10:17 +0200)] 
drm/gem-shmem: Compute dumb-buffer sizes with drm_mode_size_dumb()

Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and
buffer size. Align the pitch to a multiple of 8.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://lore.kernel.org/r/20250821081918.79786-5-tzimmermann@suse.de
2 months agodrm/gem-dma: Compute dumb-buffer sizes with drm_mode_size_dumb()
Thomas Zimmermann [Thu, 21 Aug 2025 08:17:10 +0000 (10:17 +0200)] 
drm/gem-dma: Compute dumb-buffer sizes with drm_mode_size_dumb()

Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and
buffer size. Align the pitch to a multiple of 8.

Push the current calculation into the only direct caller imx. Imx's
hardware requires the framebuffer width to be aligned to 8. The
driver's current approach is actually incorrect, as it only guarantees
this implicitly and requires bpp to be a multiple of 8 already. A
later commit will fix this problem by aligning the scanline pitch
such that an aligned width still fits into each scanline's memory.

A number of other drivers are build on top of gem-dma helpers and
implement their own dumb-buffer allocation. These drivers invoke
drm_gem_dma_dumb_create_internal(), which is not affected by this
commit.

v5:
- avoid reset of arguments (Tomi)

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://lore.kernel.org/r/20250821081918.79786-4-tzimmermann@suse.de
2 months agodrm/dumb-buffers: Provide helper to set pitch and size
Thomas Zimmermann [Thu, 21 Aug 2025 08:17:09 +0000 (10:17 +0200)] 
drm/dumb-buffers: Provide helper to set pitch and size

Add drm_modes_size_dumb(), a helper to calculate the dumb-buffer
scanline pitch and allocation size. Implementations of struct
drm_driver.dumb_create can call the new helper for their size
computations.

There is currently quite a bit of code duplication among DRM's
memory managers. Each calculates scanline pitch and buffer size
from the given arguments, but the implementations are inconsistent
in how they treat alignment and format support. Later patches will
unify this code on top of drm_mode_size_dumb() as much as possible.

drm_mode_size_dumb() uses existing 4CC format helpers to interpret
the given color mode. This makes the dumb-buffer interface behave
similar the kernel's video= parameter. Current per-driver implementations
again likely have subtle differences or bugs in how they support color
modes.

The dumb-buffer UAPI is only specified for known color modes. These
values describe linear, single-plane RGB color formats or legacy index
formats. Other values should not be specified. But some user space
still does. So for unknown color modes, there are a number of known
exceptions for which drm_mode_size_dumb() calculates the pitch from
the bpp value, as before. All other values work the same but print
an error.

v6:
- document additional use cases for DUMB_CREATE2 in TODO list (Tomi)
- fix typos in documentation (Tomi)
v5:
- check for overflows with check_mul_overflow() (Tomi)
v4:
- use %u conversion specifier (Geert)
- list DRM_FORMAT_Dn in UAPI docs (Geert)
- avoid dmesg spamming with drm_warn_once() (Sima)
- add more information about bpp special case (Sima)
- clarify parameters for hardware alignment
- add a TODO item for DUMB_CREATE2
v3:
- document the UAPI semantics
- compute scanline pitch from for unknown color modes (Andy, Tomi)

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://lore.kernel.org/r/20250821081918.79786-3-tzimmermann@suse.de
2 months agodrm/dumb-buffers: Sanitize output on errors
Thomas Zimmermann [Thu, 21 Aug 2025 08:17:08 +0000 (10:17 +0200)] 
drm/dumb-buffers: Sanitize output on errors

The ioctls MODE_CREATE_DUMB and MODE_MAP_DUMB return results into a
memory buffer supplied by user space. On errors, it is possible that
intermediate values are being returned. The exact semantics depends
on the DRM driver's implementation of these ioctls. Although this is
most-likely not a security problem in practice, avoid any uncertainty
by clearing the memory to 0 on errors.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://lore.kernel.org/r/20250821081918.79786-2-tzimmermann@suse.de
2 months agodrm/ast: Remove generic device initialization
Thomas Zimmermann [Mon, 22 Sep 2025 08:36:12 +0000 (10:36 +0200)] 
drm/ast: Remove generic device initialization

The code in ast_main.c has been split into several helpers in
other source files. Delete the source file. With the generic
device init gone, fail probing on unknown hardware generations.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://lore.kernel.org/r/20250922083708.45564-13-tzimmermann@suse.de
2 months agodrm/ast: Move Gen7 device initialization into separate helper
Thomas Zimmermann [Mon, 22 Sep 2025 08:36:11 +0000 (10:36 +0200)] 
drm/ast: Move Gen7 device initialization into separate helper

Split off device initialization for Gen7 hardware into the helpers
ast_2600_device_create() and ast_2600_detect_wide_screen(). The new
functions are duplicates of their counterparts in ast_main.c, but
stripped from most non-Gen7 support.

Simplifies maintenance as the driver's number of supported hardware
generations grows.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://lore.kernel.org/r/20250922083708.45564-12-tzimmermann@suse.de
2 months agodrm/ast: Move Gen6 device initialization into separate helper
Thomas Zimmermann [Mon, 22 Sep 2025 08:36:10 +0000 (10:36 +0200)] 
drm/ast: Move Gen6 device initialization into separate helper

Split off device initialization for Gen6 hardware into the helpers
ast_2500_device_create() and ast_2500_detect_wide_screen(). The new
functions are duplicates of their counterparts in ast_main.c, but
stripped from most non-Gen6 support.

Simplifies maintenance as the driver's number of supported hardware
generations grows.

v2:
- simplify widescreen-detection logic

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://lore.kernel.org/r/20250922083708.45564-11-tzimmermann@suse.de
2 months agodrm/ast: Move Gen5 device initialization into separate helper
Thomas Zimmermann [Mon, 22 Sep 2025 08:36:09 +0000 (10:36 +0200)] 
drm/ast: Move Gen5 device initialization into separate helper

Split off device initialization for Gen5 hardware into the helpers
ast_2400_device_create() and ast_2400_detect_wide_screen(). The new
functions are duplicates of their counterparts in ast_main.c, but
stripped from most non-Gen5 support.

Simplifies maintenance as the driver's number of supported hardware
generations grows.

v2:
- simplify widescreen-detection logic

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://lore.kernel.org/r/20250922083708.45564-10-tzimmermann@suse.de
2 months agodrm/ast: Move Gen4 device initialization into separate helper
Thomas Zimmermann [Mon, 22 Sep 2025 08:36:08 +0000 (10:36 +0200)] 
drm/ast: Move Gen4 device initialization into separate helper

Split off device initialization for Gen4 hardware into the helpers
ast_2300_device_create() and ast_2300_detect_wide_screen(). The new
functions are duplicates of their counterparts in ast_main.c, but
stripped from most non-Gen4 support.

Simplifies maintenance as the driver's number of supported hardware
generations grows.

v2:
- simplify widescreen-detection logic

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://lore.kernel.org/r/20250922083708.45564-9-tzimmermann@suse.de
2 months agodrm/ast: Move Gen3 device initialization into separate helper
Thomas Zimmermann [Mon, 22 Sep 2025 08:36:07 +0000 (10:36 +0200)] 
drm/ast: Move Gen3 device initialization into separate helper

Split off device initialization for Gen3 hardware into the helpers
ast_2200_device_create() and ast_2200_detect_wide_screen(). The new
functions are duplicates of their counterparts in ast_main.c, but
stripped from most non-Gen3 support.

Simplifies maintenance as the driver's number of supported hardware
generations grows.

v2:
- simplify widescreen-detection logic

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://lore.kernel.org/r/20250922083708.45564-8-tzimmermann@suse.de
2 months agodrm/ast: Move Gen2 device initialization into separate helper
Thomas Zimmermann [Mon, 22 Sep 2025 08:36:06 +0000 (10:36 +0200)] 
drm/ast: Move Gen2 device initialization into separate helper

Split off device initialization for Gen2 hardware into the helpers
ast_2100_device_create() and ast_2100_detect_wide_screen(). The new
functions are duplicates of their counterparts in ast_main.c, but
stripped from most non-Gen2 support.

Simplifies maintenance as the driver's number of supported hardware
generations grows.

v2:
- simplify widescreen-detection logic (Jocelyn)

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://lore.kernel.org/r/20250922083708.45564-7-tzimmermann@suse.de
2 months agodrm/ast: Move Gen1 device initialization into separate helper
Thomas Zimmermann [Mon, 22 Sep 2025 08:36:05 +0000 (10:36 +0200)] 
drm/ast: Move Gen1 device initialization into separate helper

Split off device initialization for Gen1 hardware into the helper
ast_2000_device_create(). The new function is a duplicate of their
counterpart in ast_main.c, but stripped from most non-Gen1 support.

Simplifies maintenance as the driver's number of supported hardware
generations grows.

v2:
- remove unnecessary widescreen-detection logic

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://lore.kernel.org/r/20250922083708.45564-6-tzimmermann@suse.de
2 months agodrm/ast: Prepare per-Gen device initialization
Thomas Zimmermann [Mon, 22 Sep 2025 08:36:04 +0000 (10:36 +0200)] 
drm/ast: Prepare per-Gen device initialization

Switch device creation by hardware Gen. Return the value from the
call to ast_detect_chip(). All generations are still initialized
by ast_device_create().

Also add ast_device_init() for setting some common fields in struct
ast_device.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://lore.kernel.org/r/20250922083708.45564-5-tzimmermann@suse.de
2 months agodrm/ast: Split ast_detect_tx_chip() per chip generation
Thomas Zimmermann [Mon, 22 Sep 2025 08:36:03 +0000 (10:36 +0200)] 
drm/ast: Split ast_detect_tx_chip() per chip generation

Gen4 and later models detect the TX chip from VGACRD1, while earlier
models detect from VGACRA3. Split up the detection helper into
two separate helpers. Use SZ_ constants instead of plain numbers.

Then inline the call into its only caller ast_device_create(). When
ast_device_create() gets split up per Gen, either call will remain.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://lore.kernel.org/r/20250922083708.45564-4-tzimmermann@suse.de
2 months agodrm/ast: Move mode-detection helpers to Gen2 source files
Thomas Zimmermann [Mon, 22 Sep 2025 08:36:02 +0000 (10:36 +0200)] 
drm/ast: Move mode-detection helpers to Gen2 source files

Wide-screen modes are only available on Gen2 and later. Move the
detection helpers to the appropriate source file.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://lore.kernel.org/r/20250922083708.45564-3-tzimmermann@suse.de
2 months agodrm/ast: Move display-clock tables to per-Gen source files
Thomas Zimmermann [Mon, 22 Sep 2025 08:36:01 +0000 (10:36 +0200)] 
drm/ast: Move display-clock tables to per-Gen source files

Move display-clock tables to the appropriate per-Gen source files.
The tables are almost identical, except for mode entries 0x17 and
0x1a. Rename to tables to match common style.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://lore.kernel.org/r/20250922083708.45564-2-tzimmermann@suse.de
2 months agodrm/bridge: imx: add driver for HDMI TX Parallel Audio Interface
Shengjiu Wang [Tue, 23 Sep 2025 05:29:59 +0000 (13:29 +0800)] 
drm/bridge: imx: add driver for HDMI TX Parallel Audio Interface

The HDMI TX Parallel Audio Interface (HTX_PAI) is a digital module that
acts as the bridge between the Audio Subsystem to the HDMI TX Controller.
This IP block is found in the HDMI subsystem of the i.MX8MP SoC.

Data received from the audio subsystem can have an arbitrary component
ordering. The HTX_PAI block has integrated muxing options to select which
sections of the 32-bit input data word will be mapped to each IEC60958
field. The HTX_PAI_FIELD_CTRL register contains mux selects to
individually select P,C,U,V,Data, and Preamble.

Use component helper so that imx8mp-hdmi-tx will be aggregate driver,
imx8mp-hdmi-pai will be component driver, then imx8mp-hdmi-pai can use
bind() ops to get the plat_data from imx8mp-hdmi-tx device.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Liu Ying <victor.liu@nxp.com>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Liu Ying <victor.liu@nxp.com>
Link: https://lore.kernel.org/r/20250923053001.2678596-6-shengjiu.wang@nxp.com
2 months agodrm/bridge: dw-hdmi: Add API dw_hdmi_set_sample_iec958() for iec958 format
Shengjiu Wang [Tue, 23 Sep 2025 05:29:58 +0000 (13:29 +0800)] 
drm/bridge: dw-hdmi: Add API dw_hdmi_set_sample_iec958() for iec958 format

Add API dw_hdmi_set_sample_iec958() for IEC958 format because audio device
driver needs IEC958 information to configure this specific setting.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Liu Ying <victor.liu@nxp.com>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Liu Ying <victor.liu@nxp.com>
Link: https://lore.kernel.org/r/20250923053001.2678596-5-shengjiu.wang@nxp.com
2 months agodrm/bridge: dw-hdmi: Add API dw_hdmi_to_plat_data() to get plat_data
Shengjiu Wang [Tue, 23 Sep 2025 05:29:57 +0000 (13:29 +0800)] 
drm/bridge: dw-hdmi: Add API dw_hdmi_to_plat_data() to get plat_data

Add API dw_hdmi_to_plat_data() to fetch plat_data because audio device
driver needs it to enable(disable)_audio().

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Liu Ying <victor.liu@nxp.com>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Liu Ying <victor.liu@nxp.com>
Link: https://lore.kernel.org/r/20250923053001.2678596-4-shengjiu.wang@nxp.com
2 months agoALSA: Add definitions for the bits in IEC958 subframe
Shengjiu Wang [Tue, 23 Sep 2025 05:29:56 +0000 (13:29 +0800)] 
ALSA: Add definitions for the bits in IEC958 subframe

The IEC958 subframe format SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE are used
in HDMI and DisplayPort to describe the audio stream, but hardware device
may need to reorder the IEC958 bits for internal transmission, so need
these standard bits definitions for IEC958 subframe format.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Liu Ying <victor.liu@nxp.com>
Link: https://lore.kernel.org/r/20250923053001.2678596-3-shengjiu.wang@nxp.com