aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorJon Medhurst <tixy@linaro.org>2017-04-11 17:30:58 +0100
committerJon Medhurst <tixy@linaro.org>2017-04-11 17:30:58 +0100
commit71afea5c1f09e8aca8d5adeb166f47416d6c5daa (patch)
tree412ea236d2ac3a8bc5eefda20aff10c0e5f26c20 /drivers/gpu
parent457349a00449a9554151368e1dbdecf64c847219 (diff)
parentcecbf98dc56b51bf2b3055ad9e53f43e30e93939 (diff)
Merge branch '4.4-armlt' into lsk-4.4-armltlsk-4.4-armlt-20170411
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/arm/hdlcd_crtc.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/gpu/drm/arm/hdlcd_crtc.c b/drivers/gpu/drm/arm/hdlcd_crtc.c
index aa435cb06a21..6c0e0a5fe447 100644
--- a/drivers/gpu/drm/arm/hdlcd_crtc.c
+++ b/drivers/gpu/drm/arm/hdlcd_crtc.c
@@ -141,6 +141,8 @@ static int hdlcd_crtc_colour_set(struct hdlcd_drm_private *hdlcd,
{
unsigned int depth, bpp;
unsigned int default_color = 0x00000000;
+ bool swap_red_blue = false;
+ u32 hbi;
struct simplefb_format *format = NULL;
int i;
@@ -175,7 +177,16 @@ static int hdlcd_crtc_colour_set(struct hdlcd_drm_private *hdlcd,
* pixel is outside the visible frame area or when there is a
* buffer underrun.
*/
- if(!config_enabled(CONFIG_ARM)) {
+ if (of_property_read_u32(of_root, "arm,hbi", &hbi) == 0) {
+ /*
+ * This is a hack to swap read and blue when building for some
+ * Versatile Express CoreTiles because they seem to be wired up
+ * differently.
+ */
+ if (hbi == 0x249) /* TC2 */
+ swap_red_blue = true;
+ }
+ if(!swap_red_blue) {
hdlcd_write(hdlcd, HDLCD_REG_RED_SELECT, default_color |
format->red.offset | (format->red.length & 0xf) << 8);
hdlcd_write(hdlcd, HDLCD_REG_GREEN_SELECT, default_color |