Skip to content

Commit

Permalink
drm/pl111: Handle the Versatile RGB/BGR565 mode
Browse files Browse the repository at this point in the history
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]
  • Loading branch information
linusw committed Feb 7, 2018
1 parent 3d95f76 commit 6470b7d
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions drivers/gpu/drm/pl111/pl111_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,17 @@ static void pl111_display_enable(struct drm_simple_display_pipe *pipe,
cntl |= CNTL_LCDBPP24 | CNTL_BGR;
break;
case DRM_FORMAT_BGR565:
cntl |= CNTL_LCDBPP16_565;
if (priv->variant->is_pl110)
cntl |= CNTL_LCDBPP16;
else
cntl |= CNTL_LCDBPP16_565;
break;
case DRM_FORMAT_RGB565:
cntl |= CNTL_LCDBPP16_565 | CNTL_BGR;
if (priv->variant->is_pl110)
cntl |= CNTL_LCDBPP16;
else
cntl |= CNTL_LCDBPP16_565;
cntl |= CNTL_BGR;
break;
case DRM_FORMAT_ABGR1555:
case DRM_FORMAT_XBGR1555:
Expand All @@ -226,6 +233,10 @@ static void pl111_display_enable(struct drm_simple_display_pipe *pipe,
break;
}

/* The PL110 in Integrator/Versatile does the BGR routing externally */
if (priv->variant->external_bgr)
cntl &= ~CNTL_BGR;

/* Power sequence: first enable and chill */
writel(cntl, priv->regs + priv->ctrl);

Expand Down

0 comments on commit 6470b7d

Please sign in to comment.