Skip to content

Commit 6470b7d

Browse files
committed
drm/pl111: Handle the Versatile RGB/BGR565 mode
The ARM Versatile series can do RGB/BGR565 with an external "PLD" (Programmable Logical Device). However the CLCD does not have control bits for this, so it needs to be set into the ordinary 16BPP mode, then the RGB/BGR565 handling of the pixel data is handled by configuring the PLD through the external register. Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Linus Walleij <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 3d95f76 commit 6470b7d

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

drivers/gpu/drm/pl111/pl111_display.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,17 @@ static void pl111_display_enable(struct drm_simple_display_pipe *pipe,
199199
cntl |= CNTL_LCDBPP24 | CNTL_BGR;
200200
break;
201201
case DRM_FORMAT_BGR565:
202-
cntl |= CNTL_LCDBPP16_565;
202+
if (priv->variant->is_pl110)
203+
cntl |= CNTL_LCDBPP16;
204+
else
205+
cntl |= CNTL_LCDBPP16_565;
203206
break;
204207
case DRM_FORMAT_RGB565:
205-
cntl |= CNTL_LCDBPP16_565 | CNTL_BGR;
208+
if (priv->variant->is_pl110)
209+
cntl |= CNTL_LCDBPP16;
210+
else
211+
cntl |= CNTL_LCDBPP16_565;
212+
cntl |= CNTL_BGR;
206213
break;
207214
case DRM_FORMAT_ABGR1555:
208215
case DRM_FORMAT_XBGR1555:
@@ -226,6 +233,10 @@ static void pl111_display_enable(struct drm_simple_display_pipe *pipe,
226233
break;
227234
}
228235

236+
/* The PL110 in Integrator/Versatile does the BGR routing externally */
237+
if (priv->variant->external_bgr)
238+
cntl &= ~CNTL_BGR;
239+
229240
/* Power sequence: first enable and chill */
230241
writel(cntl, priv->regs + priv->ctrl);
231242

0 commit comments

Comments
 (0)