aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Medhurst <tixy@linaro.org>2015-07-20 16:51:28 +0100
committerJon Medhurst <tixy@linaro.org>2017-04-03 11:59:00 +0100
commitffe909ab50baaddb627a3355accba053d0261331 (patch)
tree7eef20ed73a6c9a65a0a1e4d431191bd2ac115f4
parente605be96ce114707b0a448564f0c39adac97b677 (diff)
HACK: drm: hdlcd: Swap red and blue outputs on 32-bit ARM
To make display colours look right on Versatile Express Signed-off-by: Jon Medhurst <tixy@linaro.org>
-rw-r--r--drivers/gpu/drm/arm/hdlcd_crtc.c32
1 files changed, 24 insertions, 8 deletions
diff --git a/drivers/gpu/drm/arm/hdlcd_crtc.c b/drivers/gpu/drm/arm/hdlcd_crtc.c
index 20ebfb4fbdfa..34ce0dd7cabe 100644
--- a/drivers/gpu/drm/arm/hdlcd_crtc.c
+++ b/drivers/gpu/drm/arm/hdlcd_crtc.c
@@ -89,16 +89,32 @@ static int hdlcd_set_pxl_fmt(struct drm_crtc *crtc)
* pixel is outside the visible frame area or when there is a
* buffer underrun.
*/
- hdlcd_write(hdlcd, HDLCD_REG_RED_SELECT, format->red.offset |
+ if(!IS_ENABLED(CONFIG_ARM)) {
+ hdlcd_write(hdlcd, HDLCD_REG_RED_SELECT, format->red.offset |
#ifdef CONFIG_DRM_HDLCD_SHOW_UNDERRUN
- 0x00ff0000 | /* show underruns in red */
+ 0x00ff0000 | /* show underruns in red */
#endif
- ((format->red.length & 0xf) << 8));
- hdlcd_write(hdlcd, HDLCD_REG_GREEN_SELECT, format->green.offset |
- ((format->green.length & 0xf) << 8));
- hdlcd_write(hdlcd, HDLCD_REG_BLUE_SELECT, format->blue.offset |
- ((format->blue.length & 0xf) << 8));
-
+ ((format->red.length & 0xf) << 8));
+ hdlcd_write(hdlcd, HDLCD_REG_GREEN_SELECT, format->green.offset |
+ ((format->green.length & 0xf) << 8));
+ hdlcd_write(hdlcd, HDLCD_REG_BLUE_SELECT, format->blue.offset |
+ ((format->blue.length & 0xf) << 8));
+ } else {
+ /*
+ * This is a hack to swap read and blue when building for
+ * 32-bit ARM, because Versatile Express motherboard seems
+ * to be wired up differently.
+ */
+ hdlcd_write(hdlcd, HDLCD_REG_BLUE_SELECT, format->red.offset |
+#ifdef CONFIG_DRM_HDLCD_SHOW_UNDERRUN
+ 0x00ff0000 | /* show underruns in red */
+#endif
+ ((format->red.length & 0xf) << 8));
+ hdlcd_write(hdlcd, HDLCD_REG_GREEN_SELECT, format->green.offset |
+ ((format->green.length & 0xf) << 8));
+ hdlcd_write(hdlcd, HDLCD_REG_RED_SELECT, format->blue.offset |
+ ((format->blue.length & 0xf) << 8));
+ }
return 0;
}