diff options
author | Archit Taneja <archit@ti.com> | 2011-09-08 01:59:17 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2011-10-03 09:51:55 -0400 |
commit | 54128701ecccbeb6f740030e0cc5f8e5701fe8ee (patch) | |
tree | d0c7e5fee25d9458f105acc20b5f4accc2d82bcd /drivers/video/omap2/dss/dispc.c | |
parent | b8c095b4d62f90ed8da0cca7116125863b1d8bef (diff) |
OMAPDSS: DISPC: zorder support for DSS overlays
Add zorder support on OMAP4, this feature allows deciding the visibility order
of the overlays based on the zorder value provided as an overlay info parameter
or a sysfs attribute of the overlay object.
Use the overlay cap OMAP_DSS_OVL_CAP_ZORDER to determine whether zorder is
supported for the overlay or not. Use dss feature FEAT_ALPHA_FREE_ZORDER
if the caps are not available.
Ensure that all overlays that are enabled and connected to the same manager
have different zorders. Swapping zorders of 2 enabled overlays currently
requires disabling one of the overlays.
Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2/dss/dispc.c')
-rw-r--r-- | drivers/video/omap2/dss/dispc.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c index fa7aadfec7b8..6892cfd2e3b7 100644 --- a/drivers/video/omap2/dss/dispc.c +++ b/drivers/video/omap2/dss/dispc.c | |||
@@ -739,6 +739,27 @@ static void dispc_ovl_set_vid_size(enum omap_plane plane, int width, int height) | |||
739 | dispc_write_reg(DISPC_OVL_SIZE(plane), val); | 739 | dispc_write_reg(DISPC_OVL_SIZE(plane), val); |
740 | } | 740 | } |
741 | 741 | ||
742 | static void dispc_ovl_set_zorder(enum omap_plane plane, u8 zorder) | ||
743 | { | ||
744 | struct omap_overlay *ovl = omap_dss_get_overlay(plane); | ||
745 | |||
746 | if ((ovl->caps & OMAP_DSS_OVL_CAP_ZORDER) == 0) | ||
747 | return; | ||
748 | |||
749 | REG_FLD_MOD(DISPC_OVL_ATTRIBUTES(plane), zorder, 27, 26); | ||
750 | } | ||
751 | |||
752 | static void dispc_ovl_enable_zorder_planes(void) | ||
753 | { | ||
754 | int i; | ||
755 | |||
756 | if (!dss_has_feature(FEAT_ALPHA_FREE_ZORDER)) | ||
757 | return; | ||
758 | |||
759 | for (i = 0; i < dss_feat_get_num_ovls(); i++) | ||
760 | REG_FLD_MOD(DISPC_OVL_ATTRIBUTES(i), 1, 25, 25); | ||
761 | } | ||
762 | |||
742 | static void dispc_ovl_set_pre_mult_alpha(enum omap_plane plane, bool enable) | 763 | static void dispc_ovl_set_pre_mult_alpha(enum omap_plane plane, bool enable) |
743 | { | 764 | { |
744 | struct omap_overlay *ovl = omap_dss_get_overlay(plane); | 765 | struct omap_overlay *ovl = omap_dss_get_overlay(plane); |
@@ -1866,6 +1887,7 @@ int dispc_ovl_setup(enum omap_plane plane, struct omap_overlay_info *oi, | |||
1866 | dispc_ovl_set_rotation_attrs(plane, oi->rotation, oi->mirror, | 1887 | dispc_ovl_set_rotation_attrs(plane, oi->rotation, oi->mirror, |
1867 | oi->color_mode); | 1888 | oi->color_mode); |
1868 | 1889 | ||
1890 | dispc_ovl_set_zorder(plane, oi->zorder); | ||
1869 | dispc_ovl_set_pre_mult_alpha(plane, oi->pre_mult_alpha); | 1891 | dispc_ovl_set_pre_mult_alpha(plane, oi->pre_mult_alpha); |
1870 | dispc_ovl_setup_global_alpha(plane, oi->global_alpha); | 1892 | dispc_ovl_setup_global_alpha(plane, oi->global_alpha); |
1871 | 1893 | ||
@@ -3317,6 +3339,8 @@ static void _omap_dispc_initial_config(void) | |||
3317 | dispc_read_plane_fifo_sizes(); | 3339 | dispc_read_plane_fifo_sizes(); |
3318 | 3340 | ||
3319 | dispc_configure_burst_sizes(); | 3341 | dispc_configure_burst_sizes(); |
3342 | |||
3343 | dispc_ovl_enable_zorder_planes(); | ||
3320 | } | 3344 | } |
3321 | 3345 | ||
3322 | /* DISPC HW IP initialisation */ | 3346 | /* DISPC HW IP initialisation */ |