aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/dss/dispc.c
diff options
context:
space:
mode:
authorRajkumar N <rajkumar.nagarajan@ti.com>2010-11-04 07:28:42 -0400
committerTomi Valkeinen <tomi.valkeinen@nokia.com>2011-01-10 03:54:19 -0500
commitfd28a39071cee34ec59021f620f6dfca5f89ac9b (patch)
treeac843761a351f9abcb034b7d1cb2a6c0a902d1aa /drivers/video/omap2/dss/dispc.c
parent8fbde10aff726c9b5a1a2fe878a072b937d32476 (diff)
OMAP3630: DSS2: Enable Pre-Multiplied Alpha Support
Enable dss to process color formats with pre-mulitplied alpha. With this we can have alpha values defined for each pixel and hence can have different blending values for each pixel. sysfs entry has been created for this and pre-multiplied alpha support is turned off by default. Signed-off-by: Sudeep Basavaraj <sudeep.basavaraj@ti.com> Signed-off-by: Rajkumar N <rajkumar.nagarajan@ti.com> Signed-off-by: Samreen <samreen@ti.com> Signed-off-by: Archit Taneja <archit@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Diffstat (limited to 'drivers/video/omap2/dss/dispc.c')
-rw-r--r--drivers/video/omap2/dss/dispc.c30
1 files changed, 23 insertions, 7 deletions
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 4e04a73a8ff3..54ba8d3ad317 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -773,13 +773,26 @@ static void _dispc_set_vid_size(enum omap_plane plane, int width, int height)
773 dispc_write_reg(vsi_reg[plane-1], val); 773 dispc_write_reg(vsi_reg[plane-1], val);
774} 774}
775 775
776static void _dispc_set_pre_mult_alpha(enum omap_plane plane, bool enable)
777{
778 if (!dss_has_feature(FEAT_PRE_MULT_ALPHA))
779 return;
780
781 if (!dss_has_feature(FEAT_GLOBAL_ALPHA_VID1) &&
782 plane == OMAP_DSS_VIDEO1)
783 return;
784
785 REG_FLD_MOD(dispc_reg_att[plane], enable ? 1 : 0, 28, 28);
786}
787
776static void _dispc_setup_global_alpha(enum omap_plane plane, u8 global_alpha) 788static void _dispc_setup_global_alpha(enum omap_plane plane, u8 global_alpha)
777{ 789{
778 if (!dss_has_feature(FEAT_GLOBAL_ALPHA)) 790 if (!dss_has_feature(FEAT_GLOBAL_ALPHA))
779 return; 791 return;
780 792
781 BUG_ON(!dss_has_feature(FEAT_GLOBAL_ALPHA_VID1) && 793 if (!dss_has_feature(FEAT_GLOBAL_ALPHA_VID1) &&
782 plane == OMAP_DSS_VIDEO1); 794 plane == OMAP_DSS_VIDEO1)
795 return;
783 796
784 if (plane == OMAP_DSS_GFX) 797 if (plane == OMAP_DSS_GFX)
785 REG_FLD_MOD(DISPC_GLOBAL_ALPHA, global_alpha, 7, 0); 798 REG_FLD_MOD(DISPC_GLOBAL_ALPHA, global_alpha, 7, 0);
@@ -1507,7 +1520,8 @@ static int _dispc_setup_plane(enum omap_plane plane,
1507 bool ilace, 1520 bool ilace,
1508 enum omap_dss_rotation_type rotation_type, 1521 enum omap_dss_rotation_type rotation_type,
1509 u8 rotation, int mirror, 1522 u8 rotation, int mirror,
1510 u8 global_alpha) 1523 u8 global_alpha,
1524 u8 pre_mult_alpha)
1511{ 1525{
1512 const int maxdownscale = cpu_is_omap34xx() ? 4 : 2; 1526 const int maxdownscale = cpu_is_omap34xx() ? 4 : 2;
1513 bool five_taps = 0; 1527 bool five_taps = 0;
@@ -1693,8 +1707,8 @@ static int _dispc_setup_plane(enum omap_plane plane,
1693 1707
1694 _dispc_set_rotation_attrs(plane, rotation, mirror, color_mode); 1708 _dispc_set_rotation_attrs(plane, rotation, mirror, color_mode);
1695 1709
1696 if (plane != OMAP_DSS_VIDEO1) 1710 _dispc_set_pre_mult_alpha(plane, pre_mult_alpha);
1697 _dispc_setup_global_alpha(plane, global_alpha); 1711 _dispc_setup_global_alpha(plane, global_alpha);
1698 1712
1699 return 0; 1713 return 0;
1700} 1714}
@@ -3138,7 +3152,8 @@ int dispc_setup_plane(enum omap_plane plane,
3138 enum omap_color_mode color_mode, 3152 enum omap_color_mode color_mode,
3139 bool ilace, 3153 bool ilace,
3140 enum omap_dss_rotation_type rotation_type, 3154 enum omap_dss_rotation_type rotation_type,
3141 u8 rotation, bool mirror, u8 global_alpha) 3155 u8 rotation, bool mirror, u8 global_alpha,
3156 u8 pre_mult_alpha)
3142{ 3157{
3143 int r = 0; 3158 int r = 0;
3144 3159
@@ -3160,7 +3175,8 @@ int dispc_setup_plane(enum omap_plane plane,
3160 color_mode, ilace, 3175 color_mode, ilace,
3161 rotation_type, 3176 rotation_type,
3162 rotation, mirror, 3177 rotation, mirror,
3163 global_alpha); 3178 global_alpha,
3179 pre_mult_alpha);
3164 3180
3165 enable_clocks(0); 3181 enable_clocks(0);
3166 3182