aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/omap
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2011-11-15 09:37:53 -0500
committerTomi Valkeinen <tomi.valkeinen@ti.com>2011-12-02 01:54:44 -0500
commitaaa874a985158383c4b394c687c716ef26288741 (patch)
treeedbed62510d56becac3a15bebe4fb86fdd21c756 /drivers/media/video/omap
parent43a972d96b6ea2b9e3d6b55b9724c9f61d802c68 (diff)
OMAPDSS: APPLY: rewrite overlay enable/disable
Overlays are currently enabled and disabled with a boolean in the struct omap_overlay_info. The overlay info is set with ovl->set_overlay_info(), and made into use with mgr->apply(). This doesn't work properly, as the enable/disable status may affect also other overlays, for example when using fifo-merge. Thus the enabling and disabling of the overlay needs to be done outside the normal overlay configuration. This patch achieves that by doing the following things: 1) Add function pointers to struct omap_overlay: enable(), disable() and is_enabled(). These are used to do the obvious. The functions may block. 2) Move the "enabled" field from struct omap_overlay to ovl_priv_data. 3) Add a new route for settings to be applied to the HW, called "extra_info". The status of the normal info and extra_info are tracked separately. The point here is to allow the normal info to be changed and applied in non-blocking matter, whereas the extra_info can only be changed when holding the mutex. This makes it possible to, for example, set the overlay enable flag, apply it, and wait until the HW has taken the flag into use. This is not possible if the enable flag would be in the normal info, as a new value for the flag could be set at any time from the users of omapdss. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/media/video/omap')
-rw-r--r--drivers/media/video/omap/omap_vout.c33
1 files changed, 15 insertions, 18 deletions
diff --git a/drivers/media/video/omap/omap_vout.c b/drivers/media/video/omap/omap_vout.c
index 9c5c19f142d..27c19fe7868 100644
--- a/drivers/media/video/omap/omap_vout.c
+++ b/drivers/media/video/omap/omap_vout.c
@@ -423,7 +423,7 @@ static int omapvid_setup_overlay(struct omap_vout_device *vout,
423 "%s enable=%d addr=%x width=%d\n height=%d color_mode=%d\n" 423 "%s enable=%d addr=%x width=%d\n height=%d color_mode=%d\n"
424 "rotation=%d mirror=%d posx=%d posy=%d out_width = %d \n" 424 "rotation=%d mirror=%d posx=%d posy=%d out_width = %d \n"
425 "out_height=%d rotation_type=%d screen_width=%d\n", 425 "out_height=%d rotation_type=%d screen_width=%d\n",
426 __func__, info.enabled, info.paddr, info.width, info.height, 426 __func__, ovl->is_enabled(ovl), info.paddr, info.width, info.height,
427 info.color_mode, info.rotation, info.mirror, info.pos_x, 427 info.color_mode, info.rotation, info.mirror, info.pos_x,
428 info.pos_y, info.out_width, info.out_height, info.rotation_type, 428 info.pos_y, info.out_width, info.out_height, info.rotation_type,
429 info.screen_width); 429 info.screen_width);
@@ -942,12 +942,8 @@ static int omap_vout_release(struct file *file)
942 /* Disable all the overlay managers connected with this interface */ 942 /* Disable all the overlay managers connected with this interface */
943 for (i = 0; i < ovid->num_overlays; i++) { 943 for (i = 0; i < ovid->num_overlays; i++) {
944 struct omap_overlay *ovl = ovid->overlays[i]; 944 struct omap_overlay *ovl = ovid->overlays[i];
945 if (ovl->manager && ovl->manager->device) { 945 if (ovl->manager && ovl->manager->device)
946 struct omap_overlay_info info; 946 ovl->disable(ovl);
947 ovl->get_overlay_info(ovl, &info);
948 info.enabled = 0;
949 ovl->set_overlay_info(ovl, &info);
950 }
951 } 947 }
952 /* Turn off the pipeline */ 948 /* Turn off the pipeline */
953 ret = omapvid_apply_changes(vout); 949 ret = omapvid_apply_changes(vout);
@@ -1667,7 +1663,6 @@ static int vidioc_streamon(struct file *file, void *fh, enum v4l2_buf_type i)
1667 if (ovl->manager && ovl->manager->device) { 1663 if (ovl->manager && ovl->manager->device) {
1668 struct omap_overlay_info info; 1664 struct omap_overlay_info info;
1669 ovl->get_overlay_info(ovl, &info); 1665 ovl->get_overlay_info(ovl, &info);
1670 info.enabled = 1;
1671 info.paddr = addr; 1666 info.paddr = addr;
1672 if (ovl->set_overlay_info(ovl, &info)) { 1667 if (ovl->set_overlay_info(ovl, &info)) {
1673 ret = -EINVAL; 1668 ret = -EINVAL;
@@ -1686,6 +1681,16 @@ static int vidioc_streamon(struct file *file, void *fh, enum v4l2_buf_type i)
1686 if (ret) 1681 if (ret)
1687 v4l2_err(&vout->vid_dev->v4l2_dev, "failed to change mode\n"); 1682 v4l2_err(&vout->vid_dev->v4l2_dev, "failed to change mode\n");
1688 1683
1684 for (j = 0; j < ovid->num_overlays; j++) {
1685 struct omap_overlay *ovl = ovid->overlays[j];
1686
1687 if (ovl->manager && ovl->manager->device) {
1688 ret = ovl->enable(ovl);
1689 if (ret)
1690 goto streamon_err1;
1691 }
1692 }
1693
1689 ret = 0; 1694 ret = 0;
1690 1695
1691streamon_err1: 1696streamon_err1:
@@ -1715,16 +1720,8 @@ static int vidioc_streamoff(struct file *file, void *fh, enum v4l2_buf_type i)
1715 for (j = 0; j < ovid->num_overlays; j++) { 1720 for (j = 0; j < ovid->num_overlays; j++) {
1716 struct omap_overlay *ovl = ovid->overlays[j]; 1721 struct omap_overlay *ovl = ovid->overlays[j];
1717 1722
1718 if (ovl->manager && ovl->manager->device) { 1723 if (ovl->manager && ovl->manager->device)
1719 struct omap_overlay_info info; 1724 ovl->disable(ovl);
1720
1721 ovl->get_overlay_info(ovl, &info);
1722 info.enabled = 0;
1723 ret = ovl->set_overlay_info(ovl, &info);
1724 if (ret)
1725 v4l2_err(&vout->vid_dev->v4l2_dev,
1726 "failed to update overlay info in streamoff\n");
1727 }
1728 } 1725 }
1729 1726
1730 /* Turn of the pipeline */ 1727 /* Turn of the pipeline */