Skip to contentSkip to conversation

OMAPDSS: OMAPFB: always allow to configure overlay

PATCH Superseded Grazvydas Ignotas 2 participants 3 messages May 4, 2012 – May 10, 2012 Framebuffer layer

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 OMAPDSS: OMAPFB: always allow to configure overlay

Currently when multiple overlays are active, OMAPFB_SETUP_PLANE fails. Instead of failing, allow it to configure the first overlay as if there was only one overlay, the remaining ones will have to be configured in other ways (sysfs).

This allows overlay-controlling programs (like video players) to function properly when framebuffer is cloned to another display (like TV).

---
 drivers/video/omap2/omapfb/omapfb-ioctl.c |   36 ++++++++++------------------
 1 files changed, 13 insertions(+), 23 deletions(-)
drivers/video/omap2/omapfb/omapfb-ioctl.c +13 -23
index 6a09ef8..58b7f2d 100644
@@ -70,11 +70,6 @@ static int omapfb_setup_plane(struct fb_info *fbi, struct omapfb_plane_info *pi)
 
 	DBG("omapfb_setup_plane\n");
 
-	if (ofbi->num_overlays != 1) {
-		r = -EINVAL;
-		goto out;
-	}
-
 	/* XXX uses only the first overlay */
 	ovl = ofbi->overlays[0];
 
@@ -184,25 +179,20 @@ static int omapfb_setup_plane(struct fb_info *fbi, struct omapfb_plane_info *pi)
 static int omapfb_query_plane(struct fb_info *fbi, struct omapfb_plane_info *pi)
 {
 	struct omapfb_info *ofbi = FB2OFB(fbi);
+	struct omap_overlay *ovl;
+	struct omap_overlay_info ovli;
 
-	if (ofbi->num_overlays != 1) {
-		memset(pi, 0, sizeof(*pi));
-	} else {
-		struct omap_overlay *ovl;
-		struct omap_overlay_info ovli;
-
-		ovl = ofbi->overlays[0];
-		ovl->get_overlay_info(ovl, &ovli);
-
-		pi->pos_x = ovli.pos_x;
-		pi->pos_y = ovli.pos_y;
-		pi->enabled = ovl->is_enabled(ovl);
-		pi->channel_out = 0; /* xxx */
-		pi->mirror = 0;
-		pi->mem_idx = get_mem_idx(ofbi);
-		pi->out_width = ovli.out_width;
-		pi->out_height = ovli.out_height;
-	}
+	ovl = ofbi->overlays[0];
+	ovl->get_overlay_info(ovl, &ovli);
+
+	pi->pos_x = ovli.pos_x;
+	pi->pos_y = ovli.pos_y;
+	pi->enabled = ovl->is_enabled(ovl);
+	pi->channel_out = 0; /* xxx */
+	pi->mirror = 0;
+	pi->mem_idx = get_mem_idx(ofbi);
+	pi->out_width = ovli.out_width;
+	pi->out_height = ovli.out_height;
 
 	return 0;
 }
Signature · 1 line
1.7.0.4
#1 lore raw
Quoted 18 lines · Grazvydas Ignotas

Currently when multiple overlays are active, OMAPFB_SETUP_PLANE fails. Instead of failing, allow it to configure the first overlay as if there was only one overlay, the remaining ones will have to be configured in other ways (sysfs).

This allows overlay-controlling programs (like video players) to function properly when framebuffer is cloned to another display (like TV).

---
 drivers/video/omap2/omapfb/omapfb-ioctl.c |   36 ++++++++++------------------
 1 files changed, 13 insertions(+), 23 deletions(-)
drivers/video/omap2/omapfb/omapfb-ioctl.c +0 -0
index 6a09ef8..58b7f2d 100644

drivers/video/omap2/omapfb/omapfb-ioctl.c static int omapfb_setup_plane(struct fb_info *fbi, struct omapfb_plane_info *pi) · line 74

Quoted 10 lines
drivers/video/omap2/omapfb/omapfb-ioctl.c +0 -5
@@ -70,11 +70,6 @@ static int omapfb_setup_plane(struct fb_info *fbi, struct omapfb_plane_info *pi)
 
 	DBG("omapfb_setup_plane\n");
 
-	if (ofbi->num_overlays != 1) {
-		r = -EINVAL;
-		goto out;
-	}
-
 	/* XXX uses only the first overlay */
 	ovl = ofbi->overlays[0];

What if there are no overlays? I'm not quite sure about it, but I think it's possible.

Tomi

#2 lore raw
In reply to Grazvydas Ignotas
Quoted 22 lines · Tomi Valkeinen
Quoted 21 lines · Grazvydas Ignotas

Currently when multiple overlays are active, OMAPFB_SETUP_PLANE fails. Instead of failing, allow it to configure the first overlay as if there was only one overlay, the remaining ones will have to be configured in other ways (sysfs).

This allows overlay-controlling programs (like video players) to function properly when framebuffer is cloned to another display (like TV).

---
 drivers/video/omap2/omapfb/omapfb-ioctl.c |   36 ++++++++++------------------

 1 files changed, 13 insertions(+), 23 deletions(-)
drivers/video/omap2/omapfb/omapfb-ioctl.c +0 -0
index 6a09ef8..58b7f2d 100644
@@ -70,11 +70,6 @@ static int omapfb_setup_plane(struct fb_info *fbi, struct omapfb_plane_info *pi)
 
       DBG("omapfb_setup_plane\n");
 
Quoted 10 lines

drivers/video/omap2/omapfb/omapfb-ioctl.c static int omapfb_setup_plane(struct fb_info *fbi, struct omapfb_plane_info *pi) · line 74

Quoted 7 lines
drivers/video/omap2/omapfb/omapfb-ioctl.c +0 -5
-     if (ofbi->num_overlays != 1) {
-             r = -EINVAL;
-             goto out;
-     }
-
       /* XXX uses only the first overlay */
       ovl = ofbi->overlays[0];

What if there are no overlays? I'm not quite sure about it, but I think it's possible.

Hmm, I guess you are right, will send v2.

Signature · 1 line
Gražvydas