aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel/linux/linux-omap-2.6.29/dss2/0040-DSS2-Provided-proper-exclusion-for-destination-colo.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-kernel/linux/linux-omap-2.6.29/dss2/0040-DSS2-Provided-proper-exclusion-for-destination-colo.patch')
-rw-r--r--meta/recipes-kernel/linux/linux-omap-2.6.29/dss2/0040-DSS2-Provided-proper-exclusion-for-destination-colo.patch97
1 files changed, 97 insertions, 0 deletions
diff --git a/meta/recipes-kernel/linux/linux-omap-2.6.29/dss2/0040-DSS2-Provided-proper-exclusion-for-destination-colo.patch b/meta/recipes-kernel/linux/linux-omap-2.6.29/dss2/0040-DSS2-Provided-proper-exclusion-for-destination-colo.patch
new file mode 100644
index 0000000000..66be75f3f7
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-omap-2.6.29/dss2/0040-DSS2-Provided-proper-exclusion-for-destination-colo.patch
@@ -0,0 +1,97 @@
+From a5129f272a48aa22629137c9c31e60eddb8c3f5d Mon Sep 17 00:00:00 2001
+From: Hardik Shah <hardik.shah@ti.com>
+Date: Fri, 17 Apr 2009 14:24:46 +0530
+Subject: [PATCH] DSS2: Provided proper exclusion for destination color keying and alpha blending.
+
+OMAP does not support destination color key and alpha blending
+simultaneously. So this patch does not allow the user
+so set both at a time.
+
+Signed-off-by: Hardik Shah <hardik.shah@ti.com>
+---
+ drivers/video/omap2/dss/manager.c | 50 ++++++++++++++++++++++++++++++++++++-
+ 1 files changed, 49 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
+index 7965a84..108489c 100644
+--- a/drivers/video/omap2/dss/manager.c
++++ b/drivers/video/omap2/dss/manager.c
+@@ -137,12 +137,26 @@ static ssize_t manager_color_key_type_store(struct omap_overlay_manager *mgr,
+ u32 key_value;
+
+ for (key_type = OMAP_DSS_COLOR_KEY_GFX_DST;
+- key_type < ARRAY_SIZE(color_key_type_str); key_type++) {
++ key_type < ARRAY_SIZE(color_key_type_str); key_type++) {
+ if (sysfs_streq(buf, color_key_type_str[key_type]))
+ break;
+ }
+ if (key_type == ARRAY_SIZE(color_key_type_str))
+ return -EINVAL;
++ /* OMAP does not support destination color key and alpha blending
++ * simultaneously. So if alpha blending and color keying both are
++ * enabled then refrain from setting the color key type to
++ * gfx-destination
++ */
++ if (!key_type) {
++ bool color_key_enabled;
++ bool alpha_blending_enabled;
++ color_key_enabled = mgr->get_trans_key_status(mgr);
++ alpha_blending_enabled = mgr->get_alpha_blending_status(mgr);
++ if (color_key_enabled && alpha_blending_enabled)
++ return -EINVAL;
++ }
++
+ mgr->get_trans_key_type_and_value(mgr, NULL, &key_value);
+ mgr->set_trans_key_type_and_value(mgr, key_type, key_value);
+
+@@ -188,6 +202,23 @@ static ssize_t manager_color_key_enabled_store(struct omap_overlay_manager *mgr,
+ if (sscanf(buf, "%d", &enable) != 1)
+ return -EINVAL;
+
++ /* OMAP does not support destination color keying and
++ * alpha blending simultaneously. so if alpha blending
++ * is enabled refrain from enabling destination color
++ * keying.
++ */
++ if (enable) {
++ bool enabled;
++ enabled = mgr->get_alpha_blending_status(mgr);
++ if (enabled) {
++ enum omap_dss_color_key_type key_type;
++ mgr->get_trans_key_type_and_value(mgr,
++ &key_type, NULL);
++ if (!key_type)
++ return -EINVAL;
++ }
++
++ }
+ mgr->enable_trans_key(mgr, enable);
+
+ return size;
+@@ -205,6 +236,23 @@ static ssize_t manager_alpha_blending_enabled_store(
+ int enable;
+ if (sscanf(buf, "%d", &enable) != 1)
+ return -EINVAL;
++ /* OMAP does not support destination color keying and
++ * alpha blending simultaneously. so if destination
++ * color keying is enabled refrain from enabling
++ * alpha blending
++ */
++ if (enable) {
++ bool enabled;
++ enabled = mgr->get_trans_key_status(mgr);
++ if (enabled) {
++ enum omap_dss_color_key_type key_type;
++ mgr->get_trans_key_type_and_value(mgr, &key_type, NULL);
++ if (!key_type)
++ return -EINVAL;
++
++ }
++
++ }
+ mgr->enable_alpha_blending(mgr, enable);
+ return size;
+ }
+--
+1.5.6.5
+