Skip to contentSkip to conversation

OMAPDSS: DISPC: VIDEO3 and ZORDER support

PATCH Superseded Archit Taneja 2 participants 8 messages Sep 16, 2011 – Sep 20, 2011

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover OMAPDSS: DISPC: VIDEO3 and ZORDER support

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(-)
#1 lore raw

PATCH v2 1/3 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 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 <[email protected]>

---
 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(-)
drivers/media/video/omap/omap_vout.c +11 -5
index b3a5ecd..95daf98 100644
@@ -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;
 	}
 
drivers/video/omap2/dss/dispc.c +12 -12
index 5e6849e..e0639d3 100644
@@ -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);
drivers/video/omap2/dss/dss.h +2 -2
index 47eebd8..a37aef2 100644
@@ -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,
drivers/video/omap2/dss/dss_features.c +11 -11
index 47e66d8..70d5b9e 100644
@@ -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,
drivers/video/omap2/dss/dss_features.h +2 -1
index cd60644..e81271a 100644
@@ -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 */
drivers/video/omap2/dss/manager.c +19 -9
index fdbbeeb..6e63845 100644
@@ -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;
 }
include/video/omapdss.h +2 -1
index c62b9a4..5f0ce5e 100644
@@ -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;
Signature · 1 line
1.7.1
#4 lore raw

PATCH v2 2/3 OMAPDSS: DISPC: VIDEO3 pipeline support

In reply to 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

---
 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(-)
drivers/video/omap2/dss/dispc.c +14 -3
index e0639d3..fa7aadf 100644
@@ -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 */
drivers/video/omap2/dss/dispc.h +57 -0

237 lines not on this page · raw message

drivers/video/omap2/dss/dss_features.c +16 -2
index 70d5b9e..e5e94f4 100644
@@ -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,
drivers/video/omap2/dss/dss_features.h +1 -1
index e81271a..6a6c05d 100644
@@ -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
 
drivers/video/omap2/dss/overlay.c +5 -0
index afb7583..11d21e3 100644
@@ -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;
include/video/omapdss.h +4 -1
index 5f0ce5e..1f12559 100644
@@ -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 {
Signature · 1 line
1.7.1
#7 lore raw

PATCH v2 3/3 OMAPDSS: DISPC: zorder support for DSS overlays

In reply to 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.

---
 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(-)
drivers/video/omap2/dss/dispc.c +24 -0
index fa7aadf..6892cfd 100644
@@ -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 */
drivers/video/omap2/dss/overlay.c +72 -0

123 lines not on this page · raw message

include/video/omapdss.h +1 -0
index 1f12559..9cd61e8 100644
@@ -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 {
Signature · 1 line
1.7.1
#2 lore raw

RE: [PATCH v2 1/3] OMAPDSS/OMAP_VOUT: Fix incorrect OMAP3-alpha compatibility setting

In reply to Archit Taneja
Quoted 10 lines

-----Original Message-----
From: Taneja, Archit
Sent: Friday, September 16, 2011 12:09 PM
To: Valkeinen, Tomi
Cc: Hiremath, Vaibhav; [email protected]; Taneja, Archit; linux- [email protected]; Molnar, Lajos
Subject: [PATCH v2 1/3] OMAPDSS/OMAP_VOUT: Fix incorrect OMAP3-alpha compatibility setting

[Hiremath, Vaibhav] Few minor comments below -

Quoted 7 lines

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???

Quoted 21 lines

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.

Quoted 8 lines

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 <[email protected]>

[Hiremath, Vaibhav] I think you can put his sign-off as well and remove this line or move it below ---

Quoted 21 lines
---
 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 +++++++++++++++++++--------
(quoted diff) +0 -1
-
 include/video/omapdss.h                |    3 ++-
 7 files changed, 59 insertions(+), 41 deletions(-)
drivers/media/video/omap/omap_vout.c +0 -0
index b3a5ecd..95daf98 100644
@@ -1165,12 +1165,17 @@ static int vidioc_try_fmt_vid_overlay(struct file
 *file, void *fh,

drivers/media/video/omap/omap_vout.c static int vidioc_try_fmt_vid_overlay(struct file · line 1175

Quoted 10 lines
drivers/media/video/omap/omap_vout.c +5 -0
 {
      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 */

Quoted 237 lines
drivers/media/video/omap/omap_vout.c +1 -1
      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;
drivers/media/video/omap/omap_vout.c +1 -2
@@ -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;
drivers/media/video/omap/omap_vout.c +4 -2
@@ -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;
      }
 
drivers/video/omap2/dss/dispc.c +10 -11
index 5e6849e..e0639d3 100644
@@ -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;
drivers/video/omap2/dss/dispc.c +2 -1
@@ -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);
drivers/video/omap2/dss/dss.h +2 -2
index 47eebd8..a37aef2 100644
@@ -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,

drivers/video/omap2/dss/dss_features.c +4 -3
index 47e66d8..70d5b9e 100644
@@ -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[] = {

drivers/video/omap2/dss/dss_features.c +2 -2
@@ -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,
drivers/video/omap2/dss/dss_features.c +2 -2
@@ -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,
drivers/video/omap2/dss/dss_features.c +2 -2
@@ -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,
drivers/video/omap2/dss/dss_features.c +1 -2
@@ -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,
drivers/video/omap2/dss/dss_features.h +0 -0
index cd60644..e81271a 100644

drivers/video/omap2/dss/dss_features.h line 34

Quoted 4 lines
drivers/video/omap2/dss/dss_features.h +0 -1
@@ -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

Quoted 107 lines
drivers/video/omap2/dss/dss_features.h +2 -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 */
drivers/video/omap2/dss/manager.c +4 -1
index fdbbeeb..6e63845 100644
@@ -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(

drivers/video/omap2/dss/manager.c +4 -2
@@ -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);
drivers/video/omap2/dss/manager.c +0 -1
@@ -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

drivers/video/omap2/dss/manager.c +11 -5
-      * 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;
 }
include/video/omapdss.h +2 -2
index c62b9a4..5f0ce5e 100644
@@ -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

#5 lore raw

RE: [PATCH v2 2/3] OMAPDSS: DISPC: VIDEO3 pipeline support

In reply to Archit Taneja
Quoted 480 lines

-----Original Message-----
From: Taneja, Archit
Sent: Friday, September 16, 2011 12:09 PM
To: Valkeinen, Tomi
Cc: Hiremath, Vaibhav; [email protected]; 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

---
 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(-)
drivers/video/omap2/dss/dispc.c +1 -1
index e0639d3..fa7aadf 100644
@@ -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);
drivers/video/omap2/dss/dispc.c +1 -0
@@ -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:

drivers/video/omap2/dss/dispc.c +1 -1
@@ -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];
drivers/video/omap2/dss/dispc.c +1 -1
@@ -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];
drivers/video/omap2/dss/dispc.c +8 -0
@@ -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[] = {
drivers/video/omap2/dss/dispc.c +2 -0
@@ -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 */
drivers/video/omap2/dss/dispc.h +2 -0
index 6c9ee0a..c06efc3 100644
@@ -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();
      }
drivers/video/omap2/dss/dispc.h +2 -0
@@ -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();
      }
drivers/video/omap2/dss/dispc.h +2 -0
@@ -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();
      }
drivers/video/omap2/dss/dispc.h +2 -0
@@ -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();
      }
drivers/video/omap2/dss/dispc.h +2 -0
@@ -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();
      }
drivers/video/omap2/dss/dispc.h +2 -0
@@ -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();
      }
drivers/video/omap2/dss/dispc.h +2 -0
@@ -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();
      }
drivers/video/omap2/dss/dispc.h +2 -0
@@ -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();
      }
drivers/video/omap2/dss/dispc.h +2 -0
@@ -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();
      }
drivers/video/omap2/dss/dispc.h +2 -0
@@ -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();
      }
drivers/video/omap2/dss/dispc.h +2 -0
@@ -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();
      }
drivers/video/omap2/dss/dispc.h +2 -0
@@ -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();
      }
drivers/video/omap2/dss/dispc.h +2 -0
@@ -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();
      }
drivers/video/omap2/dss/dispc.h +1 -0
@@ -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();
drivers/video/omap2/dss/dispc.h +1 -0
@@ -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();
drivers/video/omap2/dss/dispc.h +2 -0
@@ -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();
      }
drivers/video/omap2/dss/dispc.h +2 -0
@@ -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();
      }
drivers/video/omap2/dss/dispc.h +2 -0
@@ -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();
      }
drivers/video/omap2/dss/dispc.h +2 -0
@@ -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();
      }
drivers/video/omap2/dss/dispc.h +2 -0
@@ -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();
      }
drivers/video/omap2/dss/dispc.h +2 -0
@@ -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();
      }
drivers/video/omap2/dss/dispc.h +2 -0
@@ -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();
      }
drivers/video/omap2/dss/dispc.h +2 -0
@@ -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();
      }
drivers/video/omap2/dss/dispc.h +2 -0
@@ -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();
      }
drivers/video/omap2/dss/dispc.h +2 -0
@@ -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();
      }
drivers/video/omap2/dss/dispc.h +2 -0
@@ -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();
      }
drivers/video/omap2/dss/dispc.h +1 -0
@@ -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();
drivers/video/omap2/dss/dispc.h +2 -0
@@ -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();
      }
drivers/video/omap2/dss/dispc.h +2 -0
@@ -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();
      }
drivers/video/omap2/dss/dispc.h +2 -0
@@ -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();
      }
drivers/video/omap2/dss/dss_features.c +10 -0
index 70d5b9e..e5e94f4 100644
@@ -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[] = {

drivers/video/omap2/dss/dss_features.c +4 -0
@@ -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[] = {

drivers/video/omap2/dss/dss_features.c +1 -1
@@ -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,

drivers/video/omap2/dss/dss_features.c +1 -1
@@ -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,

drivers/video/omap2/dss/dss_features.h +0 -0
index e81271a..6a6c05d 100644

drivers/video/omap2/dss/dss_features.h line 28

Quoted 5 lines
drivers/video/omap2/dss/dss_features.h +1 -1
@@ -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

Quoted 45 lines
drivers/video/omap2/dss/dss_features.h +0 -0
 #define MAX_DSS_LCD_MANAGERS 2
 #define MAX_NUM_DSI          2
 
drivers/video/omap2/dss/overlay.c +5 -0
index afb7583..11d21e3 100644
@@ -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;
include/video/omapdss.h +4 -2
index 5f0ce5e..1f12559 100644
@@ -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

#3 lore raw

Re: [PATCH v2 1/3] OMAPDSS/OMAP_VOUT: Fix incorrect OMAP3-alpha compatibility setting

In reply to Hiremath, Vaibhav

Hi,

Quoted 12 lines · Vaibhav
Quoted 10 lines

-----Original Message-----
From: Taneja, Archit
Sent: Friday, September 16, 2011 12:09 PM
To: Valkeinen, Tomi
Cc: Hiremath, Vaibhav; [email protected]; Taneja, Archit; linux- [email protected]; Molnar, Lajos
Subject: [PATCH v2 1/3] OMAPDSS/OMAP_VOUT: Fix incorrect OMAP3-alpha compatibility setting

[Hiremath, Vaibhav] Few minor comments below -

Quoted 8 lines
Quoted 7 lines

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.

Quoted 28 lines
Quoted 28 lines

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.

Quoted 3 lines
Quoted 2 lines

Initial patch was made by: Lajos Molnar<[email protected]>

[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.

Quoted 30 lines
Quoted 30 lines
---
  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 +++++++++++++++++++--------
(quoted diff) +0 -1
-
  include/video/omapdss.h                |    3 ++-
  7 files changed, 59 insertions(+), 41 deletions(-)
drivers/media/video/omap/omap_vout.c +2 -0
index b3a5ecd..95daf98 100644
@@ -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;
 
Quoted 8 lines

drivers/media/video/omap/omap_vout.c static int vidioc_try_fmt_vid_overlay(struct file *file, void *fh, · line 1174

Quoted 3 lines
drivers/media/video/omap/omap_vout.c +3 -0
+     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.

Quoted 239 lines
Quoted 239 lines
drivers/media/video/omap/omap_vout.c +1 -1
       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;
drivers/media/video/omap/omap_vout.c +1 -2
@@ -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;
drivers/media/video/omap/omap_vout.c +4 -2
@@ -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;
       }
 
drivers/video/omap2/dss/dispc.c +10 -11
index 5e6849e..e0639d3 100644
@@ -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;
drivers/video/omap2/dss/dispc.c +2 -1
@@ -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);
drivers/video/omap2/dss/dss.h +2 -2
index 47eebd8..a37aef2 100644
@@ -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,

drivers/video/omap2/dss/dss_features.c +4 -3
index 47e66d8..70d5b9e 100644
@@ -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[] = {
drivers/video/omap2/dss/dss_features.c +2 -2
@@ -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,
drivers/video/omap2/dss/dss_features.c +2 -2
@@ -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,
drivers/video/omap2/dss/dss_features.c +2 -2
@@ -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,
drivers/video/omap2/dss/dss_features.c +1 -2
@@ -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,
drivers/video/omap2/dss/dss_features.h +0 -0
index cd60644..e81271a 100644
@@ -31,7 +31,6 @@
 
Quoted 6 lines

drivers/video/omap2/dss/dss_features.h

Quoted 3 lines
drivers/video/omap2/dss/dss_features.h +0 -1
  /* 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

Quoted 113 lines

Thanks,
Vaibhav

Quoted 107 lines
drivers/video/omap2/dss/dss_features.h +2 -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 */
drivers/video/omap2/dss/manager.c +4 -1
index fdbbeeb..6e63845 100644
@@ -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(

drivers/video/omap2/dss/manager.c +4 -2
@@ -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);
drivers/video/omap2/dss/manager.c +0 -1
@@ -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

drivers/video/omap2/dss/manager.c +11 -5
-      * 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;
  }
include/video/omapdss.h +2 -2
index c62b9a4..5f0ce5e 100644
@@ -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

#6 lore raw

Re: [PATCH v2 2/3] OMAPDSS: DISPC: VIDEO3 pipeline support

In reply to Hiremath, Vaibhav

Hi,

Quoted 15 lines · Vaibhav
Quoted 15 lines

-----Original Message-----
From: Taneja, Archit
Sent: Friday, September 16, 2011 12:09 PM
To: Valkeinen, Tomi
Cc: Hiremath, Vaibhav; [email protected]; 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

<snip>

Quoted 8 lines
Quoted 8 lines
drivers/video/omap2/dss/dss_features.h +0 -0
index e81271a..6a6c05d 100644
@@ -25,7 +25,7 @@
  #endif
 
Quoted 4 lines

drivers/video/omap2/dss/dss_features.h line 28

Quoted 3 lines
drivers/video/omap2/dss/dss_features.h +1 -1
  #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.

Quoted 2 lines

Overall this patch looks ok to me, I will test it tomorrow and will update you.

Thanks,
Archit

Quoted 51 lines

Thanks,
Vaibhav

Quoted 45 lines
drivers/video/omap2/dss/dss_features.h +0 -0
  #define MAX_DSS_LCD_MANAGERS 2
  #define MAX_NUM_DSI          2
 
drivers/video/omap2/dss/overlay.c +5 -0
index afb7583..11d21e3 100644
@@ -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;
include/video/omapdss.h +4 -2
index 5f0ce5e..1f12559 100644
@@ -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