[Letux-kernel] [RFC 24/28] drm/ingenic: fix assignment of DMA channels

H. Nikolaus Schaller hns at goldelico.com
Sat Jan 23 17:28:50 CET 2021


For SoC without OSD like jz4730 and jz4740, the first DMA channel
is used for a single LCD. If we leave the first uninitialized, the
LCDC will not become enabled.

So we must make sure that F0 + F1 is used only for OSD capable SoC
and F0 otherwise.

Tested on jz4730 and jz4780.

Fixes: 174d8e52a60f19 ("drm/ingenic: Alloc F0 and F1 DMA descriptors at once")
Signed-off-by: H. Nikolaus Schaller <hns at goldelico.com>
---
 drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
index 9cf3079a1c2e4..b86fbb2a27302 100644
--- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
+++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
@@ -555,10 +555,10 @@ static void ingenic_drm_plane_atomic_update(struct drm_plane *plane,
 		height = state->src_h >> 16;
 		cpp = state->fb->format->cpp[0];
 
-		if (priv->soc_info->has_osd && plane->type == DRM_PLANE_TYPE_OVERLAY)
-			hwdesc = &priv->dma_hwdescs->hwdesc_f0;
-		else
+		if (priv->soc_info->has_osd && plane->type != DRM_PLANE_TYPE_OVERLAY)
 			hwdesc = &priv->dma_hwdescs->hwdesc_f1;
+		else
+			hwdesc = &priv->dma_hwdescs->hwdesc_f0;
 
 		hwdesc->addr = addr;
 		hwdesc->cmd = JZ_LCD_CMD_EOF_IRQ | (width * height * cpp / 4);
-- 
2.26.2



More information about the Letux-kernel mailing list