diff options
author | Jon Medhurst <tixy@linaro.org> | 2017-04-10 14:40:23 +0100 |
---|---|---|
committer | Jon Medhurst <tixy@linaro.org> | 2017-04-11 17:06:53 +0100 |
commit | a6b44a3da71b299db2d7dc3a9f15e008a5643e2f (patch) | |
tree | 18c987b48c60c709d5afd5b524c85f5224f34252 /drivers/gpu | |
parent | 9818e36e1c9c310832e399aba30dec6251d42057 (diff) |
fixup! HACK: drm: hdlcd: Swap red and blue outputs on 32-bit ARM
Signed-off-by: Jon Medhurst <tixy@linaro.org>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/arm/hdlcd_crtc.c | 13 |
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 | |