Skip to contentSkip to conversation

drm/imx: ipuv3: handle PRG channel configuration failure

PATCH New Osama Abdelkader 1 participant 1 message Jul 8

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 drm/imx: ipuv3: handle PRG channel configuration failure

ipu_prg_channel_configure() can fail when no PRE is available for the PRG channel, but ipu_plane_atomic_update() ignores its return value.

Atomic check is expected to prevent this condition. If it still happens, warn and abort the update instead of continuing with the original framebuffer address after the PRG/PRE setup failed.

Fixes 00514e859335 ("drm/imx: use PRG/PRE when possible")
---
 drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/gpu/drm/imx/ipuv3/ipuv3-plane.c +8 -4
index d6806d1ae6e1..78a3ea0581c0 100644
@@ -629,10 +629,14 @@ static void ipu_plane_atomic_update(struct drm_plane *plane,
 	 */
 	if (ipu_state->use_pre) {
 		axi_id = ipu_chan_assign_axi_id(ipu_plane->dma);
-		ipu_prg_channel_configure(ipu_plane->ipu_ch, axi_id, width,
-					  height, fb->pitches[0],
-					  fb->format->format, fb->modifier,
-					  &eba);
+		if (WARN_ON_ONCE(ipu_prg_channel_configure(ipu_plane->ipu_ch,
+							   axi_id, width,
+							   height,
+							   fb->pitches[0],
+							   fb->format->format,
+							   fb->modifier,
+							   &eba)))
+			return;
 	}
 
 	if (!old_state->fb ||
Signature · 1 line
2.43.0