aboutsummaryrefslogtreecommitdiff
path: root/drivers/video
diff options
context:
space:
mode:
authorDietmar Eggemann <dietmar.eggemann@arm.com>2012-06-21 17:16:33 +0100
committerJon Medhurst <tixy@linaro.org>2013-07-01 11:04:24 +0100
commitf03c663576a50642f1e9f142627a86de61a6574e (patch)
tree69e6fa01c0435f2f44ae89b72944e6864c2dc5c2 /drivers/video
parent51f1911828c30b0ce27825452cef4db5a00edb07 (diff)
ARM HDLCD: Get it working under Android.
Add a shortcut when set_par is called to only change the yoffset. Android is doing that instead of calling pan_display to flip the framebuffer. Signed-off-by: Chris Redpath <chris.redpath@arm.com>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/arm-hdlcd.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/drivers/video/arm-hdlcd.c b/drivers/video/arm-hdlcd.c
index 948d41c1413..526d771db99 100644
--- a/drivers/video/arm-hdlcd.c
+++ b/drivers/video/arm-hdlcd.c
@@ -166,6 +166,11 @@ static int hdlcd_set_output_mode(int xres, int yres)
return set_dvi_mode(msgbuffer[0]);
}
+
+/* prototype */
+static int hdlcd_pan_display(struct fb_var_screeninfo *var,
+ struct fb_info *info);
+
#define WRITE_HDLCD_REG(reg, value) writel((value), hdlcd->base + (reg))
#define READ_HDLCD_REG(reg) readl(hdlcd->base + (reg))
@@ -174,9 +179,22 @@ static int hdlcd_set_par(struct fb_info *info)
struct hdlcd_device *hdlcd = to_hdlcd_device(info);
int bytes_per_pixel = hdlcd->fb.var.bits_per_pixel / 8;
int polarities;
-
- if (!memcmp(&info->var, &cached_var_screeninfo, sizeof(struct fb_var_screeninfo)))
+ int old_yoffset;
+
+ /* check for shortcuts */
+ old_yoffset = cached_var_screeninfo.yoffset;
+ cached_var_screeninfo.yoffset = info->var.yoffset;
+ if (!memcmp(&info->var, &cached_var_screeninfo,
+ sizeof(struct fb_var_screeninfo))) {
+ if(old_yoffset != info->var.yoffset) {
+ /* we only changed yoffset */
+ hdlcd_pan_display(&info->var, info);
+ memcpy(&cached_var_screeninfo, &info->var,
+ sizeof(struct fb_var_screeninfo));
+ }
+ /* or no change */
return 0;
+ }
hdlcd->fb.fix.line_length = hdlcd->fb.var.xres * bytes_per_pixel;