ARM HDLCD: Add developer option to remove double-height framebuffers
authorChris Redpath <chris.redpath@arm.com>
Thu, 12 Jul 2012 11:33:13 +0000 (12:33 +0100)
committerJon Medhurst <tixy@linaro.org>
Mon, 1 Jul 2013 10:04:25 +0000 (11:04 +0100)
This option can be used with Android to push the graphics subsystem into a
different composition strategy which is more effective when used on hardware
where the framebuffer memory is not cacheable.

Signed-off-by: Chris Redpath <chris.redpath@arm.com>
drivers/video/arm-hdlcd.c
include/linux/arm-hdlcd.h

index f16bb882e0c5fd2604b89007a5de2a039adde85b..9600c70209b268d2d84e229bd7c4db70d3c48b23 100644 (file)
@@ -205,7 +205,11 @@ static int hdlcd_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
        struct hdlcd_device *hdlcd = to_hdlcd_device(info);
        int bytes_per_pixel = var->bits_per_pixel / 8;
 
+#ifdef HDLCD_NO_VIRTUAL_SCREEN
+       var->yres_virtual = var->yres;
+#else
        var->yres_virtual = 2 * var->yres;
+#endif
 
        if ((var->xres_virtual * bytes_per_pixel * var->yres_virtual) > hdlcd->fb.fix.smem_len)
                return -ENOMEM;
@@ -570,7 +574,11 @@ static int hdlcd_setup(struct hdlcd_device *hdlcd)
                hdlcd->fb.var.yres, hdlcd->fb.var.bits_per_pixel,
                hdlcd->fb.mode ? hdlcd->fb.mode->refresh : 60);
        hdlcd->fb.var.xres_virtual      = hdlcd->fb.var.xres;
+#ifdef HDLCD_NO_VIRTUAL_SCREEN
+       hdlcd->fb.var.yres_virtual      = hdlcd->fb.var.yres;
+#else
        hdlcd->fb.var.yres_virtual      = hdlcd->fb.var.yres * 2;
+#endif
 
        /* initialise and set the palette */
        if (fb_alloc_cmap(&hdlcd->fb.cmap, NR_PALETTE, 0)) {
index f3f4887ac4fad5c6dc90352cf23c50b54be4c150..124995aa34f50da2ce8dac70b205b8f649972eb2 100644 (file)
  * and /proc/hdlcd_underrun to read the counter
  */
 //#define HDLCD_COUNT_BUFFERUNDERRUNS
+/* Restrict height to 1x screen size
+ *
+ */
+//#define HDLCD_NO_VIRTUAL_SCREEN
 
 struct hdlcd_device {
        struct fb_info          fb;