diff mbox

OMAP: DSS2: Switching GFX from LCD to TV

Message ID FF55437E1F14DA4BAEB721A458B6701706BD9A44BC@dbde02.ent.ti.com (mailing list archive)
State New, archived
Delegated to: Tomi Valkeinen
Headers show

Commit Message

Nagarajan, Rajkumar June 16, 2010, 2:15 p.m. UTC
None
diff mbox

Patch

diff --git a/drivers/video/omap2/dss/overlay.c b/drivers/video/omap2/dss/overlay.c
index 8233658..4e9966f 100644
--- a/drivers/video/omap2/dss/overlay.c
+++ b/drivers/video/omap2/dss/overlay.c
@@ -117,6 +117,36 @@  static ssize_t overlay_input_size_show(struct omap_overlay *ovl, char *buf)
 			ovl->info.width, ovl->info.height);
 }
 
+static ssize_t overlay_input_size_store(struct omap_overlay *ovl,
+		const char *buf, size_t size)
+{
+	int r;
+	char *last;
+	struct omap_overlay_info info;
+
+	ovl->get_overlay_info(ovl, &info);
+
+	info.width = simple_strtoul(buf, &last, 10);
+	++last;
+	if (last - buf >= size)
+		return -EINVAL;
+
+	info.height = simple_strtoul(last, &last, 10);
+
+	r = ovl->set_overlay_info(ovl, &info);
+	if (r)
+		return r;
+
+	if (ovl->manager) {
+		r = ovl->manager->apply(ovl->manager);
+		if (r)
+			return r;
+	}
+
+	return size;
+}
+
+
 static ssize_t overlay_screen_width_show(struct omap_overlay *ovl, char *buf)
 {
 	return snprintf(buf, PAGE_SIZE, "%d\n", ovl->info.screen_width);
@@ -268,7 +298,8 @@  struct overlay_attribute {
 static OVERLAY_ATTR(name, S_IRUGO, overlay_name_show, NULL);
 static OVERLAY_ATTR(manager, S_IRUGO|S_IWUSR,
 		overlay_manager_show, overlay_manager_store);
-static OVERLAY_ATTR(input_size, S_IRUGO, overlay_input_size_show, NULL);
+static OVERLAY_ATTR(input_size, S_IRUGO|S_IWUSR,
+		overlay_input_size_show, overlay_input_size_store);
 static OVERLAY_ATTR(screen_width, S_IRUGO, overlay_screen_width_show, NULL);
 static OVERLAY_ATTR(position, S_IRUGO|S_IWUSR,
 		overlay_position_show, overlay_position_store);
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
index 4b4506d..73ecc9f 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -46,6 +46,8 @@  static char *def_vram;
 static int def_vrfb;
 static int def_rotate;
 static int def_mirror;
+unsigned int omapfb_size;
+module_param_named(fb_size, omapfb_size, int, 0644);
 
 #ifdef DEBUG
 unsigned int omapfb_debug;
@@ -1444,6 +1446,11 @@  static int omapfb_alloc_fbmem_display(struct fb_info *fbi, unsigned long size,
 		}
 	}
 
+	if (omapfb_size)	{
+		if (omapfb_size > size)
+			size = omapfb_size;
+	}
+
 	if (!size)
 		return 0;