diff options
author | Archit Taneja <archit@ti.com> | 2011-09-26 02:17:29 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2011-10-03 09:51:54 -0400 |
commit | 11354dd58da1134ec9c96b65104e5cf2d50e1eb9 (patch) | |
tree | a836cd3a6ece346f3cdad52f690ab4bfeba200ca /drivers/video/omap2/dss/manager.c | |
parent | 28748782b736b1a87bd1224d678e416a8375ea13 (diff) |
OMAPDSS/OMAP_VOUT: Fix incorrect OMAP3-alpha compatibility setting
On OMAP3, in order to enable alpha blending for LCD and TV managers, we needed
to set LCDALPHABLENDERENABLE/TVALPHABLENDERENABLE bits in DISPC_CONFIG. On
OMAP4, alpha blending is always enabled by default, if the above bits are set,
we switch to an OMAP3 compatibility mode where the zorder values in the pipeline
attribute registers are ignored and a fixed priority is configured.
Rename the manager_info member "alpha_enabled" to "partial_alpha_enabled" for
more clarity. Introduce two dss_features FEAT_ALPHA_FIXED_ZORDER and
FEAT_ALPHA_FREE_ZORDER which represent OMAP3-alpha compatibility mode and OMAP4
alpha mode respectively. Introduce an overlay cap for ZORDER. The DSS2 user is
expected to check for the ZORDER cap, if an overlay doesn't have this cap, the
user is expected to set the parameter partial_alpha_enabled. If the overlay has
ZORDER cap, the DSS2 user can assume that alpha blending is already enabled.
Don't support OMAP3 compatibility mode for now. Trying to read/write to
alpha_blending_enabled sysfs attribute issues a warning for OMAP4 and does not
set the LCDALPHABLENDERENABLE/TVALPHABLENDERENABLE bits.
Change alpha_enabled to partial_alpha_enabled in the omap_vout driver. Use
overlay cap "OMAP_DSS_OVL_CAP_GLOBAL_ALPHA" to check if overlay supports alpha
blending or not. Replace this with checks for VIDEO1 pipeline.
Cc: linux-media@vger.kernel.org
Cc: Lajos Molnar <molnar@ti.com>
Signed-off-by: Archit Taneja <archit@ti.com>
Acked-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2/dss/manager.c')
-rw-r--r-- | drivers/video/omap2/dss/manager.c | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c index fdbbeebcd75c..6e63845cc7d7 100644 --- a/drivers/video/omap2/dss/manager.c +++ b/drivers/video/omap2/dss/manager.c | |||
@@ -249,7 +249,10 @@ static ssize_t manager_trans_key_enabled_store(struct omap_overlay_manager *mgr, | |||
249 | static ssize_t manager_alpha_blending_enabled_show( | 249 | static ssize_t manager_alpha_blending_enabled_show( |
250 | struct omap_overlay_manager *mgr, char *buf) | 250 | struct omap_overlay_manager *mgr, char *buf) |
251 | { | 251 | { |
252 | return snprintf(buf, PAGE_SIZE, "%d\n", mgr->info.alpha_enabled); | 252 | WARN_ON(!dss_has_feature(FEAT_ALPHA_FIXED_ZORDER)); |
253 | |||
254 | return snprintf(buf, PAGE_SIZE, "%d\n", | ||
255 | mgr->info.partial_alpha_enabled); | ||
253 | } | 256 | } |
254 | 257 | ||
255 | static ssize_t manager_alpha_blending_enabled_store( | 258 | static ssize_t manager_alpha_blending_enabled_store( |
@@ -260,13 +263,15 @@ static ssize_t manager_alpha_blending_enabled_store( | |||
260 | bool enable; | 263 | bool enable; |
261 | int r; | 264 | int r; |
262 | 265 | ||
266 | WARN_ON(!dss_has_feature(FEAT_ALPHA_FIXED_ZORDER)); | ||
267 | |||
263 | r = strtobool(buf, &enable); | 268 | r = strtobool(buf, &enable); |
264 | if (r) | 269 | if (r) |
265 | return r; | 270 | return r; |
266 | 271 | ||
267 | mgr->get_manager_info(mgr, &info); | 272 | mgr->get_manager_info(mgr, &info); |
268 | 273 | ||
269 | info.alpha_enabled = enable; | 274 | info.partial_alpha_enabled = enable; |
270 | 275 | ||
271 | r = mgr->set_manager_info(mgr, &info); | 276 | r = mgr->set_manager_info(mgr, &info); |
272 | if (r) | 277 | if (r) |
@@ -966,7 +971,7 @@ static void configure_manager(enum omap_channel channel) | |||
966 | dispc_mgr_set_default_color(channel, mi->default_color); | 971 | dispc_mgr_set_default_color(channel, mi->default_color); |
967 | dispc_mgr_set_trans_key(channel, mi->trans_key_type, mi->trans_key); | 972 | dispc_mgr_set_trans_key(channel, mi->trans_key_type, mi->trans_key); |
968 | dispc_mgr_enable_trans_key(channel, mi->trans_enabled); | 973 | dispc_mgr_enable_trans_key(channel, mi->trans_enabled); |
969 | dispc_mgr_enable_alpha_blending(channel, mi->alpha_enabled); | 974 | dispc_mgr_enable_alpha_fixed_zorder(channel, mi->partial_alpha_enabled); |
970 | if (dss_has_feature(FEAT_CPR)) { | 975 | if (dss_has_feature(FEAT_CPR)) { |
971 | dispc_mgr_enable_cpr(channel, mi->cpr_enable); | 976 | dispc_mgr_enable_cpr(channel, mi->cpr_enable); |
972 | dispc_mgr_set_cpr_coef(channel, &mi->cpr_coefs); | 977 | dispc_mgr_set_cpr_coef(channel, &mi->cpr_coefs); |
@@ -1481,12 +1486,17 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr) | |||
1481 | 1486 | ||
1482 | static int dss_check_manager(struct omap_overlay_manager *mgr) | 1487 | static int dss_check_manager(struct omap_overlay_manager *mgr) |
1483 | { | 1488 | { |
1484 | /* OMAP supports only graphics source transparency color key and alpha | 1489 | if (dss_has_feature(FEAT_ALPHA_FIXED_ZORDER)) { |
1485 | * blending simultaneously. See TRM 15.4.2.4.2.2 Alpha Mode */ | 1490 | /* |
1486 | 1491 | * OMAP3 supports only graphics source transparency color key | |
1487 | if (mgr->info.alpha_enabled && mgr->info.trans_enabled && | 1492 | * and alpha blending simultaneously. See TRM 15.4.2.4.2.2 |
1488 | mgr->info.trans_key_type != OMAP_DSS_COLOR_KEY_GFX_DST) | 1493 | * Alpha Mode |
1489 | return -EINVAL; | 1494 | */ |
1495 | if (mgr->info.partial_alpha_enabled && mgr->info.trans_enabled | ||
1496 | && mgr->info.trans_key_type != | ||
1497 | OMAP_DSS_COLOR_KEY_GFX_DST) | ||
1498 | return -EINVAL; | ||
1499 | } | ||
1490 | 1500 | ||
1491 | return 0; | 1501 | return 0; |
1492 | } | 1502 | } |