* [PATCH v2 0/3] OMAPDSS: DISPC: VIDEO3 and ZORDER support
@ 2011-09-16 6:39 Archit Taneja
2011-09-16 6:39 ` [PATCH v2 1/3] OMAPDSS/OMAP_VOUT: Fix incorrect OMAP3-alpha compatibility setting Archit Taneja
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Archit Taneja @ 2011-09-16 6:39 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: hvaibhav, linux-omap, Archit Taneja
This contains support for VIDEO3 pipeline and zorder support for OMAP4 Display
controller.
This set originally had some more miscellaneous patches. Those patches have been
separated out and this set is created since it makes some trivial changes in the
omap_vout driver.
The patch set is based on Tomi's master branch. It can be tried on:
https://gitorious.org/~boddob/linux-omap-dss2/archit-dss2-clone/commits/dispc_misc
Tested on 4430sdp, 3430sdp.
Archit Taneja (3):
OMAPDSS/OMAP_VOUT: Fix incorrect OMAP3-alpha compatibility setting
OMAPDSS: DISPC: VIDEO3 pipeline support
OMAPDSS: DISPC: zorder support for DSS overlays
drivers/media/video/omap/omap_vout.c | 16 +++++--
drivers/video/omap2/dss/dispc.c | 65 ++++++++++++++++++++------
drivers/video/omap2/dss/dispc.h | 57 +++++++++++++++++++++++
drivers/video/omap2/dss/dss.h | 4 +-
drivers/video/omap2/dss/dss_features.c | 40 +++++++++++-----
drivers/video/omap2/dss/dss_features.h | 5 +-
drivers/video/omap2/dss/manager.c | 28 ++++++++----
drivers/video/omap2/dss/overlay.c | 77 ++++++++++++++++++++++++++++++++
include/video/omapdss.h | 9 +++-
9 files changed, 253 insertions(+), 48 deletions(-)
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 1/3] OMAPDSS/OMAP_VOUT: Fix incorrect OMAP3-alpha compatibility setting
2011-09-16 6:39 [PATCH v2 0/3] OMAPDSS: DISPC: VIDEO3 and ZORDER support Archit Taneja
@ 2011-09-16 6:39 ` Archit Taneja
2011-09-19 19:36 ` Hiremath, Vaibhav
2011-09-16 6:39 ` [PATCH v2 2/3] OMAPDSS: DISPC: VIDEO3 pipeline support Archit Taneja
2011-09-16 6:39 ` [PATCH v2 3/3] OMAPDSS: DISPC: zorder support for DSS overlays Archit Taneja
2 siblings, 1 reply; 8+ messages in thread
From: Archit Taneja @ 2011-09-16 6:39 UTC (permalink / raw)
To: tomi.valkeinen
Cc: hvaibhav, linux-omap, Archit Taneja, linux-media, Lajos Molnar
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 pipleine
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 int 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.
Initial patch was made by: Lajos Molnar <molnar@ti.com>
Cc: linux-media@vger.kernel.org
Cc: Lajos Molnar <molnar@ti.com>
Signed-off-by: Archit Taneja <archit@ti.com>
---
drivers/media/video/omap/omap_vout.c | 16 +++++++++++-----
drivers/video/omap2/dss/dispc.c | 24 ++++++++++++------------
drivers/video/omap2/dss/dss.h | 4 ++--
drivers/video/omap2/dss/dss_features.c | 22 +++++++++++-----------
drivers/video/omap2/dss/dss_features.h | 3 ++-
drivers/video/omap2/dss/manager.c | 28 +++++++++++++++++++---------
include/video/omapdss.h | 3 ++-
7 files changed, 59 insertions(+), 41 deletions(-)
diff --git a/drivers/media/video/omap/omap_vout.c b/drivers/media/video/omap/omap_vout.c
index b3a5ecd..95daf98 100644
--- a/drivers/media/video/omap/omap_vout.c
+++ b/drivers/media/video/omap/omap_vout.c
@@ -1165,12 +1165,17 @@ static int vidioc_try_fmt_vid_overlay(struct file *file, void *fh,
{
int ret = 0;
struct omap_vout_device *vout = fh;
+ struct omap_overlay *ovl;
+ struct omapvideo_info *ovid;
struct v4l2_window *win = &f->fmt.win;
+ ovid = &vout->vid_info;
+ ovl = ovid->overlays[0];
+
ret = omap_vout_try_window(&vout->fbuf, win);
if (!ret) {
- if (vout->vid == OMAP_VIDEO1)
+ if ((ovl->caps & OMAP_DSS_OVL_CAP_GLOBAL_ALPHA) == 0)
win->global_alpha = 255;
else
win->global_alpha = f->fmt.win.global_alpha;
@@ -1194,8 +1199,7 @@ static int vidioc_s_fmt_vid_overlay(struct file *file, void *fh,
ret = omap_vout_new_window(&vout->crop, &vout->win, &vout->fbuf, win);
if (!ret) {
- /* Video1 plane does not support global alpha */
- if (ovl->id == OMAP_DSS_VIDEO1)
+ if ((ovl->caps & OMAP_DSS_OVL_CAP_GLOBAL_ALPHA) == 0)
vout->win.global_alpha = 255;
else
vout->win.global_alpha = f->fmt.win.global_alpha;
@@ -1788,7 +1792,9 @@ static int vidioc_s_fbuf(struct file *file, void *fh,
if (ovl->manager && ovl->manager->get_manager_info &&
ovl->manager->set_manager_info) {
ovl->manager->get_manager_info(ovl->manager, &info);
- info.alpha_enabled = enable;
+ /* enable this only if there is no zorder cap */
+ if ((ovl->caps & OMAP_DSS_OVL_CAP_ZORDER) == 0)
+ info.partial_alpha_enabled = enable;
if (ovl->manager->set_manager_info(ovl->manager, &info))
return -EINVAL;
}
@@ -1820,7 +1826,7 @@ static int vidioc_g_fbuf(struct file *file, void *fh,
}
if (ovl->manager && ovl->manager->get_manager_info) {
ovl->manager->get_manager_info(ovl->manager, &info);
- if (info.alpha_enabled)
+ if (info.partial_alpha_enabled)
a->flags |= V4L2_FBUF_FLAG_LOCAL_ALPHA;
}
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 5e6849e..e0639d3 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -179,7 +179,8 @@ static void dispc_save_context(void)
SR(CONTROL);
SR(CONFIG);
SR(LINE_NUMBER);
- if (dss_has_feature(FEAT_GLOBAL_ALPHA))
+ if (dss_has_feature(FEAT_ALPHA_FIXED_ZORDER) ||
+ dss_has_feature(FEAT_ALPHA_FREE_ZORDER))
SR(GLOBAL_ALPHA);
if (dss_has_feature(FEAT_MGR_LCD2)) {
SR(CONTROL2);
@@ -293,7 +294,8 @@ static void dispc_restore_context(void)
/*RR(CONTROL);*/
RR(CONFIG);
RR(LINE_NUMBER);
- if (dss_has_feature(FEAT_GLOBAL_ALPHA))
+ if (dss_has_feature(FEAT_ALPHA_FIXED_ZORDER) ||
+ dss_has_feature(FEAT_ALPHA_FREE_ZORDER))
RR(GLOBAL_ALPHA);
if (dss_has_feature(FEAT_MGR_LCD2))
RR(CONFIG2);
@@ -2159,38 +2161,35 @@ void dispc_mgr_enable_trans_key(enum omap_channel ch, bool enable)
else /* OMAP_DSS_CHANNEL_LCD2 */
REG_FLD_MOD(DISPC_CONFIG2, enable, 10, 10);
}
-void dispc_mgr_enable_alpha_blending(enum omap_channel ch, bool enable)
+
+void dispc_mgr_enable_alpha_fixed_zorder(enum omap_channel ch, bool enable)
{
- if (!dss_has_feature(FEAT_GLOBAL_ALPHA))
+ if (!dss_has_feature(FEAT_ALPHA_FIXED_ZORDER))
return;
if (ch == OMAP_DSS_CHANNEL_LCD)
REG_FLD_MOD(DISPC_CONFIG, enable, 18, 18);
else if (ch == OMAP_DSS_CHANNEL_DIGIT)
REG_FLD_MOD(DISPC_CONFIG, enable, 19, 19);
- else /* OMAP_DSS_CHANNEL_LCD2 */
- REG_FLD_MOD(DISPC_CONFIG2, enable, 18, 18);
}
-bool dispc_mgr_alpha_blending_enabled(enum omap_channel ch)
+
+bool dispc_mgr_alpha_fixed_zorder_enabled(enum omap_channel ch)
{
bool enabled;
- if (!dss_has_feature(FEAT_GLOBAL_ALPHA))
+ if (!dss_has_feature(FEAT_ALPHA_FIXED_ZORDER))
return false;
if (ch == OMAP_DSS_CHANNEL_LCD)
enabled = REG_GET(DISPC_CONFIG, 18, 18);
else if (ch == OMAP_DSS_CHANNEL_DIGIT)
enabled = REG_GET(DISPC_CONFIG, 19, 19);
- else if (ch == OMAP_DSS_CHANNEL_LCD2)
- enabled = REG_GET(DISPC_CONFIG2, 18, 18);
else
BUG();
return enabled;
}
-
bool dispc_mgr_trans_key_enabled(enum omap_channel ch)
{
bool enabled;
@@ -2603,7 +2602,8 @@ void dispc_dump_regs(struct seq_file *s)
DUMPREG(DISPC_CAPABLE);
DUMPREG(DISPC_LINE_STATUS);
DUMPREG(DISPC_LINE_NUMBER);
- if (dss_has_feature(FEAT_GLOBAL_ALPHA))
+ if (dss_has_feature(FEAT_ALPHA_FIXED_ZORDER) ||
+ dss_has_feature(FEAT_ALPHA_FREE_ZORDER))
DUMPREG(DISPC_GLOBAL_ALPHA);
if (dss_has_feature(FEAT_MGR_LCD2)) {
DUMPREG(DISPC_CONTROL2);
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index 47eebd8..a37aef2 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -430,9 +430,9 @@ void dispc_mgr_get_trans_key(enum omap_channel ch,
enum omap_dss_trans_key_type *type,
u32 *trans_key);
void dispc_mgr_enable_trans_key(enum omap_channel ch, bool enable);
-void dispc_mgr_enable_alpha_blending(enum omap_channel ch, bool enable);
+void dispc_mgr_enable_alpha_fixed_zorder(enum omap_channel ch, bool enable);
bool dispc_mgr_trans_key_enabled(enum omap_channel ch);
-bool dispc_mgr_alpha_blending_enabled(enum omap_channel ch);
+bool dispc_mgr_alpha_fixed_zorder_enabled(enum omap_channel ch);
void dispc_mgr_set_lcd_timings(enum omap_channel channel,
struct omap_video_timings *timings);
void dispc_mgr_set_pol_freq(enum omap_channel channel,
diff --git a/drivers/video/omap2/dss/dss_features.c b/drivers/video/omap2/dss/dss_features.c
index 47e66d8..70d5b9e 100644
--- a/drivers/video/omap2/dss/dss_features.c
+++ b/drivers/video/omap2/dss/dss_features.c
@@ -248,15 +248,16 @@ static const enum omap_overlay_caps omap3630_dss_overlay_caps[] = {
static const enum omap_overlay_caps omap4_dss_overlay_caps[] = {
/* OMAP_DSS_GFX */
- OMAP_DSS_OVL_CAP_GLOBAL_ALPHA | OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA,
+ OMAP_DSS_OVL_CAP_GLOBAL_ALPHA | OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA |
+ OMAP_DSS_OVL_CAP_ZORDER,
/* OMAP_DSS_VIDEO1 */
OMAP_DSS_OVL_CAP_SCALE | OMAP_DSS_OVL_CAP_GLOBAL_ALPHA |
- OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA,
+ OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA | OMAP_DSS_OVL_CAP_ZORDER,
/* OMAP_DSS_VIDEO2 */
OMAP_DSS_OVL_CAP_SCALE | OMAP_DSS_OVL_CAP_GLOBAL_ALPHA |
- OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA,
+ OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA | OMAP_DSS_OVL_CAP_ZORDER,
};
static const char * const omap2_dss_clk_source_names[] = {
@@ -342,13 +343,13 @@ static const struct omap_dss_features omap3430_dss_features = {
.num_reg_fields = ARRAY_SIZE(omap3_dss_reg_fields),
.has_feature =
- FEAT_GLOBAL_ALPHA | FEAT_LCDENABLEPOL |
+ FEAT_LCDENABLEPOL |
FEAT_LCDENABLESIGNAL | FEAT_PCKFREEENABLE |
FEAT_FUNCGATED | FEAT_ROWREPEATENABLE |
FEAT_LINEBUFFERSPLIT | FEAT_RESIZECONF |
FEAT_DSI_PLL_FREQSEL | FEAT_DSI_REVERSE_TXCLKESC |
FEAT_VENC_REQUIRES_TV_DAC_CLK | FEAT_CPR | FEAT_PRELOAD |
- FEAT_FIR_COEF_V,
+ FEAT_FIR_COEF_V | FEAT_ALPHA_FIXED_ZORDER,
.num_mgrs = 2,
.num_ovls = 3,
@@ -366,13 +367,13 @@ static const struct omap_dss_features omap3630_dss_features = {
.num_reg_fields = ARRAY_SIZE(omap3_dss_reg_fields),
.has_feature =
- FEAT_GLOBAL_ALPHA | FEAT_LCDENABLEPOL |
+ FEAT_LCDENABLEPOL |
FEAT_LCDENABLESIGNAL | FEAT_PCKFREEENABLE |
FEAT_FUNCGATED |
FEAT_ROWREPEATENABLE | FEAT_LINEBUFFERSPLIT |
FEAT_RESIZECONF | FEAT_DSI_PLL_PWR_BUG |
FEAT_DSI_PLL_FREQSEL | FEAT_CPR | FEAT_PRELOAD |
- FEAT_FIR_COEF_V,
+ FEAT_FIR_COEF_V | FEAT_ALPHA_FIXED_ZORDER,
.num_mgrs = 2,
.num_ovls = 3,
@@ -392,12 +393,12 @@ static const struct omap_dss_features omap4430_es1_0_dss_features = {
.num_reg_fields = ARRAY_SIZE(omap4_dss_reg_fields),
.has_feature =
- FEAT_GLOBAL_ALPHA |
FEAT_MGR_LCD2 |
FEAT_CORE_CLK_DIV | FEAT_LCD_CLK_SRC |
FEAT_DSI_DCS_CMD_CONFIG_VC | FEAT_DSI_VC_OCP_WIDTH |
FEAT_DSI_GNQ | FEAT_HANDLE_UV_SEPARATE | FEAT_ATTR2 |
- FEAT_CPR | FEAT_PRELOAD | FEAT_FIR_COEF_V,
+ FEAT_CPR | FEAT_PRELOAD | FEAT_FIR_COEF_V |
+ FEAT_ALPHA_FREE_ZORDER,
.num_mgrs = 3,
.num_ovls = 3,
@@ -416,13 +417,12 @@ static const struct omap_dss_features omap4_dss_features = {
.num_reg_fields = ARRAY_SIZE(omap4_dss_reg_fields),
.has_feature =
- FEAT_GLOBAL_ALPHA |
FEAT_MGR_LCD2 |
FEAT_CORE_CLK_DIV | FEAT_LCD_CLK_SRC |
FEAT_DSI_DCS_CMD_CONFIG_VC | FEAT_DSI_VC_OCP_WIDTH |
FEAT_DSI_GNQ | FEAT_HDMI_CTS_SWMODE |
FEAT_HANDLE_UV_SEPARATE | FEAT_ATTR2 | FEAT_CPR |
- FEAT_PRELOAD | FEAT_FIR_COEF_V,
+ FEAT_PRELOAD | FEAT_FIR_COEF_V | FEAT_ALPHA_FREE_ZORDER,
.num_mgrs = 3,
.num_ovls = 3,
diff --git a/drivers/video/omap2/dss/dss_features.h b/drivers/video/omap2/dss/dss_features.h
index cd60644..e81271a 100644
--- a/drivers/video/omap2/dss/dss_features.h
+++ b/drivers/video/omap2/dss/dss_features.h
@@ -31,7 +31,6 @@
/* DSS has feature id */
enum dss_feat_id {
- FEAT_GLOBAL_ALPHA = 1 << 0,
FEAT_LCDENABLEPOL = 1 << 3,
FEAT_LCDENABLESIGNAL = 1 << 4,
FEAT_PCKFREEENABLE = 1 << 5,
@@ -57,6 +56,8 @@ enum dss_feat_id {
FEAT_CPR = 1 << 23,
FEAT_PRELOAD = 1 << 24,
FEAT_FIR_COEF_V = 1 << 25,
+ FEAT_ALPHA_FIXED_ZORDER = 1 << 26,
+ FEAT_ALPHA_FREE_ZORDER = 1 << 27,
};
/* DSS register field id */
diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
index fdbbeeb..6e63845 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,
static ssize_t manager_alpha_blending_enabled_show(
struct omap_overlay_manager *mgr, char *buf)
{
- return snprintf(buf, PAGE_SIZE, "%d\n", mgr->info.alpha_enabled);
+ WARN_ON(!dss_has_feature(FEAT_ALPHA_FIXED_ZORDER));
+
+ return snprintf(buf, PAGE_SIZE, "%d\n",
+ mgr->info.partial_alpha_enabled);
}
static ssize_t manager_alpha_blending_enabled_store(
@@ -260,13 +263,15 @@ static ssize_t manager_alpha_blending_enabled_store(
bool enable;
int r;
+ WARN_ON(!dss_has_feature(FEAT_ALPHA_FIXED_ZORDER));
+
r = strtobool(buf, &enable);
if (r)
return r;
mgr->get_manager_info(mgr, &info);
- info.alpha_enabled = enable;
+ info.partial_alpha_enabled = enable;
r = mgr->set_manager_info(mgr, &info);
if (r)
@@ -966,7 +971,7 @@ static void configure_manager(enum omap_channel channel)
dispc_mgr_set_default_color(channel, mi->default_color);
dispc_mgr_set_trans_key(channel, mi->trans_key_type, mi->trans_key);
dispc_mgr_enable_trans_key(channel, mi->trans_enabled);
- dispc_mgr_enable_alpha_blending(channel, mi->alpha_enabled);
+ dispc_mgr_enable_alpha_fixed_zorder(channel, mi->partial_alpha_enabled);
if (dss_has_feature(FEAT_CPR)) {
dispc_mgr_enable_cpr(channel, mi->cpr_enable);
dispc_mgr_set_cpr_coef(channel, &mi->cpr_coefs);
@@ -1481,12 +1486,17 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
static int dss_check_manager(struct omap_overlay_manager *mgr)
{
- /* OMAP supports only graphics source transparency color key and alpha
- * blending simultaneously. See TRM 15.4.2.4.2.2 Alpha Mode */
-
- if (mgr->info.alpha_enabled && mgr->info.trans_enabled &&
- mgr->info.trans_key_type != OMAP_DSS_COLOR_KEY_GFX_DST)
- return -EINVAL;
+ if (dss_has_feature(FEAT_ALPHA_FIXED_ZORDER)) {
+ /*
+ * OMAP3 supports only graphics source transparency color key
+ * and alpha blending simultaneously. See TRM 15.4.2.4.2.2
+ * Alpha Mode
+ */
+ if (mgr->info.partial_alpha_enabled && mgr->info.trans_enabled
+ && mgr->info.trans_key_type !=
+ OMAP_DSS_COLOR_KEY_GFX_DST)
+ return -EINVAL;
+ }
return 0;
}
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index c62b9a4..5f0ce5e 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -179,6 +179,7 @@ enum omap_overlay_caps {
OMAP_DSS_OVL_CAP_SCALE = 1 << 0,
OMAP_DSS_OVL_CAP_GLOBAL_ALPHA = 1 << 1,
OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA = 1 << 2,
+ OMAP_DSS_OVL_CAP_ZORDER = 1 << 3,
};
enum omap_overlay_manager_caps {
@@ -406,7 +407,7 @@ struct omap_overlay_manager_info {
u32 trans_key;
bool trans_enabled;
- bool alpha_enabled;
+ bool partial_alpha_enabled;
bool cpr_enable;
struct omap_dss_cpr_coefs cpr_coefs;
--
1.7.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 2/3] OMAPDSS: DISPC: VIDEO3 pipeline support
2011-09-16 6:39 [PATCH v2 0/3] OMAPDSS: DISPC: VIDEO3 and ZORDER support Archit Taneja
2011-09-16 6:39 ` [PATCH v2 1/3] OMAPDSS/OMAP_VOUT: Fix incorrect OMAP3-alpha compatibility setting Archit Taneja
@ 2011-09-16 6:39 ` Archit Taneja
2011-09-19 19:43 ` Hiremath, Vaibhav
2011-09-16 6:39 ` [PATCH v2 3/3] OMAPDSS: DISPC: zorder support for DSS overlays Archit Taneja
2 siblings, 1 reply; 8+ messages in thread
From: Archit Taneja @ 2011-09-16 6:39 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: hvaibhav, linux-omap, Archit Taneja
Add support for VIDEO3 pipeline on OMAP4:
- Add VIDEO3 pipeline information in dss_features and omapdss.h
- Add VIDEO3 pipeline register coefficients in dispc.h
- Create a new overlay structure corresponding to VIDEO3.
- Make changes in dispc.c for VIDEO3
Signed-off-by: Archit Taneja <archit@ti.com>
---
drivers/video/omap2/dss/dispc.c | 17 ++++++++--
drivers/video/omap2/dss/dispc.h | 57 ++++++++++++++++++++++++++++++++
drivers/video/omap2/dss/dss_features.c | 18 +++++++++-
drivers/video/omap2/dss/dss_features.h | 2 +-
drivers/video/omap2/dss/overlay.c | 5 +++
include/video/omapdss.h | 5 ++-
6 files changed, 97 insertions(+), 7 deletions(-)
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index e0639d3..fa7aadf 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -751,7 +751,7 @@ static void dispc_ovl_set_pre_mult_alpha(enum omap_plane plane, bool enable)
static void dispc_ovl_setup_global_alpha(enum omap_plane plane, u8 global_alpha)
{
- static const unsigned shifts[] = { 0, 8, 16, };
+ static const unsigned shifts[] = { 0, 8, 16, 24, };
int shift;
struct omap_overlay *ovl = omap_dss_get_overlay(plane);
@@ -866,6 +866,7 @@ static void dispc_ovl_set_channel_out(enum omap_plane plane,
break;
case OMAP_DSS_VIDEO1:
case OMAP_DSS_VIDEO2:
+ case OMAP_DSS_VIDEO3:
shift = 16;
break;
default:
@@ -903,7 +904,7 @@ static void dispc_ovl_set_channel_out(enum omap_plane plane,
static void dispc_ovl_set_burst_size(enum omap_plane plane,
enum omap_burst_size burst_size)
{
- static const unsigned shifts[] = { 6, 14, 14, };
+ static const unsigned shifts[] = { 6, 14, 14, 14, };
int shift;
shift = shifts[plane];
@@ -988,7 +989,7 @@ static void dispc_ovl_set_vid_color_conv(enum omap_plane plane, bool enable)
static void dispc_ovl_enable_replication(enum omap_plane plane, bool enable)
{
- static const unsigned shifts[] = { 5, 10, 10 };
+ static const unsigned shifts[] = { 5, 10, 10, 10 };
int shift;
shift = shifts[plane];
@@ -2558,6 +2559,10 @@ void dispc_dump_irqs(struct seq_file *s)
PIS(VID1_END_WIN);
PIS(VID2_FIFO_UNDERFLOW);
PIS(VID2_END_WIN);
+ if (dss_feat_get_num_ovls() > 3) {
+ PIS(VID3_FIFO_UNDERFLOW);
+ PIS(VID3_END_WIN);
+ }
PIS(SYNC_LOST);
PIS(SYNC_LOST_DIGIT);
PIS(WAKEUP);
@@ -2583,6 +2588,7 @@ void dispc_dump_regs(struct seq_file *s)
[OMAP_DSS_GFX] = "GFX",
[OMAP_DSS_VIDEO1] = "VID1",
[OMAP_DSS_VIDEO2] = "VID2",
+ [OMAP_DSS_VIDEO3] = "VID3",
};
const char **p_names;
@@ -2985,6 +2991,8 @@ static void print_irq_status(u32 status)
PIS(OCP_ERR);
PIS(VID1_FIFO_UNDERFLOW);
PIS(VID2_FIFO_UNDERFLOW);
+ if (dss_feat_get_num_ovls() > 3)
+ PIS(VID3_FIFO_UNDERFLOW);
PIS(SYNC_LOST);
PIS(SYNC_LOST_DIGIT);
if (dss_has_feature(FEAT_MGR_LCD2))
@@ -3082,6 +3090,7 @@ static void dispc_error_worker(struct work_struct *work)
DISPC_IRQ_GFX_FIFO_UNDERFLOW,
DISPC_IRQ_VID1_FIFO_UNDERFLOW,
DISPC_IRQ_VID2_FIFO_UNDERFLOW,
+ DISPC_IRQ_VID3_FIFO_UNDERFLOW,
};
static const unsigned sync_lost_bits[] = {
@@ -3257,6 +3266,8 @@ static void _omap_dispc_initialize_irq(void)
dispc.irq_error_mask = DISPC_IRQ_MASK_ERROR;
if (dss_has_feature(FEAT_MGR_LCD2))
dispc.irq_error_mask |= DISPC_IRQ_SYNC_LOST2;
+ if (dss_feat_get_num_ovls() > 3)
+ dispc.irq_error_mask |= DISPC_IRQ_VID3_FIFO_UNDERFLOW;
/* there's SYNC_LOST_DIGIT waiting after enabling the DSS,
* so clear it */
diff --git a/drivers/video/omap2/dss/dispc.h b/drivers/video/omap2/dss/dispc.h
index 6c9ee0a..c06efc3 100644
--- a/drivers/video/omap2/dss/dispc.h
+++ b/drivers/video/omap2/dss/dispc.h
@@ -291,6 +291,8 @@ static inline u16 DISPC_OVL_BASE(enum omap_plane plane)
return 0x00BC;
case OMAP_DSS_VIDEO2:
return 0x014C;
+ case OMAP_DSS_VIDEO3:
+ return 0x0300;
default:
BUG();
}
@@ -304,6 +306,8 @@ static inline u16 DISPC_BA0_OFFSET(enum omap_plane plane)
case OMAP_DSS_VIDEO1:
case OMAP_DSS_VIDEO2:
return 0x0000;
+ case OMAP_DSS_VIDEO3:
+ return 0x0008;
default:
BUG();
}
@@ -316,6 +320,8 @@ static inline u16 DISPC_BA1_OFFSET(enum omap_plane plane)
case OMAP_DSS_VIDEO1:
case OMAP_DSS_VIDEO2:
return 0x0004;
+ case OMAP_DSS_VIDEO3:
+ return 0x000C;
default:
BUG();
}
@@ -330,6 +336,8 @@ static inline u16 DISPC_BA0_UV_OFFSET(enum omap_plane plane)
return 0x0544;
case OMAP_DSS_VIDEO2:
return 0x04BC;
+ case OMAP_DSS_VIDEO3:
+ return 0x0310;
default:
BUG();
}
@@ -344,6 +352,8 @@ static inline u16 DISPC_BA1_UV_OFFSET(enum omap_plane plane)
return 0x0548;
case OMAP_DSS_VIDEO2:
return 0x04C0;
+ case OMAP_DSS_VIDEO3:
+ return 0x0314;
default:
BUG();
}
@@ -356,6 +366,8 @@ static inline u16 DISPC_POS_OFFSET(enum omap_plane plane)
case OMAP_DSS_VIDEO1:
case OMAP_DSS_VIDEO2:
return 0x0008;
+ case OMAP_DSS_VIDEO3:
+ return 0x009C;
default:
BUG();
}
@@ -368,6 +380,8 @@ static inline u16 DISPC_SIZE_OFFSET(enum omap_plane plane)
case OMAP_DSS_VIDEO1:
case OMAP_DSS_VIDEO2:
return 0x000C;
+ case OMAP_DSS_VIDEO3:
+ return 0x00A8;
default:
BUG();
}
@@ -381,6 +395,8 @@ static inline u16 DISPC_ATTR_OFFSET(enum omap_plane plane)
case OMAP_DSS_VIDEO1:
case OMAP_DSS_VIDEO2:
return 0x0010;
+ case OMAP_DSS_VIDEO3:
+ return 0x0070;
default:
BUG();
}
@@ -395,6 +411,8 @@ static inline u16 DISPC_ATTR2_OFFSET(enum omap_plane plane)
return 0x0568;
case OMAP_DSS_VIDEO2:
return 0x04DC;
+ case OMAP_DSS_VIDEO3:
+ return 0x032C;
default:
BUG();
}
@@ -408,6 +426,8 @@ static inline u16 DISPC_FIFO_THRESH_OFFSET(enum omap_plane plane)
case OMAP_DSS_VIDEO1:
case OMAP_DSS_VIDEO2:
return 0x0014;
+ case OMAP_DSS_VIDEO3:
+ return 0x008C;
default:
BUG();
}
@@ -421,6 +441,8 @@ static inline u16 DISPC_FIFO_SIZE_STATUS_OFFSET(enum omap_plane plane)
case OMAP_DSS_VIDEO1:
case OMAP_DSS_VIDEO2:
return 0x0018;
+ case OMAP_DSS_VIDEO3:
+ return 0x0088;
default:
BUG();
}
@@ -434,6 +456,8 @@ static inline u16 DISPC_ROW_INC_OFFSET(enum omap_plane plane)
case OMAP_DSS_VIDEO1:
case OMAP_DSS_VIDEO2:
return 0x001C;
+ case OMAP_DSS_VIDEO3:
+ return 0x00A4;
default:
BUG();
}
@@ -447,6 +471,8 @@ static inline u16 DISPC_PIX_INC_OFFSET(enum omap_plane plane)
case OMAP_DSS_VIDEO1:
case OMAP_DSS_VIDEO2:
return 0x0020;
+ case OMAP_DSS_VIDEO3:
+ return 0x0098;
default:
BUG();
}
@@ -459,6 +485,7 @@ static inline u16 DISPC_WINDOW_SKIP_OFFSET(enum omap_plane plane)
return 0x0034;
case OMAP_DSS_VIDEO1:
case OMAP_DSS_VIDEO2:
+ case OMAP_DSS_VIDEO3:
BUG();
default:
BUG();
@@ -472,6 +499,7 @@ static inline u16 DISPC_TABLE_BA_OFFSET(enum omap_plane plane)
return 0x0038;
case OMAP_DSS_VIDEO1:
case OMAP_DSS_VIDEO2:
+ case OMAP_DSS_VIDEO3:
BUG();
default:
BUG();
@@ -486,6 +514,8 @@ static inline u16 DISPC_FIR_OFFSET(enum omap_plane plane)
case OMAP_DSS_VIDEO1:
case OMAP_DSS_VIDEO2:
return 0x0024;
+ case OMAP_DSS_VIDEO3:
+ return 0x0090;
default:
BUG();
}
@@ -500,6 +530,8 @@ static inline u16 DISPC_FIR2_OFFSET(enum omap_plane plane)
return 0x0580;
case OMAP_DSS_VIDEO2:
return 0x055C;
+ case OMAP_DSS_VIDEO3:
+ return 0x0424;
default:
BUG();
}
@@ -513,6 +545,8 @@ static inline u16 DISPC_PIC_SIZE_OFFSET(enum omap_plane plane)
case OMAP_DSS_VIDEO1:
case OMAP_DSS_VIDEO2:
return 0x0028;
+ case OMAP_DSS_VIDEO3:
+ return 0x0094;
default:
BUG();
}
@@ -527,6 +561,8 @@ static inline u16 DISPC_ACCU0_OFFSET(enum omap_plane plane)
case OMAP_DSS_VIDEO1:
case OMAP_DSS_VIDEO2:
return 0x002C;
+ case OMAP_DSS_VIDEO3:
+ return 0x0000;
default:
BUG();
}
@@ -541,6 +577,8 @@ static inline u16 DISPC_ACCU2_0_OFFSET(enum omap_plane plane)
return 0x0584;
case OMAP_DSS_VIDEO2:
return 0x0560;
+ case OMAP_DSS_VIDEO3:
+ return 0x0428;
default:
BUG();
}
@@ -554,6 +592,8 @@ static inline u16 DISPC_ACCU1_OFFSET(enum omap_plane plane)
case OMAP_DSS_VIDEO1:
case OMAP_DSS_VIDEO2:
return 0x0030;
+ case OMAP_DSS_VIDEO3:
+ return 0x0004;
default:
BUG();
}
@@ -568,6 +608,8 @@ static inline u16 DISPC_ACCU2_1_OFFSET(enum omap_plane plane)
return 0x0588;
case OMAP_DSS_VIDEO2:
return 0x0564;
+ case OMAP_DSS_VIDEO3:
+ return 0x042C;
default:
BUG();
}
@@ -582,6 +624,8 @@ static inline u16 DISPC_FIR_COEF_H_OFFSET(enum omap_plane plane, u16 i)
case OMAP_DSS_VIDEO1:
case OMAP_DSS_VIDEO2:
return 0x0034 + i * 0x8;
+ case OMAP_DSS_VIDEO3:
+ return 0x0010 + i * 0x8;
default:
BUG();
}
@@ -597,6 +641,8 @@ static inline u16 DISPC_FIR_COEF_H2_OFFSET(enum omap_plane plane, u16 i)
return 0x058C + i * 0x8;
case OMAP_DSS_VIDEO2:
return 0x0568 + i * 0x8;
+ case OMAP_DSS_VIDEO3:
+ return 0x0430 + i * 0x8;
default:
BUG();
}
@@ -611,6 +657,8 @@ static inline u16 DISPC_FIR_COEF_HV_OFFSET(enum omap_plane plane, u16 i)
case OMAP_DSS_VIDEO1:
case OMAP_DSS_VIDEO2:
return 0x0038 + i * 0x8;
+ case OMAP_DSS_VIDEO3:
+ return 0x0014 + i * 0x8;
default:
BUG();
}
@@ -626,6 +674,8 @@ static inline u16 DISPC_FIR_COEF_HV2_OFFSET(enum omap_plane plane, u16 i)
return 0x0590 + i * 8;
case OMAP_DSS_VIDEO2:
return 0x056C + i * 0x8;
+ case OMAP_DSS_VIDEO3:
+ return 0x0434 + i * 0x8;
default:
BUG();
}
@@ -639,6 +689,7 @@ static inline u16 DISPC_CONV_COEF_OFFSET(enum omap_plane plane, u16 i)
BUG();
case OMAP_DSS_VIDEO1:
case OMAP_DSS_VIDEO2:
+ case OMAP_DSS_VIDEO3:
return 0x0074 + i * 0x4;
default:
BUG();
@@ -655,6 +706,8 @@ static inline u16 DISPC_FIR_COEF_V_OFFSET(enum omap_plane plane, u16 i)
return 0x0124 + i * 0x4;
case OMAP_DSS_VIDEO2:
return 0x00B4 + i * 0x4;
+ case OMAP_DSS_VIDEO3:
+ return 0x0050 + i * 0x4;
default:
BUG();
}
@@ -670,6 +723,8 @@ static inline u16 DISPC_FIR_COEF_V2_OFFSET(enum omap_plane plane, u16 i)
return 0x05CC + i * 0x4;
case OMAP_DSS_VIDEO2:
return 0x05A8 + i * 0x4;
+ case OMAP_DSS_VIDEO3:
+ return 0x0470 + i * 0x4;
default:
BUG();
}
@@ -684,6 +739,8 @@ static inline u16 DISPC_PRELOAD_OFFSET(enum omap_plane plane)
return 0x0174;
case OMAP_DSS_VIDEO2:
return 0x00E8;
+ case OMAP_DSS_VIDEO3:
+ return 0x00A0;
default:
BUG();
}
diff --git a/drivers/video/omap2/dss/dss_features.c b/drivers/video/omap2/dss/dss_features.c
index 70d5b9e..e5e94f4 100644
--- a/drivers/video/omap2/dss/dss_features.c
+++ b/drivers/video/omap2/dss/dss_features.c
@@ -210,6 +210,16 @@ static const enum omap_color_mode omap4_dss_supported_color_modes[] = {
OMAP_DSS_COLOR_ARGB16 | OMAP_DSS_COLOR_XRGB16_1555 |
OMAP_DSS_COLOR_ARGB32 | OMAP_DSS_COLOR_RGBX16 |
OMAP_DSS_COLOR_RGBX32,
+
+ /* OMAP_DSS_VIDEO3 */
+ OMAP_DSS_COLOR_RGB16 | OMAP_DSS_COLOR_RGB12U |
+ OMAP_DSS_COLOR_YUV2 | OMAP_DSS_COLOR_ARGB16_1555 |
+ OMAP_DSS_COLOR_RGBA32 | OMAP_DSS_COLOR_NV12 |
+ OMAP_DSS_COLOR_RGBA16 | OMAP_DSS_COLOR_RGB24U |
+ OMAP_DSS_COLOR_RGB24P | OMAP_DSS_COLOR_UYVY |
+ OMAP_DSS_COLOR_ARGB16 | OMAP_DSS_COLOR_XRGB16_1555 |
+ OMAP_DSS_COLOR_ARGB32 | OMAP_DSS_COLOR_RGBX16 |
+ OMAP_DSS_COLOR_RGBX32,
};
static const enum omap_overlay_caps omap2_dss_overlay_caps[] = {
@@ -258,6 +268,10 @@ static const enum omap_overlay_caps omap4_dss_overlay_caps[] = {
/* OMAP_DSS_VIDEO2 */
OMAP_DSS_OVL_CAP_SCALE | OMAP_DSS_OVL_CAP_GLOBAL_ALPHA |
OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA | OMAP_DSS_OVL_CAP_ZORDER,
+
+ /* OMAP_DSS_VIDEO3 */
+ OMAP_DSS_OVL_CAP_SCALE | OMAP_DSS_OVL_CAP_GLOBAL_ALPHA |
+ OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA | OMAP_DSS_OVL_CAP_ZORDER,
};
static const char * const omap2_dss_clk_source_names[] = {
@@ -401,7 +415,7 @@ static const struct omap_dss_features omap4430_es1_0_dss_features = {
FEAT_ALPHA_FREE_ZORDER,
.num_mgrs = 3,
- .num_ovls = 3,
+ .num_ovls = 4,
.supported_displays = omap4_dss_supported_displays,
.supported_color_modes = omap4_dss_supported_color_modes,
.overlay_caps = omap4_dss_overlay_caps,
@@ -425,7 +439,7 @@ static const struct omap_dss_features omap4_dss_features = {
FEAT_PRELOAD | FEAT_FIR_COEF_V | FEAT_ALPHA_FREE_ZORDER,
.num_mgrs = 3,
- .num_ovls = 3,
+ .num_ovls = 4,
.supported_displays = omap4_dss_supported_displays,
.supported_color_modes = omap4_dss_supported_color_modes,
.overlay_caps = omap4_dss_overlay_caps,
diff --git a/drivers/video/omap2/dss/dss_features.h b/drivers/video/omap2/dss/dss_features.h
index e81271a..6a6c05d 100644
--- a/drivers/video/omap2/dss/dss_features.h
+++ b/drivers/video/omap2/dss/dss_features.h
@@ -25,7 +25,7 @@
#endif
#define MAX_DSS_MANAGERS 3
-#define MAX_DSS_OVERLAYS 3
+#define MAX_DSS_OVERLAYS 4
#define MAX_DSS_LCD_MANAGERS 2
#define MAX_NUM_DSI 2
diff --git a/drivers/video/omap2/dss/overlay.c b/drivers/video/omap2/dss/overlay.c
index afb7583..11d21e3 100644
--- a/drivers/video/omap2/dss/overlay.c
+++ b/drivers/video/omap2/dss/overlay.c
@@ -615,6 +615,11 @@ void dss_init_overlays(struct platform_device *pdev)
ovl->id = OMAP_DSS_VIDEO2;
ovl->info.global_alpha = 255;
break;
+ case 3:
+ ovl->name = "vid3";
+ ovl->id = OMAP_DSS_VIDEO3;
+ ovl->info.global_alpha = 255;
+ break;
}
ovl->set_manager = &omap_dss_set_manager;
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index 5f0ce5e..1f12559 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -41,6 +41,8 @@
#define DISPC_IRQ_WAKEUP (1 << 16)
#define DISPC_IRQ_SYNC_LOST2 (1 << 17)
#define DISPC_IRQ_VSYNC2 (1 << 18)
+#define DISPC_IRQ_VID3_END_WIN (1 << 19)
+#define DISPC_IRQ_VID3_FIFO_UNDERFLOW (1 << 20)
#define DISPC_IRQ_ACBIAS_COUNT_STAT2 (1 << 21)
#define DISPC_IRQ_FRAMEDONE2 (1 << 22)
#define DISPC_IRQ_FRAMEDONEWB (1 << 23)
@@ -63,7 +65,8 @@ enum omap_display_type {
enum omap_plane {
OMAP_DSS_GFX = 0,
OMAP_DSS_VIDEO1 = 1,
- OMAP_DSS_VIDEO2 = 2
+ OMAP_DSS_VIDEO2 = 2,
+ OMAP_DSS_VIDEO3 = 3,
};
enum omap_channel {
--
1.7.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 3/3] OMAPDSS: DISPC: zorder support for DSS overlays
2011-09-16 6:39 [PATCH v2 0/3] OMAPDSS: DISPC: VIDEO3 and ZORDER support Archit Taneja
2011-09-16 6:39 ` [PATCH v2 1/3] OMAPDSS/OMAP_VOUT: Fix incorrect OMAP3-alpha compatibility setting Archit Taneja
2011-09-16 6:39 ` [PATCH v2 2/3] OMAPDSS: DISPC: VIDEO3 pipeline support Archit Taneja
@ 2011-09-16 6:39 ` Archit Taneja
2 siblings, 0 replies; 8+ messages in thread
From: Archit Taneja @ 2011-09-16 6:39 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: hvaibhav, linux-omap, Archit Taneja
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>
---
drivers/video/omap2/dss/dispc.c | 24 ++++++++++++
drivers/video/omap2/dss/overlay.c | 72 +++++++++++++++++++++++++++++++++++++
include/video/omapdss.h | 1 +
3 files changed, 97 insertions(+), 0 deletions(-)
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index fa7aadf..6892cfd 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)
dispc_write_reg(DISPC_OVL_SIZE(plane), val);
}
+static void dispc_ovl_set_zorder(enum omap_plane plane, u8 zorder)
+{
+ struct omap_overlay *ovl = omap_dss_get_overlay(plane);
+
+ if ((ovl->caps & OMAP_DSS_OVL_CAP_ZORDER) == 0)
+ return;
+
+ REG_FLD_MOD(DISPC_OVL_ATTRIBUTES(plane), zorder, 27, 26);
+}
+
+static void dispc_ovl_enable_zorder_planes(void)
+{
+ int i;
+
+ if (!dss_has_feature(FEAT_ALPHA_FREE_ZORDER))
+ return;
+
+ for (i = 0; i < dss_feat_get_num_ovls(); i++)
+ REG_FLD_MOD(DISPC_OVL_ATTRIBUTES(i), 1, 25, 25);
+}
+
static void dispc_ovl_set_pre_mult_alpha(enum omap_plane plane, bool enable)
{
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,
dispc_ovl_set_rotation_attrs(plane, oi->rotation, oi->mirror,
oi->color_mode);
+ dispc_ovl_set_zorder(plane, oi->zorder);
dispc_ovl_set_pre_mult_alpha(plane, oi->pre_mult_alpha);
dispc_ovl_setup_global_alpha(plane, oi->global_alpha);
@@ -3317,6 +3339,8 @@ static void _omap_dispc_initial_config(void)
dispc_read_plane_fifo_sizes();
dispc_configure_burst_sizes();
+
+ dispc_ovl_enable_zorder_planes();
}
/* DISPC HW IP initialisation */
diff --git a/drivers/video/omap2/dss/overlay.c b/drivers/video/omap2/dss/overlay.c
index 11d21e3..ab8e40e 100644
--- a/drivers/video/omap2/dss/overlay.c
+++ b/drivers/video/omap2/dss/overlay.c
@@ -311,6 +311,42 @@ static ssize_t overlay_pre_mult_alpha_store(struct omap_overlay *ovl,
return size;
}
+static ssize_t overlay_zorder_show(struct omap_overlay *ovl, char *buf)
+{
+ return snprintf(buf, PAGE_SIZE, "%d\n", ovl->info.zorder);
+}
+
+static ssize_t overlay_zorder_store(struct omap_overlay *ovl,
+ const char *buf, size_t size)
+{
+ int r;
+ u8 zorder;
+ struct omap_overlay_info info;
+
+ if ((ovl->caps & OMAP_DSS_OVL_CAP_ZORDER) == 0)
+ return -ENODEV;
+
+ r = kstrtou8(buf, 0, &zorder);
+ if (r)
+ return r;
+
+ ovl->get_overlay_info(ovl, &info);
+
+ info.zorder = zorder;
+
+ r = ovl->set_overlay_info(ovl, &info);
+ if (r)
+ return r;
+
+ if (ovl->manager) {
+ r = ovl->manager->apply(ovl->manager);
+ if (r)
+ return r;
+ }
+
+ return size;
+}
+
struct overlay_attribute {
struct attribute attr;
ssize_t (*show)(struct omap_overlay *, char *);
@@ -337,6 +373,8 @@ static OVERLAY_ATTR(global_alpha, S_IRUGO|S_IWUSR,
static OVERLAY_ATTR(pre_mult_alpha, S_IRUGO|S_IWUSR,
overlay_pre_mult_alpha_show,
overlay_pre_mult_alpha_store);
+static OVERLAY_ATTR(zorder, S_IRUGO|S_IWUSR,
+ overlay_zorder_show, overlay_zorder_store);
static struct attribute *overlay_sysfs_attrs[] = {
&overlay_attr_name.attr,
@@ -348,6 +386,7 @@ static struct attribute *overlay_sysfs_attrs[] = {
&overlay_attr_enabled.attr,
&overlay_attr_global_alpha.attr,
&overlay_attr_pre_mult_alpha.attr,
+ &overlay_attr_zorder.attr,
NULL
};
@@ -397,6 +436,7 @@ int dss_check_overlay(struct omap_overlay *ovl, struct omap_dss_device *dssdev)
struct omap_overlay_info *info;
u16 outw, outh;
u16 dw, dh;
+ int i;
if (!dssdev)
return 0;
@@ -452,6 +492,31 @@ int dss_check_overlay(struct omap_overlay *ovl, struct omap_dss_device *dssdev)
return -EINVAL;
}
+ if (ovl->caps & OMAP_DSS_OVL_CAP_ZORDER) {
+ if (info->zorder < 0 || info->zorder > 3) {
+ DSSERR("zorder out of range: %d\n",
+ info->zorder);
+ return -EINVAL;
+ }
+ /*
+ * Check that zorder doesn't match with zorder of any other
+ * overlay which is enabled and is also connected to the same
+ * manager
+ */
+ for (i = 0; i < omap_dss_get_num_overlays(); i++) {
+ struct omap_overlay *tmp_ovl = omap_dss_get_overlay(i);
+
+ if (tmp_ovl->id != ovl->id &&
+ tmp_ovl->manager == ovl->manager &&
+ tmp_ovl->info.enabled == true &&
+ tmp_ovl->info.zorder == info->zorder) {
+ DSSERR("%s and %s have same zorder: %d\n",
+ ovl->name, tmp_ovl->name, info->zorder);
+ return -EINVAL;
+ }
+ }
+ }
+
return 0;
}
@@ -604,21 +669,28 @@ void dss_init_overlays(struct platform_device *pdev)
ovl->name = "gfx";
ovl->id = OMAP_DSS_GFX;
ovl->info.global_alpha = 255;
+ ovl->info.zorder = 0;
break;
case 1:
ovl->name = "vid1";
ovl->id = OMAP_DSS_VIDEO1;
ovl->info.global_alpha = 255;
+ ovl->info.zorder =
+ dss_has_feature(FEAT_ALPHA_FREE_ZORDER) ? 3 : 0;
break;
case 2:
ovl->name = "vid2";
ovl->id = OMAP_DSS_VIDEO2;
ovl->info.global_alpha = 255;
+ ovl->info.zorder =
+ dss_has_feature(FEAT_ALPHA_FREE_ZORDER) ? 2 : 0;
break;
case 3:
ovl->name = "vid3";
ovl->id = OMAP_DSS_VIDEO3;
ovl->info.global_alpha = 255;
+ ovl->info.zorder =
+ dss_has_feature(FEAT_ALPHA_FREE_ZORDER) ? 1 : 0;
break;
}
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index 1f12559..9cd61e8 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -371,6 +371,7 @@ struct omap_overlay_info {
u16 out_height; /* if 0, out_height == height */
u8 global_alpha;
u8 pre_mult_alpha;
+ u8 zorder;
};
struct omap_overlay {
--
1.7.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* RE: [PATCH v2 1/3] OMAPDSS/OMAP_VOUT: Fix incorrect OMAP3-alpha compatibility setting
2011-09-16 6:39 ` [PATCH v2 1/3] OMAPDSS/OMAP_VOUT: Fix incorrect OMAP3-alpha compatibility setting Archit Taneja
@ 2011-09-19 19:36 ` Hiremath, Vaibhav
2011-09-20 6:44 ` Archit Taneja
0 siblings, 1 reply; 8+ messages in thread
From: Hiremath, Vaibhav @ 2011-09-19 19:36 UTC (permalink / raw)
To: Taneja, Archit, Valkeinen, Tomi
Cc: linux-omap@vger.kernel.org, linux-media@vger.kernel.org,
Molnar, Lajos
> -----Original Message-----
> From: Taneja, Archit
> Sent: Friday, September 16, 2011 12:09 PM
> To: Valkeinen, Tomi
> Cc: Hiremath, Vaibhav; linux-omap@vger.kernel.org; Taneja, Archit; linux-
> media@vger.kernel.org; Molnar, Lajos
> Subject: [PATCH v2 1/3] OMAPDSS/OMAP_VOUT: Fix incorrect OMAP3-alpha
> compatibility setting
>
[Hiremath, Vaibhav] Few minor comments below -
> 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
[Hiremath, Vaibhav] Spelling mistake???
> 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 int 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.
>
> Initial patch was made by: Lajos Molnar <molnar@ti.com>
>
[Hiremath, Vaibhav] I think you can put his sign-off as well and remove this line or move it below ---
> Cc: linux-media@vger.kernel.org
> Cc: Lajos Molnar <molnar@ti.com>
> Signed-off-by: Archit Taneja <archit@ti.com>
> ---
> drivers/media/video/omap/omap_vout.c | 16 +++++++++++-----
> drivers/video/omap2/dss/dispc.c | 24 ++++++++++++------------
> drivers/video/omap2/dss/dss.h | 4 ++--
> drivers/video/omap2/dss/dss_features.c | 22 +++++++++++-----------
> drivers/video/omap2/dss/dss_features.h | 3 ++-
> drivers/video/omap2/dss/manager.c | 28 +++++++++++++++++++--------
> -
> include/video/omapdss.h | 3 ++-
> 7 files changed, 59 insertions(+), 41 deletions(-)
>
> diff --git a/drivers/media/video/omap/omap_vout.c
> b/drivers/media/video/omap/omap_vout.c
> index b3a5ecd..95daf98 100644
> --- a/drivers/media/video/omap/omap_vout.c
> +++ b/drivers/media/video/omap/omap_vout.c
> @@ -1165,12 +1165,17 @@ static int vidioc_try_fmt_vid_overlay(struct file
> *file, void *fh,
> {
> int ret = 0;
> struct omap_vout_device *vout = fh;
> + struct omap_overlay *ovl;
> + struct omapvideo_info *ovid;
> struct v4l2_window *win = &f->fmt.win;
>
> + ovid = &vout->vid_info;
> + ovl = ovid->overlays[0];
> +
[Hiremath, Vaibhav] I think it will be helpful if you put some comment above this line on why video1, something like,
/*
* Global alpha is not supported on Video1 pipeline/overlay
*/
> ret = omap_vout_try_window(&vout->fbuf, win);
>
> if (!ret) {
> - if (vout->vid == OMAP_VIDEO1)
> + if ((ovl->caps & OMAP_DSS_OVL_CAP_GLOBAL_ALPHA) == 0)
> win->global_alpha = 255;
> else
> win->global_alpha = f->fmt.win.global_alpha;
> @@ -1194,8 +1199,7 @@ static int vidioc_s_fmt_vid_overlay(struct file
> *file, void *fh,
>
> ret = omap_vout_new_window(&vout->crop, &vout->win, &vout->fbuf,
> win);
> if (!ret) {
> - /* Video1 plane does not support global alpha */
> - if (ovl->id == OMAP_DSS_VIDEO1)
> + if ((ovl->caps & OMAP_DSS_OVL_CAP_GLOBAL_ALPHA) == 0)
> vout->win.global_alpha = 255;
> else
> vout->win.global_alpha = f->fmt.win.global_alpha;
> @@ -1788,7 +1792,9 @@ static int vidioc_s_fbuf(struct file *file, void *fh,
> if (ovl->manager && ovl->manager->get_manager_info &&
> ovl->manager->set_manager_info) {
> ovl->manager->get_manager_info(ovl->manager, &info);
> - info.alpha_enabled = enable;
> + /* enable this only if there is no zorder cap */
> + if ((ovl->caps & OMAP_DSS_OVL_CAP_ZORDER) == 0)
> + info.partial_alpha_enabled = enable;
> if (ovl->manager->set_manager_info(ovl->manager, &info))
> return -EINVAL;
> }
> @@ -1820,7 +1826,7 @@ static int vidioc_g_fbuf(struct file *file, void *fh,
> }
> if (ovl->manager && ovl->manager->get_manager_info) {
> ovl->manager->get_manager_info(ovl->manager, &info);
> - if (info.alpha_enabled)
> + if (info.partial_alpha_enabled)
> a->flags |= V4L2_FBUF_FLAG_LOCAL_ALPHA;
> }
>
> diff --git a/drivers/video/omap2/dss/dispc.c
> b/drivers/video/omap2/dss/dispc.c
> index 5e6849e..e0639d3 100644
> --- a/drivers/video/omap2/dss/dispc.c
> +++ b/drivers/video/omap2/dss/dispc.c
> @@ -179,7 +179,8 @@ static void dispc_save_context(void)
> SR(CONTROL);
> SR(CONFIG);
> SR(LINE_NUMBER);
> - if (dss_has_feature(FEAT_GLOBAL_ALPHA))
> + if (dss_has_feature(FEAT_ALPHA_FIXED_ZORDER) ||
> + dss_has_feature(FEAT_ALPHA_FREE_ZORDER))
> SR(GLOBAL_ALPHA);
> if (dss_has_feature(FEAT_MGR_LCD2)) {
> SR(CONTROL2);
> @@ -293,7 +294,8 @@ static void dispc_restore_context(void)
> /*RR(CONTROL);*/
> RR(CONFIG);
> RR(LINE_NUMBER);
> - if (dss_has_feature(FEAT_GLOBAL_ALPHA))
> + if (dss_has_feature(FEAT_ALPHA_FIXED_ZORDER) ||
> + dss_has_feature(FEAT_ALPHA_FREE_ZORDER))
> RR(GLOBAL_ALPHA);
> if (dss_has_feature(FEAT_MGR_LCD2))
> RR(CONFIG2);
> @@ -2159,38 +2161,35 @@ void dispc_mgr_enable_trans_key(enum omap_channel
> ch, bool enable)
> else /* OMAP_DSS_CHANNEL_LCD2 */
> REG_FLD_MOD(DISPC_CONFIG2, enable, 10, 10);
> }
> -void dispc_mgr_enable_alpha_blending(enum omap_channel ch, bool enable)
> +
> +void dispc_mgr_enable_alpha_fixed_zorder(enum omap_channel ch, bool
> enable)
> {
> - if (!dss_has_feature(FEAT_GLOBAL_ALPHA))
> + if (!dss_has_feature(FEAT_ALPHA_FIXED_ZORDER))
> return;
>
> if (ch == OMAP_DSS_CHANNEL_LCD)
> REG_FLD_MOD(DISPC_CONFIG, enable, 18, 18);
> else if (ch == OMAP_DSS_CHANNEL_DIGIT)
> REG_FLD_MOD(DISPC_CONFIG, enable, 19, 19);
> - else /* OMAP_DSS_CHANNEL_LCD2 */
> - REG_FLD_MOD(DISPC_CONFIG2, enable, 18, 18);
> }
> -bool dispc_mgr_alpha_blending_enabled(enum omap_channel ch)
> +
> +bool dispc_mgr_alpha_fixed_zorder_enabled(enum omap_channel ch)
> {
> bool enabled;
>
> - if (!dss_has_feature(FEAT_GLOBAL_ALPHA))
> + if (!dss_has_feature(FEAT_ALPHA_FIXED_ZORDER))
> return false;
>
> if (ch == OMAP_DSS_CHANNEL_LCD)
> enabled = REG_GET(DISPC_CONFIG, 18, 18);
> else if (ch == OMAP_DSS_CHANNEL_DIGIT)
> enabled = REG_GET(DISPC_CONFIG, 19, 19);
> - else if (ch == OMAP_DSS_CHANNEL_LCD2)
> - enabled = REG_GET(DISPC_CONFIG2, 18, 18);
> else
> BUG();
>
> return enabled;
> }
>
> -
> bool dispc_mgr_trans_key_enabled(enum omap_channel ch)
> {
> bool enabled;
> @@ -2603,7 +2602,8 @@ void dispc_dump_regs(struct seq_file *s)
> DUMPREG(DISPC_CAPABLE);
> DUMPREG(DISPC_LINE_STATUS);
> DUMPREG(DISPC_LINE_NUMBER);
> - if (dss_has_feature(FEAT_GLOBAL_ALPHA))
> + if (dss_has_feature(FEAT_ALPHA_FIXED_ZORDER) ||
> + dss_has_feature(FEAT_ALPHA_FREE_ZORDER))
> DUMPREG(DISPC_GLOBAL_ALPHA);
> if (dss_has_feature(FEAT_MGR_LCD2)) {
> DUMPREG(DISPC_CONTROL2);
> diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
> index 47eebd8..a37aef2 100644
> --- a/drivers/video/omap2/dss/dss.h
> +++ b/drivers/video/omap2/dss/dss.h
> @@ -430,9 +430,9 @@ void dispc_mgr_get_trans_key(enum omap_channel ch,
> enum omap_dss_trans_key_type *type,
> u32 *trans_key);
> void dispc_mgr_enable_trans_key(enum omap_channel ch, bool enable);
> -void dispc_mgr_enable_alpha_blending(enum omap_channel ch, bool enable);
> +void dispc_mgr_enable_alpha_fixed_zorder(enum omap_channel ch, bool
> enable);
> bool dispc_mgr_trans_key_enabled(enum omap_channel ch);
> -bool dispc_mgr_alpha_blending_enabled(enum omap_channel ch);
> +bool dispc_mgr_alpha_fixed_zorder_enabled(enum omap_channel ch);
> void dispc_mgr_set_lcd_timings(enum omap_channel channel,
> struct omap_video_timings *timings);
> void dispc_mgr_set_pol_freq(enum omap_channel channel,
> diff --git a/drivers/video/omap2/dss/dss_features.c
> b/drivers/video/omap2/dss/dss_features.c
> index 47e66d8..70d5b9e 100644
> --- a/drivers/video/omap2/dss/dss_features.c
> +++ b/drivers/video/omap2/dss/dss_features.c
> @@ -248,15 +248,16 @@ static const enum omap_overlay_caps
> omap3630_dss_overlay_caps[] = {
>
> static const enum omap_overlay_caps omap4_dss_overlay_caps[] = {
> /* OMAP_DSS_GFX */
> - OMAP_DSS_OVL_CAP_GLOBAL_ALPHA | OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA,
> + OMAP_DSS_OVL_CAP_GLOBAL_ALPHA | OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA |
> + OMAP_DSS_OVL_CAP_ZORDER,
>
> /* OMAP_DSS_VIDEO1 */
> OMAP_DSS_OVL_CAP_SCALE | OMAP_DSS_OVL_CAP_GLOBAL_ALPHA |
> - OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA,
> + OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA | OMAP_DSS_OVL_CAP_ZORDER,
>
> /* OMAP_DSS_VIDEO2 */
> OMAP_DSS_OVL_CAP_SCALE | OMAP_DSS_OVL_CAP_GLOBAL_ALPHA |
> - OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA,
> + OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA | OMAP_DSS_OVL_CAP_ZORDER,
> };
>
> static const char * const omap2_dss_clk_source_names[] = {
> @@ -342,13 +343,13 @@ static const struct omap_dss_features
> omap3430_dss_features = {
> .num_reg_fields = ARRAY_SIZE(omap3_dss_reg_fields),
>
> .has_feature =
> - FEAT_GLOBAL_ALPHA | FEAT_LCDENABLEPOL |
> + FEAT_LCDENABLEPOL |
> FEAT_LCDENABLESIGNAL | FEAT_PCKFREEENABLE |
> FEAT_FUNCGATED | FEAT_ROWREPEATENABLE |
> FEAT_LINEBUFFERSPLIT | FEAT_RESIZECONF |
> FEAT_DSI_PLL_FREQSEL | FEAT_DSI_REVERSE_TXCLKESC |
> FEAT_VENC_REQUIRES_TV_DAC_CLK | FEAT_CPR | FEAT_PRELOAD |
> - FEAT_FIR_COEF_V,
> + FEAT_FIR_COEF_V | FEAT_ALPHA_FIXED_ZORDER,
>
> .num_mgrs = 2,
> .num_ovls = 3,
> @@ -366,13 +367,13 @@ static const struct omap_dss_features
> omap3630_dss_features = {
> .num_reg_fields = ARRAY_SIZE(omap3_dss_reg_fields),
>
> .has_feature =
> - FEAT_GLOBAL_ALPHA | FEAT_LCDENABLEPOL |
> + FEAT_LCDENABLEPOL |
> FEAT_LCDENABLESIGNAL | FEAT_PCKFREEENABLE |
> FEAT_FUNCGATED |
> FEAT_ROWREPEATENABLE | FEAT_LINEBUFFERSPLIT |
> FEAT_RESIZECONF | FEAT_DSI_PLL_PWR_BUG |
> FEAT_DSI_PLL_FREQSEL | FEAT_CPR | FEAT_PRELOAD |
> - FEAT_FIR_COEF_V,
> + FEAT_FIR_COEF_V | FEAT_ALPHA_FIXED_ZORDER,
>
> .num_mgrs = 2,
> .num_ovls = 3,
> @@ -392,12 +393,12 @@ static const struct omap_dss_features
> omap4430_es1_0_dss_features = {
> .num_reg_fields = ARRAY_SIZE(omap4_dss_reg_fields),
>
> .has_feature =
> - FEAT_GLOBAL_ALPHA |
> FEAT_MGR_LCD2 |
> FEAT_CORE_CLK_DIV | FEAT_LCD_CLK_SRC |
> FEAT_DSI_DCS_CMD_CONFIG_VC | FEAT_DSI_VC_OCP_WIDTH |
> FEAT_DSI_GNQ | FEAT_HANDLE_UV_SEPARATE | FEAT_ATTR2 |
> - FEAT_CPR | FEAT_PRELOAD | FEAT_FIR_COEF_V,
> + FEAT_CPR | FEAT_PRELOAD | FEAT_FIR_COEF_V |
> + FEAT_ALPHA_FREE_ZORDER,
>
> .num_mgrs = 3,
> .num_ovls = 3,
> @@ -416,13 +417,12 @@ static const struct omap_dss_features
> omap4_dss_features = {
> .num_reg_fields = ARRAY_SIZE(omap4_dss_reg_fields),
>
> .has_feature =
> - FEAT_GLOBAL_ALPHA |
> FEAT_MGR_LCD2 |
> FEAT_CORE_CLK_DIV | FEAT_LCD_CLK_SRC |
> FEAT_DSI_DCS_CMD_CONFIG_VC | FEAT_DSI_VC_OCP_WIDTH |
> FEAT_DSI_GNQ | FEAT_HDMI_CTS_SWMODE |
> FEAT_HANDLE_UV_SEPARATE | FEAT_ATTR2 | FEAT_CPR |
> - FEAT_PRELOAD | FEAT_FIR_COEF_V,
> + FEAT_PRELOAD | FEAT_FIR_COEF_V | FEAT_ALPHA_FREE_ZORDER,
>
> .num_mgrs = 3,
> .num_ovls = 3,
> diff --git a/drivers/video/omap2/dss/dss_features.h
> b/drivers/video/omap2/dss/dss_features.h
> index cd60644..e81271a 100644
> --- a/drivers/video/omap2/dss/dss_features.h
> +++ b/drivers/video/omap2/dss/dss_features.h
> @@ -31,7 +31,6 @@
>
> /* DSS has feature id */
> enum dss_feat_id {
> - FEAT_GLOBAL_ALPHA = 1 << 0,
[Hiremath, Vaibhav] Do you think we should clean this order now?
I will test these patches tomorrow and will update you.
Thanks,
Vaibhav
> FEAT_LCDENABLEPOL = 1 << 3,
> FEAT_LCDENABLESIGNAL = 1 << 4,
> FEAT_PCKFREEENABLE = 1 << 5,
> @@ -57,6 +56,8 @@ enum dss_feat_id {
> FEAT_CPR = 1 << 23,
> FEAT_PRELOAD = 1 << 24,
> FEAT_FIR_COEF_V = 1 << 25,
> + FEAT_ALPHA_FIXED_ZORDER = 1 << 26,
> + FEAT_ALPHA_FREE_ZORDER = 1 << 27,
> };
>
> /* DSS register field id */
> diff --git a/drivers/video/omap2/dss/manager.c
> b/drivers/video/omap2/dss/manager.c
> index fdbbeeb..6e63845 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,
> static ssize_t manager_alpha_blending_enabled_show(
> struct omap_overlay_manager *mgr, char *buf)
> {
> - return snprintf(buf, PAGE_SIZE, "%d\n", mgr->info.alpha_enabled);
> + WARN_ON(!dss_has_feature(FEAT_ALPHA_FIXED_ZORDER));
> +
> + return snprintf(buf, PAGE_SIZE, "%d\n",
> + mgr->info.partial_alpha_enabled);
> }
>
> static ssize_t manager_alpha_blending_enabled_store(
> @@ -260,13 +263,15 @@ static ssize_t manager_alpha_blending_enabled_store(
> bool enable;
> int r;
>
> + WARN_ON(!dss_has_feature(FEAT_ALPHA_FIXED_ZORDER));
> +
> r = strtobool(buf, &enable);
> if (r)
> return r;
>
> mgr->get_manager_info(mgr, &info);
>
> - info.alpha_enabled = enable;
> + info.partial_alpha_enabled = enable;
>
> r = mgr->set_manager_info(mgr, &info);
> if (r)
> @@ -966,7 +971,7 @@ static void configure_manager(enum omap_channel
> channel)
> dispc_mgr_set_default_color(channel, mi->default_color);
> dispc_mgr_set_trans_key(channel, mi->trans_key_type, mi->trans_key);
> dispc_mgr_enable_trans_key(channel, mi->trans_enabled);
> - dispc_mgr_enable_alpha_blending(channel, mi->alpha_enabled);
> + dispc_mgr_enable_alpha_fixed_zorder(channel, mi-
> >partial_alpha_enabled);
> if (dss_has_feature(FEAT_CPR)) {
> dispc_mgr_enable_cpr(channel, mi->cpr_enable);
> dispc_mgr_set_cpr_coef(channel, &mi->cpr_coefs);
> @@ -1481,12 +1486,17 @@ static int omap_dss_mgr_apply(struct
> omap_overlay_manager *mgr)
>
> static int dss_check_manager(struct omap_overlay_manager *mgr)
> {
> - /* OMAP supports only graphics source transparency color key and
> alpha
> - * blending simultaneously. See TRM 15.4.2.4.2.2 Alpha Mode */
> -
> - if (mgr->info.alpha_enabled && mgr->info.trans_enabled &&
> - mgr->info.trans_key_type != OMAP_DSS_COLOR_KEY_GFX_DST)
> - return -EINVAL;
> + if (dss_has_feature(FEAT_ALPHA_FIXED_ZORDER)) {
> + /*
> + * OMAP3 supports only graphics source transparency color key
> + * and alpha blending simultaneously. See TRM 15.4.2.4.2.2
> + * Alpha Mode
> + */
> + if (mgr->info.partial_alpha_enabled && mgr->info.trans_enabled
> + && mgr->info.trans_key_type !=
> + OMAP_DSS_COLOR_KEY_GFX_DST)
> + return -EINVAL;
> + }
>
> return 0;
> }
> diff --git a/include/video/omapdss.h b/include/video/omapdss.h
> index c62b9a4..5f0ce5e 100644
> --- a/include/video/omapdss.h
> +++ b/include/video/omapdss.h
> @@ -179,6 +179,7 @@ enum omap_overlay_caps {
> OMAP_DSS_OVL_CAP_SCALE = 1 << 0,
> OMAP_DSS_OVL_CAP_GLOBAL_ALPHA = 1 << 1,
> OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA = 1 << 2,
> + OMAP_DSS_OVL_CAP_ZORDER = 1 << 3,
> };
>
> enum omap_overlay_manager_caps {
> @@ -406,7 +407,7 @@ struct omap_overlay_manager_info {
> u32 trans_key;
> bool trans_enabled;
>
> - bool alpha_enabled;
> + bool partial_alpha_enabled;
>
> bool cpr_enable;
> struct omap_dss_cpr_coefs cpr_coefs;
> --
> 1.7.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [PATCH v2 2/3] OMAPDSS: DISPC: VIDEO3 pipeline support
2011-09-16 6:39 ` [PATCH v2 2/3] OMAPDSS: DISPC: VIDEO3 pipeline support Archit Taneja
@ 2011-09-19 19:43 ` Hiremath, Vaibhav
2011-09-20 6:55 ` Archit Taneja
0 siblings, 1 reply; 8+ messages in thread
From: Hiremath, Vaibhav @ 2011-09-19 19:43 UTC (permalink / raw)
To: Taneja, Archit, Valkeinen, Tomi; +Cc: linux-omap@vger.kernel.org
> -----Original Message-----
> From: Taneja, Archit
> Sent: Friday, September 16, 2011 12:09 PM
> To: Valkeinen, Tomi
> Cc: Hiremath, Vaibhav; linux-omap@vger.kernel.org; Taneja, Archit
> Subject: [PATCH v2 2/3] OMAPDSS: DISPC: VIDEO3 pipeline support
>
> Add support for VIDEO3 pipeline on OMAP4:
> - Add VIDEO3 pipeline information in dss_features and omapdss.h
> - Add VIDEO3 pipeline register coefficients in dispc.h
> - Create a new overlay structure corresponding to VIDEO3.
> - Make changes in dispc.c for VIDEO3
>
> Signed-off-by: Archit Taneja <archit@ti.com>
> ---
> drivers/video/omap2/dss/dispc.c | 17 ++++++++--
> drivers/video/omap2/dss/dispc.h | 57
> ++++++++++++++++++++++++++++++++
> drivers/video/omap2/dss/dss_features.c | 18 +++++++++-
> drivers/video/omap2/dss/dss_features.h | 2 +-
> drivers/video/omap2/dss/overlay.c | 5 +++
> include/video/omapdss.h | 5 ++-
> 6 files changed, 97 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/video/omap2/dss/dispc.c
> b/drivers/video/omap2/dss/dispc.c
> index e0639d3..fa7aadf 100644
> --- a/drivers/video/omap2/dss/dispc.c
> +++ b/drivers/video/omap2/dss/dispc.c
> @@ -751,7 +751,7 @@ static void dispc_ovl_set_pre_mult_alpha(enum
> omap_plane plane, bool enable)
>
> static void dispc_ovl_setup_global_alpha(enum omap_plane plane, u8
> global_alpha)
> {
> - static const unsigned shifts[] = { 0, 8, 16, };
> + static const unsigned shifts[] = { 0, 8, 16, 24, };
> int shift;
> struct omap_overlay *ovl = omap_dss_get_overlay(plane);
>
> @@ -866,6 +866,7 @@ static void dispc_ovl_set_channel_out(enum omap_plane
> plane,
> break;
> case OMAP_DSS_VIDEO1:
> case OMAP_DSS_VIDEO2:
> + case OMAP_DSS_VIDEO3:
> shift = 16;
> break;
> default:
> @@ -903,7 +904,7 @@ static void dispc_ovl_set_channel_out(enum omap_plane
> plane,
> static void dispc_ovl_set_burst_size(enum omap_plane plane,
> enum omap_burst_size burst_size)
> {
> - static const unsigned shifts[] = { 6, 14, 14, };
> + static const unsigned shifts[] = { 6, 14, 14, 14, };
> int shift;
>
> shift = shifts[plane];
> @@ -988,7 +989,7 @@ static void dispc_ovl_set_vid_color_conv(enum
> omap_plane plane, bool enable)
>
> static void dispc_ovl_enable_replication(enum omap_plane plane, bool
> enable)
> {
> - static const unsigned shifts[] = { 5, 10, 10 };
> + static const unsigned shifts[] = { 5, 10, 10, 10 };
> int shift;
>
> shift = shifts[plane];
> @@ -2558,6 +2559,10 @@ void dispc_dump_irqs(struct seq_file *s)
> PIS(VID1_END_WIN);
> PIS(VID2_FIFO_UNDERFLOW);
> PIS(VID2_END_WIN);
> + if (dss_feat_get_num_ovls() > 3) {
> + PIS(VID3_FIFO_UNDERFLOW);
> + PIS(VID3_END_WIN);
> + }
> PIS(SYNC_LOST);
> PIS(SYNC_LOST_DIGIT);
> PIS(WAKEUP);
> @@ -2583,6 +2588,7 @@ void dispc_dump_regs(struct seq_file *s)
> [OMAP_DSS_GFX] = "GFX",
> [OMAP_DSS_VIDEO1] = "VID1",
> [OMAP_DSS_VIDEO2] = "VID2",
> + [OMAP_DSS_VIDEO3] = "VID3",
> };
> const char **p_names;
>
> @@ -2985,6 +2991,8 @@ static void print_irq_status(u32 status)
> PIS(OCP_ERR);
> PIS(VID1_FIFO_UNDERFLOW);
> PIS(VID2_FIFO_UNDERFLOW);
> + if (dss_feat_get_num_ovls() > 3)
> + PIS(VID3_FIFO_UNDERFLOW);
> PIS(SYNC_LOST);
> PIS(SYNC_LOST_DIGIT);
> if (dss_has_feature(FEAT_MGR_LCD2))
> @@ -3082,6 +3090,7 @@ static void dispc_error_worker(struct work_struct
> *work)
> DISPC_IRQ_GFX_FIFO_UNDERFLOW,
> DISPC_IRQ_VID1_FIFO_UNDERFLOW,
> DISPC_IRQ_VID2_FIFO_UNDERFLOW,
> + DISPC_IRQ_VID3_FIFO_UNDERFLOW,
> };
>
> static const unsigned sync_lost_bits[] = {
> @@ -3257,6 +3266,8 @@ static void _omap_dispc_initialize_irq(void)
> dispc.irq_error_mask = DISPC_IRQ_MASK_ERROR;
> if (dss_has_feature(FEAT_MGR_LCD2))
> dispc.irq_error_mask |= DISPC_IRQ_SYNC_LOST2;
> + if (dss_feat_get_num_ovls() > 3)
> + dispc.irq_error_mask |= DISPC_IRQ_VID3_FIFO_UNDERFLOW;
>
> /* there's SYNC_LOST_DIGIT waiting after enabling the DSS,
> * so clear it */
> diff --git a/drivers/video/omap2/dss/dispc.h
> b/drivers/video/omap2/dss/dispc.h
> index 6c9ee0a..c06efc3 100644
> --- a/drivers/video/omap2/dss/dispc.h
> +++ b/drivers/video/omap2/dss/dispc.h
> @@ -291,6 +291,8 @@ static inline u16 DISPC_OVL_BASE(enum omap_plane
> plane)
> return 0x00BC;
> case OMAP_DSS_VIDEO2:
> return 0x014C;
> + case OMAP_DSS_VIDEO3:
> + return 0x0300;
> default:
> BUG();
> }
> @@ -304,6 +306,8 @@ static inline u16 DISPC_BA0_OFFSET(enum omap_plane
> plane)
> case OMAP_DSS_VIDEO1:
> case OMAP_DSS_VIDEO2:
> return 0x0000;
> + case OMAP_DSS_VIDEO3:
> + return 0x0008;
> default:
> BUG();
> }
> @@ -316,6 +320,8 @@ static inline u16 DISPC_BA1_OFFSET(enum omap_plane
> plane)
> case OMAP_DSS_VIDEO1:
> case OMAP_DSS_VIDEO2:
> return 0x0004;
> + case OMAP_DSS_VIDEO3:
> + return 0x000C;
> default:
> BUG();
> }
> @@ -330,6 +336,8 @@ static inline u16 DISPC_BA0_UV_OFFSET(enum omap_plane
> plane)
> return 0x0544;
> case OMAP_DSS_VIDEO2:
> return 0x04BC;
> + case OMAP_DSS_VIDEO3:
> + return 0x0310;
> default:
> BUG();
> }
> @@ -344,6 +352,8 @@ static inline u16 DISPC_BA1_UV_OFFSET(enum omap_plane
> plane)
> return 0x0548;
> case OMAP_DSS_VIDEO2:
> return 0x04C0;
> + case OMAP_DSS_VIDEO3:
> + return 0x0314;
> default:
> BUG();
> }
> @@ -356,6 +366,8 @@ static inline u16 DISPC_POS_OFFSET(enum omap_plane
> plane)
> case OMAP_DSS_VIDEO1:
> case OMAP_DSS_VIDEO2:
> return 0x0008;
> + case OMAP_DSS_VIDEO3:
> + return 0x009C;
> default:
> BUG();
> }
> @@ -368,6 +380,8 @@ static inline u16 DISPC_SIZE_OFFSET(enum omap_plane
> plane)
> case OMAP_DSS_VIDEO1:
> case OMAP_DSS_VIDEO2:
> return 0x000C;
> + case OMAP_DSS_VIDEO3:
> + return 0x00A8;
> default:
> BUG();
> }
> @@ -381,6 +395,8 @@ static inline u16 DISPC_ATTR_OFFSET(enum omap_plane
> plane)
> case OMAP_DSS_VIDEO1:
> case OMAP_DSS_VIDEO2:
> return 0x0010;
> + case OMAP_DSS_VIDEO3:
> + return 0x0070;
> default:
> BUG();
> }
> @@ -395,6 +411,8 @@ static inline u16 DISPC_ATTR2_OFFSET(enum omap_plane
> plane)
> return 0x0568;
> case OMAP_DSS_VIDEO2:
> return 0x04DC;
> + case OMAP_DSS_VIDEO3:
> + return 0x032C;
> default:
> BUG();
> }
> @@ -408,6 +426,8 @@ static inline u16 DISPC_FIFO_THRESH_OFFSET(enum
> omap_plane plane)
> case OMAP_DSS_VIDEO1:
> case OMAP_DSS_VIDEO2:
> return 0x0014;
> + case OMAP_DSS_VIDEO3:
> + return 0x008C;
> default:
> BUG();
> }
> @@ -421,6 +441,8 @@ static inline u16 DISPC_FIFO_SIZE_STATUS_OFFSET(enum
> omap_plane plane)
> case OMAP_DSS_VIDEO1:
> case OMAP_DSS_VIDEO2:
> return 0x0018;
> + case OMAP_DSS_VIDEO3:
> + return 0x0088;
> default:
> BUG();
> }
> @@ -434,6 +456,8 @@ static inline u16 DISPC_ROW_INC_OFFSET(enum omap_plane
> plane)
> case OMAP_DSS_VIDEO1:
> case OMAP_DSS_VIDEO2:
> return 0x001C;
> + case OMAP_DSS_VIDEO3:
> + return 0x00A4;
> default:
> BUG();
> }
> @@ -447,6 +471,8 @@ static inline u16 DISPC_PIX_INC_OFFSET(enum omap_plane
> plane)
> case OMAP_DSS_VIDEO1:
> case OMAP_DSS_VIDEO2:
> return 0x0020;
> + case OMAP_DSS_VIDEO3:
> + return 0x0098;
> default:
> BUG();
> }
> @@ -459,6 +485,7 @@ static inline u16 DISPC_WINDOW_SKIP_OFFSET(enum
> omap_plane plane)
> return 0x0034;
> case OMAP_DSS_VIDEO1:
> case OMAP_DSS_VIDEO2:
> + case OMAP_DSS_VIDEO3:
> BUG();
> default:
> BUG();
> @@ -472,6 +499,7 @@ static inline u16 DISPC_TABLE_BA_OFFSET(enum
> omap_plane plane)
> return 0x0038;
> case OMAP_DSS_VIDEO1:
> case OMAP_DSS_VIDEO2:
> + case OMAP_DSS_VIDEO3:
> BUG();
> default:
> BUG();
> @@ -486,6 +514,8 @@ static inline u16 DISPC_FIR_OFFSET(enum omap_plane
> plane)
> case OMAP_DSS_VIDEO1:
> case OMAP_DSS_VIDEO2:
> return 0x0024;
> + case OMAP_DSS_VIDEO3:
> + return 0x0090;
> default:
> BUG();
> }
> @@ -500,6 +530,8 @@ static inline u16 DISPC_FIR2_OFFSET(enum omap_plane
> plane)
> return 0x0580;
> case OMAP_DSS_VIDEO2:
> return 0x055C;
> + case OMAP_DSS_VIDEO3:
> + return 0x0424;
> default:
> BUG();
> }
> @@ -513,6 +545,8 @@ static inline u16 DISPC_PIC_SIZE_OFFSET(enum
> omap_plane plane)
> case OMAP_DSS_VIDEO1:
> case OMAP_DSS_VIDEO2:
> return 0x0028;
> + case OMAP_DSS_VIDEO3:
> + return 0x0094;
> default:
> BUG();
> }
> @@ -527,6 +561,8 @@ static inline u16 DISPC_ACCU0_OFFSET(enum omap_plane
> plane)
> case OMAP_DSS_VIDEO1:
> case OMAP_DSS_VIDEO2:
> return 0x002C;
> + case OMAP_DSS_VIDEO3:
> + return 0x0000;
> default:
> BUG();
> }
> @@ -541,6 +577,8 @@ static inline u16 DISPC_ACCU2_0_OFFSET(enum omap_plane
> plane)
> return 0x0584;
> case OMAP_DSS_VIDEO2:
> return 0x0560;
> + case OMAP_DSS_VIDEO3:
> + return 0x0428;
> default:
> BUG();
> }
> @@ -554,6 +592,8 @@ static inline u16 DISPC_ACCU1_OFFSET(enum omap_plane
> plane)
> case OMAP_DSS_VIDEO1:
> case OMAP_DSS_VIDEO2:
> return 0x0030;
> + case OMAP_DSS_VIDEO3:
> + return 0x0004;
> default:
> BUG();
> }
> @@ -568,6 +608,8 @@ static inline u16 DISPC_ACCU2_1_OFFSET(enum omap_plane
> plane)
> return 0x0588;
> case OMAP_DSS_VIDEO2:
> return 0x0564;
> + case OMAP_DSS_VIDEO3:
> + return 0x042C;
> default:
> BUG();
> }
> @@ -582,6 +624,8 @@ static inline u16 DISPC_FIR_COEF_H_OFFSET(enum
> omap_plane plane, u16 i)
> case OMAP_DSS_VIDEO1:
> case OMAP_DSS_VIDEO2:
> return 0x0034 + i * 0x8;
> + case OMAP_DSS_VIDEO3:
> + return 0x0010 + i * 0x8;
> default:
> BUG();
> }
> @@ -597,6 +641,8 @@ static inline u16 DISPC_FIR_COEF_H2_OFFSET(enum
> omap_plane plane, u16 i)
> return 0x058C + i * 0x8;
> case OMAP_DSS_VIDEO2:
> return 0x0568 + i * 0x8;
> + case OMAP_DSS_VIDEO3:
> + return 0x0430 + i * 0x8;
> default:
> BUG();
> }
> @@ -611,6 +657,8 @@ static inline u16 DISPC_FIR_COEF_HV_OFFSET(enum
> omap_plane plane, u16 i)
> case OMAP_DSS_VIDEO1:
> case OMAP_DSS_VIDEO2:
> return 0x0038 + i * 0x8;
> + case OMAP_DSS_VIDEO3:
> + return 0x0014 + i * 0x8;
> default:
> BUG();
> }
> @@ -626,6 +674,8 @@ static inline u16 DISPC_FIR_COEF_HV2_OFFSET(enum
> omap_plane plane, u16 i)
> return 0x0590 + i * 8;
> case OMAP_DSS_VIDEO2:
> return 0x056C + i * 0x8;
> + case OMAP_DSS_VIDEO3:
> + return 0x0434 + i * 0x8;
> default:
> BUG();
> }
> @@ -639,6 +689,7 @@ static inline u16 DISPC_CONV_COEF_OFFSET(enum
> omap_plane plane, u16 i)
> BUG();
> case OMAP_DSS_VIDEO1:
> case OMAP_DSS_VIDEO2:
> + case OMAP_DSS_VIDEO3:
> return 0x0074 + i * 0x4;
> default:
> BUG();
> @@ -655,6 +706,8 @@ static inline u16 DISPC_FIR_COEF_V_OFFSET(enum
> omap_plane plane, u16 i)
> return 0x0124 + i * 0x4;
> case OMAP_DSS_VIDEO2:
> return 0x00B4 + i * 0x4;
> + case OMAP_DSS_VIDEO3:
> + return 0x0050 + i * 0x4;
> default:
> BUG();
> }
> @@ -670,6 +723,8 @@ static inline u16 DISPC_FIR_COEF_V2_OFFSET(enum
> omap_plane plane, u16 i)
> return 0x05CC + i * 0x4;
> case OMAP_DSS_VIDEO2:
> return 0x05A8 + i * 0x4;
> + case OMAP_DSS_VIDEO3:
> + return 0x0470 + i * 0x4;
> default:
> BUG();
> }
> @@ -684,6 +739,8 @@ static inline u16 DISPC_PRELOAD_OFFSET(enum omap_plane
> plane)
> return 0x0174;
> case OMAP_DSS_VIDEO2:
> return 0x00E8;
> + case OMAP_DSS_VIDEO3:
> + return 0x00A0;
> default:
> BUG();
> }
> diff --git a/drivers/video/omap2/dss/dss_features.c
> b/drivers/video/omap2/dss/dss_features.c
> index 70d5b9e..e5e94f4 100644
> --- a/drivers/video/omap2/dss/dss_features.c
> +++ b/drivers/video/omap2/dss/dss_features.c
> @@ -210,6 +210,16 @@ static const enum omap_color_mode
> omap4_dss_supported_color_modes[] = {
> OMAP_DSS_COLOR_ARGB16 | OMAP_DSS_COLOR_XRGB16_1555 |
> OMAP_DSS_COLOR_ARGB32 | OMAP_DSS_COLOR_RGBX16 |
> OMAP_DSS_COLOR_RGBX32,
> +
> + /* OMAP_DSS_VIDEO3 */
> + OMAP_DSS_COLOR_RGB16 | OMAP_DSS_COLOR_RGB12U |
> + OMAP_DSS_COLOR_YUV2 | OMAP_DSS_COLOR_ARGB16_1555 |
> + OMAP_DSS_COLOR_RGBA32 | OMAP_DSS_COLOR_NV12 |
> + OMAP_DSS_COLOR_RGBA16 | OMAP_DSS_COLOR_RGB24U |
> + OMAP_DSS_COLOR_RGB24P | OMAP_DSS_COLOR_UYVY |
> + OMAP_DSS_COLOR_ARGB16 | OMAP_DSS_COLOR_XRGB16_1555 |
> + OMAP_DSS_COLOR_ARGB32 | OMAP_DSS_COLOR_RGBX16 |
> + OMAP_DSS_COLOR_RGBX32,
> };
>
> static const enum omap_overlay_caps omap2_dss_overlay_caps[] = {
> @@ -258,6 +268,10 @@ static const enum omap_overlay_caps
> omap4_dss_overlay_caps[] = {
> /* OMAP_DSS_VIDEO2 */
> OMAP_DSS_OVL_CAP_SCALE | OMAP_DSS_OVL_CAP_GLOBAL_ALPHA |
> OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA | OMAP_DSS_OVL_CAP_ZORDER,
> +
> + /* OMAP_DSS_VIDEO3 */
> + OMAP_DSS_OVL_CAP_SCALE | OMAP_DSS_OVL_CAP_GLOBAL_ALPHA |
> + OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA | OMAP_DSS_OVL_CAP_ZORDER,
> };
>
> static const char * const omap2_dss_clk_source_names[] = {
> @@ -401,7 +415,7 @@ static const struct omap_dss_features
> omap4430_es1_0_dss_features = {
> FEAT_ALPHA_FREE_ZORDER,
>
> .num_mgrs = 3,
> - .num_ovls = 3,
> + .num_ovls = 4,
> .supported_displays = omap4_dss_supported_displays,
> .supported_color_modes = omap4_dss_supported_color_modes,
> .overlay_caps = omap4_dss_overlay_caps,
> @@ -425,7 +439,7 @@ static const struct omap_dss_features
> omap4_dss_features = {
> FEAT_PRELOAD | FEAT_FIR_COEF_V | FEAT_ALPHA_FREE_ZORDER,
>
> .num_mgrs = 3,
> - .num_ovls = 3,
> + .num_ovls = 4,
> .supported_displays = omap4_dss_supported_displays,
> .supported_color_modes = omap4_dss_supported_color_modes,
> .overlay_caps = omap4_dss_overlay_caps,
> diff --git a/drivers/video/omap2/dss/dss_features.h
> b/drivers/video/omap2/dss/dss_features.h
> index e81271a..6a6c05d 100644
> --- a/drivers/video/omap2/dss/dss_features.h
> +++ b/drivers/video/omap2/dss/dss_features.h
> @@ -25,7 +25,7 @@
> #endif
>
> #define MAX_DSS_MANAGERS 3
> -#define MAX_DSS_OVERLAYS 3
> +#define MAX_DSS_OVERLAYS 4
[Hiremath, Vaibhav] Not related to this patch as such, but I think we should now get rid of these macros and use run-time mechanism.
Overall this patch looks ok to me, I will test it tomorrow and will update you.
Thanks,
Vaibhav
> #define MAX_DSS_LCD_MANAGERS 2
> #define MAX_NUM_DSI 2
>
> diff --git a/drivers/video/omap2/dss/overlay.c
> b/drivers/video/omap2/dss/overlay.c
> index afb7583..11d21e3 100644
> --- a/drivers/video/omap2/dss/overlay.c
> +++ b/drivers/video/omap2/dss/overlay.c
> @@ -615,6 +615,11 @@ void dss_init_overlays(struct platform_device *pdev)
> ovl->id = OMAP_DSS_VIDEO2;
> ovl->info.global_alpha = 255;
> break;
> + case 3:
> + ovl->name = "vid3";
> + ovl->id = OMAP_DSS_VIDEO3;
> + ovl->info.global_alpha = 255;
> + break;
> }
>
> ovl->set_manager = &omap_dss_set_manager;
> diff --git a/include/video/omapdss.h b/include/video/omapdss.h
> index 5f0ce5e..1f12559 100644
> --- a/include/video/omapdss.h
> +++ b/include/video/omapdss.h
> @@ -41,6 +41,8 @@
> #define DISPC_IRQ_WAKEUP (1 << 16)
> #define DISPC_IRQ_SYNC_LOST2 (1 << 17)
> #define DISPC_IRQ_VSYNC2 (1 << 18)
> +#define DISPC_IRQ_VID3_END_WIN (1 << 19)
> +#define DISPC_IRQ_VID3_FIFO_UNDERFLOW (1 << 20)
> #define DISPC_IRQ_ACBIAS_COUNT_STAT2 (1 << 21)
> #define DISPC_IRQ_FRAMEDONE2 (1 << 22)
> #define DISPC_IRQ_FRAMEDONEWB (1 << 23)
> @@ -63,7 +65,8 @@ enum omap_display_type {
> enum omap_plane {
> OMAP_DSS_GFX = 0,
> OMAP_DSS_VIDEO1 = 1,
> - OMAP_DSS_VIDEO2 = 2
> + OMAP_DSS_VIDEO2 = 2,
> + OMAP_DSS_VIDEO3 = 3,
> };
>
> enum omap_channel {
> --
> 1.7.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 1/3] OMAPDSS/OMAP_VOUT: Fix incorrect OMAP3-alpha compatibility setting
2011-09-19 19:36 ` Hiremath, Vaibhav
@ 2011-09-20 6:44 ` Archit Taneja
0 siblings, 0 replies; 8+ messages in thread
From: Archit Taneja @ 2011-09-20 6:44 UTC (permalink / raw)
To: Hiremath, Vaibhav
Cc: Valkeinen, Tomi, linux-omap@vger.kernel.org,
linux-media@vger.kernel.org, Molnar, Lajos
Hi,
On Tuesday 20 September 2011 01:06 AM, Hiremath, Vaibhav wrote:
>
>> -----Original Message-----
>> From: Taneja, Archit
>> Sent: Friday, September 16, 2011 12:09 PM
>> To: Valkeinen, Tomi
>> Cc: Hiremath, Vaibhav; linux-omap@vger.kernel.org; Taneja, Archit; linux-
>> media@vger.kernel.org; Molnar, Lajos
>> Subject: [PATCH v2 1/3] OMAPDSS/OMAP_VOUT: Fix incorrect OMAP3-alpha
>> compatibility setting
>>
> [Hiremath, Vaibhav] Few minor comments below -
>
>> 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
> [Hiremath, Vaibhav] Spelling mistake???
Thanks, I'll fix this.
>
>> 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 int 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.
>>
>> Initial patch was made by: Lajos Molnar<molnar@ti.com>
>>
> [Hiremath, Vaibhav] I think you can put his sign-off as well and remove this line or move it below ---
Okay, I'll wait for his comments, and then put his sign-off.
>
>
>> Cc: linux-media@vger.kernel.org
>> Cc: Lajos Molnar<molnar@ti.com>
>> Signed-off-by: Archit Taneja<archit@ti.com>
>> ---
>> drivers/media/video/omap/omap_vout.c | 16 +++++++++++-----
>> drivers/video/omap2/dss/dispc.c | 24 ++++++++++++------------
>> drivers/video/omap2/dss/dss.h | 4 ++--
>> drivers/video/omap2/dss/dss_features.c | 22 +++++++++++-----------
>> drivers/video/omap2/dss/dss_features.h | 3 ++-
>> drivers/video/omap2/dss/manager.c | 28 +++++++++++++++++++--------
>> -
>> include/video/omapdss.h | 3 ++-
>> 7 files changed, 59 insertions(+), 41 deletions(-)
>>
>> diff --git a/drivers/media/video/omap/omap_vout.c
>> b/drivers/media/video/omap/omap_vout.c
>> index b3a5ecd..95daf98 100644
>> --- a/drivers/media/video/omap/omap_vout.c
>> +++ b/drivers/media/video/omap/omap_vout.c
>> @@ -1165,12 +1165,17 @@ static int vidioc_try_fmt_vid_overlay(struct file
>> *file, void *fh,
>> {
>> int ret = 0;
>> struct omap_vout_device *vout = fh;
>> + struct omap_overlay *ovl;
>> + struct omapvideo_info *ovid;
>> struct v4l2_window *win =&f->fmt.win;
>>
>> + ovid =&vout->vid_info;
>> + ovl = ovid->overlays[0];
>> +
> [Hiremath, Vaibhav] I think it will be helpful if you put some comment above this line on why video1, something like,
>
> /*
> * Global alpha is not supported on Video1 pipeline/overlay
> */
Sure, i'll add this comment.
>
>> ret = omap_vout_try_window(&vout->fbuf, win);
>>
>> if (!ret) {
>> - if (vout->vid == OMAP_VIDEO1)
>> + if ((ovl->caps& OMAP_DSS_OVL_CAP_GLOBAL_ALPHA) == 0)
>> win->global_alpha = 255;
>> else
>> win->global_alpha = f->fmt.win.global_alpha;
>> @@ -1194,8 +1199,7 @@ static int vidioc_s_fmt_vid_overlay(struct file
>> *file, void *fh,
>>
>> ret = omap_vout_new_window(&vout->crop,&vout->win,&vout->fbuf,
>> win);
>> if (!ret) {
>> - /* Video1 plane does not support global alpha */
>> - if (ovl->id == OMAP_DSS_VIDEO1)
>> + if ((ovl->caps& OMAP_DSS_OVL_CAP_GLOBAL_ALPHA) == 0)
>> vout->win.global_alpha = 255;
>> else
>> vout->win.global_alpha = f->fmt.win.global_alpha;
>> @@ -1788,7 +1792,9 @@ static int vidioc_s_fbuf(struct file *file, void *fh,
>> if (ovl->manager&& ovl->manager->get_manager_info&&
>> ovl->manager->set_manager_info) {
>> ovl->manager->get_manager_info(ovl->manager,&info);
>> - info.alpha_enabled = enable;
>> + /* enable this only if there is no zorder cap */
>> + if ((ovl->caps& OMAP_DSS_OVL_CAP_ZORDER) == 0)
>> + info.partial_alpha_enabled = enable;
>> if (ovl->manager->set_manager_info(ovl->manager,&info))
>> return -EINVAL;
>> }
>> @@ -1820,7 +1826,7 @@ static int vidioc_g_fbuf(struct file *file, void *fh,
>> }
>> if (ovl->manager&& ovl->manager->get_manager_info) {
>> ovl->manager->get_manager_info(ovl->manager,&info);
>> - if (info.alpha_enabled)
>> + if (info.partial_alpha_enabled)
>> a->flags |= V4L2_FBUF_FLAG_LOCAL_ALPHA;
>> }
>>
>> diff --git a/drivers/video/omap2/dss/dispc.c
>> b/drivers/video/omap2/dss/dispc.c
>> index 5e6849e..e0639d3 100644
>> --- a/drivers/video/omap2/dss/dispc.c
>> +++ b/drivers/video/omap2/dss/dispc.c
>> @@ -179,7 +179,8 @@ static void dispc_save_context(void)
>> SR(CONTROL);
>> SR(CONFIG);
>> SR(LINE_NUMBER);
>> - if (dss_has_feature(FEAT_GLOBAL_ALPHA))
>> + if (dss_has_feature(FEAT_ALPHA_FIXED_ZORDER) ||
>> + dss_has_feature(FEAT_ALPHA_FREE_ZORDER))
>> SR(GLOBAL_ALPHA);
>> if (dss_has_feature(FEAT_MGR_LCD2)) {
>> SR(CONTROL2);
>> @@ -293,7 +294,8 @@ static void dispc_restore_context(void)
>> /*RR(CONTROL);*/
>> RR(CONFIG);
>> RR(LINE_NUMBER);
>> - if (dss_has_feature(FEAT_GLOBAL_ALPHA))
>> + if (dss_has_feature(FEAT_ALPHA_FIXED_ZORDER) ||
>> + dss_has_feature(FEAT_ALPHA_FREE_ZORDER))
>> RR(GLOBAL_ALPHA);
>> if (dss_has_feature(FEAT_MGR_LCD2))
>> RR(CONFIG2);
>> @@ -2159,38 +2161,35 @@ void dispc_mgr_enable_trans_key(enum omap_channel
>> ch, bool enable)
>> else /* OMAP_DSS_CHANNEL_LCD2 */
>> REG_FLD_MOD(DISPC_CONFIG2, enable, 10, 10);
>> }
>> -void dispc_mgr_enable_alpha_blending(enum omap_channel ch, bool enable)
>> +
>> +void dispc_mgr_enable_alpha_fixed_zorder(enum omap_channel ch, bool
>> enable)
>> {
>> - if (!dss_has_feature(FEAT_GLOBAL_ALPHA))
>> + if (!dss_has_feature(FEAT_ALPHA_FIXED_ZORDER))
>> return;
>>
>> if (ch == OMAP_DSS_CHANNEL_LCD)
>> REG_FLD_MOD(DISPC_CONFIG, enable, 18, 18);
>> else if (ch == OMAP_DSS_CHANNEL_DIGIT)
>> REG_FLD_MOD(DISPC_CONFIG, enable, 19, 19);
>> - else /* OMAP_DSS_CHANNEL_LCD2 */
>> - REG_FLD_MOD(DISPC_CONFIG2, enable, 18, 18);
>> }
>> -bool dispc_mgr_alpha_blending_enabled(enum omap_channel ch)
>> +
>> +bool dispc_mgr_alpha_fixed_zorder_enabled(enum omap_channel ch)
>> {
>> bool enabled;
>>
>> - if (!dss_has_feature(FEAT_GLOBAL_ALPHA))
>> + if (!dss_has_feature(FEAT_ALPHA_FIXED_ZORDER))
>> return false;
>>
>> if (ch == OMAP_DSS_CHANNEL_LCD)
>> enabled = REG_GET(DISPC_CONFIG, 18, 18);
>> else if (ch == OMAP_DSS_CHANNEL_DIGIT)
>> enabled = REG_GET(DISPC_CONFIG, 19, 19);
>> - else if (ch == OMAP_DSS_CHANNEL_LCD2)
>> - enabled = REG_GET(DISPC_CONFIG2, 18, 18);
>> else
>> BUG();
>>
>> return enabled;
>> }
>>
>> -
>> bool dispc_mgr_trans_key_enabled(enum omap_channel ch)
>> {
>> bool enabled;
>> @@ -2603,7 +2602,8 @@ void dispc_dump_regs(struct seq_file *s)
>> DUMPREG(DISPC_CAPABLE);
>> DUMPREG(DISPC_LINE_STATUS);
>> DUMPREG(DISPC_LINE_NUMBER);
>> - if (dss_has_feature(FEAT_GLOBAL_ALPHA))
>> + if (dss_has_feature(FEAT_ALPHA_FIXED_ZORDER) ||
>> + dss_has_feature(FEAT_ALPHA_FREE_ZORDER))
>> DUMPREG(DISPC_GLOBAL_ALPHA);
>> if (dss_has_feature(FEAT_MGR_LCD2)) {
>> DUMPREG(DISPC_CONTROL2);
>> diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
>> index 47eebd8..a37aef2 100644
>> --- a/drivers/video/omap2/dss/dss.h
>> +++ b/drivers/video/omap2/dss/dss.h
>> @@ -430,9 +430,9 @@ void dispc_mgr_get_trans_key(enum omap_channel ch,
>> enum omap_dss_trans_key_type *type,
>> u32 *trans_key);
>> void dispc_mgr_enable_trans_key(enum omap_channel ch, bool enable);
>> -void dispc_mgr_enable_alpha_blending(enum omap_channel ch, bool enable);
>> +void dispc_mgr_enable_alpha_fixed_zorder(enum omap_channel ch, bool
>> enable);
>> bool dispc_mgr_trans_key_enabled(enum omap_channel ch);
>> -bool dispc_mgr_alpha_blending_enabled(enum omap_channel ch);
>> +bool dispc_mgr_alpha_fixed_zorder_enabled(enum omap_channel ch);
>> void dispc_mgr_set_lcd_timings(enum omap_channel channel,
>> struct omap_video_timings *timings);
>> void dispc_mgr_set_pol_freq(enum omap_channel channel,
>> diff --git a/drivers/video/omap2/dss/dss_features.c
>> b/drivers/video/omap2/dss/dss_features.c
>> index 47e66d8..70d5b9e 100644
>> --- a/drivers/video/omap2/dss/dss_features.c
>> +++ b/drivers/video/omap2/dss/dss_features.c
>> @@ -248,15 +248,16 @@ static const enum omap_overlay_caps
>> omap3630_dss_overlay_caps[] = {
>>
>> static const enum omap_overlay_caps omap4_dss_overlay_caps[] = {
>> /* OMAP_DSS_GFX */
>> - OMAP_DSS_OVL_CAP_GLOBAL_ALPHA | OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA,
>> + OMAP_DSS_OVL_CAP_GLOBAL_ALPHA | OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA |
>> + OMAP_DSS_OVL_CAP_ZORDER,
>>
>> /* OMAP_DSS_VIDEO1 */
>> OMAP_DSS_OVL_CAP_SCALE | OMAP_DSS_OVL_CAP_GLOBAL_ALPHA |
>> - OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA,
>> + OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA | OMAP_DSS_OVL_CAP_ZORDER,
>>
>> /* OMAP_DSS_VIDEO2 */
>> OMAP_DSS_OVL_CAP_SCALE | OMAP_DSS_OVL_CAP_GLOBAL_ALPHA |
>> - OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA,
>> + OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA | OMAP_DSS_OVL_CAP_ZORDER,
>> };
>>
>> static const char * const omap2_dss_clk_source_names[] = {
>> @@ -342,13 +343,13 @@ static const struct omap_dss_features
>> omap3430_dss_features = {
>> .num_reg_fields = ARRAY_SIZE(omap3_dss_reg_fields),
>>
>> .has_feature =
>> - FEAT_GLOBAL_ALPHA | FEAT_LCDENABLEPOL |
>> + FEAT_LCDENABLEPOL |
>> FEAT_LCDENABLESIGNAL | FEAT_PCKFREEENABLE |
>> FEAT_FUNCGATED | FEAT_ROWREPEATENABLE |
>> FEAT_LINEBUFFERSPLIT | FEAT_RESIZECONF |
>> FEAT_DSI_PLL_FREQSEL | FEAT_DSI_REVERSE_TXCLKESC |
>> FEAT_VENC_REQUIRES_TV_DAC_CLK | FEAT_CPR | FEAT_PRELOAD |
>> - FEAT_FIR_COEF_V,
>> + FEAT_FIR_COEF_V | FEAT_ALPHA_FIXED_ZORDER,
>>
>> .num_mgrs = 2,
>> .num_ovls = 3,
>> @@ -366,13 +367,13 @@ static const struct omap_dss_features
>> omap3630_dss_features = {
>> .num_reg_fields = ARRAY_SIZE(omap3_dss_reg_fields),
>>
>> .has_feature =
>> - FEAT_GLOBAL_ALPHA | FEAT_LCDENABLEPOL |
>> + FEAT_LCDENABLEPOL |
>> FEAT_LCDENABLESIGNAL | FEAT_PCKFREEENABLE |
>> FEAT_FUNCGATED |
>> FEAT_ROWREPEATENABLE | FEAT_LINEBUFFERSPLIT |
>> FEAT_RESIZECONF | FEAT_DSI_PLL_PWR_BUG |
>> FEAT_DSI_PLL_FREQSEL | FEAT_CPR | FEAT_PRELOAD |
>> - FEAT_FIR_COEF_V,
>> + FEAT_FIR_COEF_V | FEAT_ALPHA_FIXED_ZORDER,
>>
>> .num_mgrs = 2,
>> .num_ovls = 3,
>> @@ -392,12 +393,12 @@ static const struct omap_dss_features
>> omap4430_es1_0_dss_features = {
>> .num_reg_fields = ARRAY_SIZE(omap4_dss_reg_fields),
>>
>> .has_feature =
>> - FEAT_GLOBAL_ALPHA |
>> FEAT_MGR_LCD2 |
>> FEAT_CORE_CLK_DIV | FEAT_LCD_CLK_SRC |
>> FEAT_DSI_DCS_CMD_CONFIG_VC | FEAT_DSI_VC_OCP_WIDTH |
>> FEAT_DSI_GNQ | FEAT_HANDLE_UV_SEPARATE | FEAT_ATTR2 |
>> - FEAT_CPR | FEAT_PRELOAD | FEAT_FIR_COEF_V,
>> + FEAT_CPR | FEAT_PRELOAD | FEAT_FIR_COEF_V |
>> + FEAT_ALPHA_FREE_ZORDER,
>>
>> .num_mgrs = 3,
>> .num_ovls = 3,
>> @@ -416,13 +417,12 @@ static const struct omap_dss_features
>> omap4_dss_features = {
>> .num_reg_fields = ARRAY_SIZE(omap4_dss_reg_fields),
>>
>> .has_feature =
>> - FEAT_GLOBAL_ALPHA |
>> FEAT_MGR_LCD2 |
>> FEAT_CORE_CLK_DIV | FEAT_LCD_CLK_SRC |
>> FEAT_DSI_DCS_CMD_CONFIG_VC | FEAT_DSI_VC_OCP_WIDTH |
>> FEAT_DSI_GNQ | FEAT_HDMI_CTS_SWMODE |
>> FEAT_HANDLE_UV_SEPARATE | FEAT_ATTR2 | FEAT_CPR |
>> - FEAT_PRELOAD | FEAT_FIR_COEF_V,
>> + FEAT_PRELOAD | FEAT_FIR_COEF_V | FEAT_ALPHA_FREE_ZORDER,
>>
>> .num_mgrs = 3,
>> .num_ovls = 3,
>> diff --git a/drivers/video/omap2/dss/dss_features.h
>> b/drivers/video/omap2/dss/dss_features.h
>> index cd60644..e81271a 100644
>> --- a/drivers/video/omap2/dss/dss_features.h
>> +++ b/drivers/video/omap2/dss/dss_features.h
>> @@ -31,7 +31,6 @@
>>
>> /* DSS has feature id */
>> enum dss_feat_id {
>> - FEAT_GLOBAL_ALPHA = 1<< 0,
> [Hiremath, Vaibhav] Do you think we should clean this order now?
>
> I will test these patches tomorrow and will update you.
We were planning to represent the enums in a different form
anyway(because we will hit 32 features soon), so this wouldn't exist in
this form in the near future.
Thanks,
Archit
>
> Thanks,
> Vaibhav
>
>> FEAT_LCDENABLEPOL = 1<< 3,
>> FEAT_LCDENABLESIGNAL = 1<< 4,
>> FEAT_PCKFREEENABLE = 1<< 5,
>> @@ -57,6 +56,8 @@ enum dss_feat_id {
>> FEAT_CPR = 1<< 23,
>> FEAT_PRELOAD = 1<< 24,
>> FEAT_FIR_COEF_V = 1<< 25,
>> + FEAT_ALPHA_FIXED_ZORDER = 1<< 26,
>> + FEAT_ALPHA_FREE_ZORDER = 1<< 27,
>> };
>>
>> /* DSS register field id */
>> diff --git a/drivers/video/omap2/dss/manager.c
>> b/drivers/video/omap2/dss/manager.c
>> index fdbbeeb..6e63845 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,
>> static ssize_t manager_alpha_blending_enabled_show(
>> struct omap_overlay_manager *mgr, char *buf)
>> {
>> - return snprintf(buf, PAGE_SIZE, "%d\n", mgr->info.alpha_enabled);
>> + WARN_ON(!dss_has_feature(FEAT_ALPHA_FIXED_ZORDER));
>> +
>> + return snprintf(buf, PAGE_SIZE, "%d\n",
>> + mgr->info.partial_alpha_enabled);
>> }
>>
>> static ssize_t manager_alpha_blending_enabled_store(
>> @@ -260,13 +263,15 @@ static ssize_t manager_alpha_blending_enabled_store(
>> bool enable;
>> int r;
>>
>> + WARN_ON(!dss_has_feature(FEAT_ALPHA_FIXED_ZORDER));
>> +
>> r = strtobool(buf,&enable);
>> if (r)
>> return r;
>>
>> mgr->get_manager_info(mgr,&info);
>>
>> - info.alpha_enabled = enable;
>> + info.partial_alpha_enabled = enable;
>>
>> r = mgr->set_manager_info(mgr,&info);
>> if (r)
>> @@ -966,7 +971,7 @@ static void configure_manager(enum omap_channel
>> channel)
>> dispc_mgr_set_default_color(channel, mi->default_color);
>> dispc_mgr_set_trans_key(channel, mi->trans_key_type, mi->trans_key);
>> dispc_mgr_enable_trans_key(channel, mi->trans_enabled);
>> - dispc_mgr_enable_alpha_blending(channel, mi->alpha_enabled);
>> + dispc_mgr_enable_alpha_fixed_zorder(channel, mi-
>>> partial_alpha_enabled);
>> if (dss_has_feature(FEAT_CPR)) {
>> dispc_mgr_enable_cpr(channel, mi->cpr_enable);
>> dispc_mgr_set_cpr_coef(channel,&mi->cpr_coefs);
>> @@ -1481,12 +1486,17 @@ static int omap_dss_mgr_apply(struct
>> omap_overlay_manager *mgr)
>>
>> static int dss_check_manager(struct omap_overlay_manager *mgr)
>> {
>> - /* OMAP supports only graphics source transparency color key and
>> alpha
>> - * blending simultaneously. See TRM 15.4.2.4.2.2 Alpha Mode */
>> -
>> - if (mgr->info.alpha_enabled&& mgr->info.trans_enabled&&
>> - mgr->info.trans_key_type != OMAP_DSS_COLOR_KEY_GFX_DST)
>> - return -EINVAL;
>> + if (dss_has_feature(FEAT_ALPHA_FIXED_ZORDER)) {
>> + /*
>> + * OMAP3 supports only graphics source transparency color key
>> + * and alpha blending simultaneously. See TRM 15.4.2.4.2.2
>> + * Alpha Mode
>> + */
>> + if (mgr->info.partial_alpha_enabled&& mgr->info.trans_enabled
>> +&& mgr->info.trans_key_type !=
>> + OMAP_DSS_COLOR_KEY_GFX_DST)
>> + return -EINVAL;
>> + }
>>
>> return 0;
>> }
>> diff --git a/include/video/omapdss.h b/include/video/omapdss.h
>> index c62b9a4..5f0ce5e 100644
>> --- a/include/video/omapdss.h
>> +++ b/include/video/omapdss.h
>> @@ -179,6 +179,7 @@ enum omap_overlay_caps {
>> OMAP_DSS_OVL_CAP_SCALE = 1<< 0,
>> OMAP_DSS_OVL_CAP_GLOBAL_ALPHA = 1<< 1,
>> OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA = 1<< 2,
>> + OMAP_DSS_OVL_CAP_ZORDER = 1<< 3,
>> };
>>
>> enum omap_overlay_manager_caps {
>> @@ -406,7 +407,7 @@ struct omap_overlay_manager_info {
>> u32 trans_key;
>> bool trans_enabled;
>>
>> - bool alpha_enabled;
>> + bool partial_alpha_enabled;
>>
>> bool cpr_enable;
>> struct omap_dss_cpr_coefs cpr_coefs;
>> --
>> 1.7.1
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 2/3] OMAPDSS: DISPC: VIDEO3 pipeline support
2011-09-19 19:43 ` Hiremath, Vaibhav
@ 2011-09-20 6:55 ` Archit Taneja
0 siblings, 0 replies; 8+ messages in thread
From: Archit Taneja @ 2011-09-20 6:55 UTC (permalink / raw)
To: Hiremath, Vaibhav; +Cc: Valkeinen, Tomi, linux-omap@vger.kernel.org
Hi,
On Tuesday 20 September 2011 01:13 AM, Hiremath, Vaibhav wrote:
>
>> -----Original Message-----
>> From: Taneja, Archit
>> Sent: Friday, September 16, 2011 12:09 PM
>> To: Valkeinen, Tomi
>> Cc: Hiremath, Vaibhav; linux-omap@vger.kernel.org; Taneja, Archit
>> Subject: [PATCH v2 2/3] OMAPDSS: DISPC: VIDEO3 pipeline support
>>
>> Add support for VIDEO3 pipeline on OMAP4:
>> - Add VIDEO3 pipeline information in dss_features and omapdss.h
>> - Add VIDEO3 pipeline register coefficients in dispc.h
>> - Create a new overlay structure corresponding to VIDEO3.
>> - Make changes in dispc.c for VIDEO3
>>
>> Signed-off-by: Archit Taneja<archit@ti.com>
<snip>
>> diff --git a/drivers/video/omap2/dss/dss_features.h
>> b/drivers/video/omap2/dss/dss_features.h
>> index e81271a..6a6c05d 100644
>> --- a/drivers/video/omap2/dss/dss_features.h
>> +++ b/drivers/video/omap2/dss/dss_features.h
>> @@ -25,7 +25,7 @@
>> #endif
>>
>> #define MAX_DSS_MANAGERS 3
>> -#define MAX_DSS_OVERLAYS 3
>> +#define MAX_DSS_OVERLAYS 4
> [Hiremath, Vaibhav] Not related to this patch as such, but I think we should now get rid of these macros and use run-time mechanism.
This macro is used within DSS2 to declare the size of some arrays. So a
runtime mechanism isn't possible(unless we allocate the arrays
dynamically itself, but they are used for trivial purposes, and won't be
large in size, so I don't think that this is needed).
We anyway use the function omap_dss_get_num_overlays() wherever possible.
>
> Overall this patch looks ok to me, I will test it tomorrow and will update you.
Thanks,
Archit
>
> Thanks,
> Vaibhav
>
>> #define MAX_DSS_LCD_MANAGERS 2
>> #define MAX_NUM_DSI 2
>>
>> diff --git a/drivers/video/omap2/dss/overlay.c
>> b/drivers/video/omap2/dss/overlay.c
>> index afb7583..11d21e3 100644
>> --- a/drivers/video/omap2/dss/overlay.c
>> +++ b/drivers/video/omap2/dss/overlay.c
>> @@ -615,6 +615,11 @@ void dss_init_overlays(struct platform_device *pdev)
>> ovl->id = OMAP_DSS_VIDEO2;
>> ovl->info.global_alpha = 255;
>> break;
>> + case 3:
>> + ovl->name = "vid3";
>> + ovl->id = OMAP_DSS_VIDEO3;
>> + ovl->info.global_alpha = 255;
>> + break;
>> }
>>
>> ovl->set_manager =&omap_dss_set_manager;
>> diff --git a/include/video/omapdss.h b/include/video/omapdss.h
>> index 5f0ce5e..1f12559 100644
>> --- a/include/video/omapdss.h
>> +++ b/include/video/omapdss.h
>> @@ -41,6 +41,8 @@
>> #define DISPC_IRQ_WAKEUP (1<< 16)
>> #define DISPC_IRQ_SYNC_LOST2 (1<< 17)
>> #define DISPC_IRQ_VSYNC2 (1<< 18)
>> +#define DISPC_IRQ_VID3_END_WIN (1<< 19)
>> +#define DISPC_IRQ_VID3_FIFO_UNDERFLOW (1<< 20)
>> #define DISPC_IRQ_ACBIAS_COUNT_STAT2 (1<< 21)
>> #define DISPC_IRQ_FRAMEDONE2 (1<< 22)
>> #define DISPC_IRQ_FRAMEDONEWB (1<< 23)
>> @@ -63,7 +65,8 @@ enum omap_display_type {
>> enum omap_plane {
>> OMAP_DSS_GFX = 0,
>> OMAP_DSS_VIDEO1 = 1,
>> - OMAP_DSS_VIDEO2 = 2
>> + OMAP_DSS_VIDEO2 = 2,
>> + OMAP_DSS_VIDEO3 = 3,
>> };
>>
>> enum omap_channel {
>> --
>> 1.7.1
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2011-09-20 6:53 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-16 6:39 [PATCH v2 0/3] OMAPDSS: DISPC: VIDEO3 and ZORDER support Archit Taneja
2011-09-16 6:39 ` [PATCH v2 1/3] OMAPDSS/OMAP_VOUT: Fix incorrect OMAP3-alpha compatibility setting Archit Taneja
2011-09-19 19:36 ` Hiremath, Vaibhav
2011-09-20 6:44 ` Archit Taneja
2011-09-16 6:39 ` [PATCH v2 2/3] OMAPDSS: DISPC: VIDEO3 pipeline support Archit Taneja
2011-09-19 19:43 ` Hiremath, Vaibhav
2011-09-20 6:55 ` Archit Taneja
2011-09-16 6:39 ` [PATCH v2 3/3] OMAPDSS: DISPC: zorder support for DSS overlays Archit Taneja
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox