public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* Hello Tomi Valkeinen, I have some questions about dss2 driver.
@ 2009-03-11  4:57 InKi Dae
  2009-03-11  5:10 ` Shah, Hardik
  2009-03-11  7:47 ` Tomi Valkeinen
  0 siblings, 2 replies; 12+ messages in thread
From: InKi Dae @ 2009-03-11  4:57 UTC (permalink / raw)
  To: Tomi Valkeinen; +Cc: linux-omap

I am using your dss2 driver downloaded from your git server and tried
to rotate an image(RGB24U and YUV2 format) using OMAPFB_ROT_DMA
command.
but I can't see rotated image on screen. I added variables for
rotating like below. as the result, LCD Panel is stoped.

omapfb.rotate=2
omapfb.vrfb=n


and then I tried again using OMAPFB_ROT_VRFB command like below.

omapfb.rotate=2
omapfb.vrfb=y

In this case, I can see rotated image(only RGB24U format) on screen.
You asid "Rotation and mirroring currently only supports RGB565 and
RGB8888 modes. VRFB does not support mirroring" through
/Documentation/arm/OMAP/DSS file.

Doesn't your dss2 driver support DMA rotation?
I am trying to add rotation feature for YUV2 image using VRFB to your
dss2 driver.

for this, I think that it have to change rot and mirror become 0 if
rotation_type is OMAPFB_ROT_VRFB to be rot=ofbi->rotation and mirror =
ofbi->mirror (in omapfb-main.c file) and
add codes for calculating offset0, offset1, pixel increment and row
increment value for YUV2 format also pixel size becomes 4 in YUV2 case
(in dispc.c fild).
omap_vrfb_setup function must be modifed also (in vrfb.c file)?

Do you have any idea?
I need your help and advice.

Thank you.
- InKi-

^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: Hello Tomi Valkeinen, I have some questions about dss2 driver.
  2009-03-11  4:57 Hello Tomi Valkeinen, I have some questions about dss2 driver InKi Dae
@ 2009-03-11  5:10 ` Shah, Hardik
  2009-03-11  7:47 ` Tomi Valkeinen
  1 sibling, 0 replies; 12+ messages in thread
From: Shah, Hardik @ 2009-03-11  5:10 UTC (permalink / raw)
  To: InKi Dae, Tomi Valkeinen; +Cc: linux-omap@vger.kernel.org

[-- Attachment #1: Type: text/plain, Size: 2354 bytes --]

Hi Dae,
I am attaching one patch which adds the support of rotation on top of Tomi's DSS library.  But this patch is created against the patches posted by tomi long back.  You can have look at _dispc_calc_and_set_row_inc and _dispc_set_rotation_mirroring function for reference to add the YUV support.  I have tested it with YUV, UYVY, RGB16 and RGB24u pixel format.  Currently it supports pixel and row increment calculation only for rotation case.

Thanks and Regards,
Hardik Shah

> -----Original Message-----
> From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-
> owner@vger.kernel.org] On Behalf Of InKi Dae
> Sent: Wednesday, March 11, 2009 10:28 AM
> To: Tomi Valkeinen
> Cc: linux-omap@vger.kernel.org
> Subject: Hello Tomi Valkeinen, I have some questions about dss2 driver.
> 
> I am using your dss2 driver downloaded from your git server and tried
> to rotate an image(RGB24U and YUV2 format) using OMAPFB_ROT_DMA
> command.
> but I can't see rotated image on screen. I added variables for
> rotating like below. as the result, LCD Panel is stoped.
> 
> omapfb.rotate=2
> omapfb.vrfb=n
> 
> 
> and then I tried again using OMAPFB_ROT_VRFB command like below.
> 
> omapfb.rotate=2
> omapfb.vrfb=y
> 
> In this case, I can see rotated image(only RGB24U format) on screen.
> You asid "Rotation and mirroring currently only supports RGB565 and
> RGB8888 modes. VRFB does not support mirroring" through
> /Documentation/arm/OMAP/DSS file.
> 
> Doesn't your dss2 driver support DMA rotation?
> I am trying to add rotation feature for YUV2 image using VRFB to your
> dss2 driver.
> 
> for this, I think that it have to change rot and mirror become 0 if
> rotation_type is OMAPFB_ROT_VRFB to be rot=ofbi->rotation and mirror =
> ofbi->mirror (in omapfb-main.c file) and
> add codes for calculating offset0, offset1, pixel increment and row
> increment value for YUV2 format also pixel size becomes 4 in YUV2 case
> (in dispc.c fild).
> omap_vrfb_setup function must be modifed also (in vrfb.c file)?
> 
> Do you have any idea?
> I need your help and advice.
> 
> Thank you.
> - InKi-
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


[-- Attachment #2: 0002-Changes-Done-to-DSS-Library.patch --]
[-- Type: application/octet-stream, Size: 17561 bytes --]

From 26ef0074ac798b631f5d674d26306871da5a901f Mon Sep 17 00:00:00 2001
From: Hardik Shah <hardik.shah@ti.com>
Date: Mon, 12 Jan 2009 18:59:50 +0530
Subject: [PATCH 2/4] Changes Done to DSS Library


Signed-off-by: Hardik Shah <hardik.shah@ti.com>
---
 arch/arm/plat-omap/dss/dispc.c            |  207 ++++++++++++++++++++++-------
 arch/arm/plat-omap/dss/display.c          |   19 ++-
 arch/arm/plat-omap/dss/dss.c              |    3 +
 arch/arm/plat-omap/dss/dss.h              |    6 +-
 arch/arm/plat-omap/include/mach/display.h |   11 +-
 5 files changed, 182 insertions(+), 64 deletions(-)

diff --git a/arch/arm/plat-omap/dss/dispc.c b/arch/arm/plat-omap/dss/dispc.c
index 20caa48..7711767 100644
--- a/arch/arm/plat-omap/dss/dispc.c
+++ b/arch/arm/plat-omap/dss/dispc.c
@@ -120,7 +120,6 @@ struct dispc_reg { u16 idx; };
 
 #define DISPC_VID_PRELOAD(n)		DISPC_REG(0x230 + (n)*0x04)
 
-
 #define DISPC_IRQ_MASK_ERROR            (DISPC_IRQ_GFX_FIFO_UNDERFLOW | \
 					 DISPC_IRQ_OCP_ERR | \
 					 DISPC_IRQ_VID1_FIFO_UNDERFLOW | \
@@ -521,7 +520,6 @@ static void _dispc_write_firhv_reg(enum omap_plane plane, int reg, u32 value)
 	dispc_write_reg(DISPC_VID_FIR_COEF_HV(plane-1, reg), value);
 }
 
-
 static void _dispc_set_scale_coef(enum omap_plane plane, int hscaleup,
 		int vscaleup)
 {
@@ -649,7 +647,6 @@ static void _dispc_setup_color_conv_coef(void)
 	REG_FLD_MOD(DISPC_VID_ATTRIBUTES(1), ct->full_range, 11, 11);
 }
 
-
 static void _dispc_set_plane_ba0(enum omap_plane plane, u32 paddr)
 {
 	const struct dispc_reg ba0_reg[] = { DISPC_GFX_BA0,
@@ -926,7 +923,6 @@ static void _dispc_set_vid_accu1(enum omap_plane plane, int haccu, int vaccu)
 	dispc_write_reg(ac1_reg[plane-1], val);
 }
 
-
 static void _dispc_set_scaling(enum omap_plane plane,
 			       int orig_width, int orig_height,
 			       int out_width, int out_height,
@@ -956,7 +952,6 @@ static void _dispc_set_scaling(enum omap_plane plane,
 		fir_vinc = 0;
 	else
 		fir_vinc = 1024 * orig_height / out_height;
-
 	_dispc_set_fir(plane, fir_hinc, fir_vinc);
 
 	l = dispc_read_reg(dispc_reg_att[plane]);
@@ -988,19 +983,127 @@ static void _dispc_set_scaling(enum omap_plane plane,
 	_dispc_set_vid_accu1(plane, 0, accu1);
 }
 
+static int _dispc_set_rotation_mirroring(enum omap_plane plane,
+	int rotation, int mirroring, enum omap_color_mode color_mode)
+{
+	u32 attr_value;
+	if (rotation == -1)
+		return 0;
+	if (color_mode == OMAP_DSS_COLOR_YUV2 ||
+		color_mode == OMAP_DSS_COLOR_UYVY) {
+		if (mirroring == 1) {
+
+			if (rotation == 90)
+				REG_FLD_MOD(dispc_reg_att[plane], 0x3, 13, 12);
+			else if (rotation == 270)
+				REG_FLD_MOD(dispc_reg_att[plane], 0x1, 13, 12);
+			else if (rotation == 0)
+				REG_FLD_MOD(dispc_reg_att[plane], 0x2, 13, 12);
+			else if (rotation == 180)
+				REG_FLD_MOD(dispc_reg_att[plane], 0x0, 13, 12);
+		} else {
+			if (rotation == 90)
+				REG_FLD_MOD(dispc_reg_att[plane], 0x3, 13, 12);
+			else if (rotation == 270)
+				REG_FLD_MOD(dispc_reg_att[plane], 0x01, 13, 12);
+			else if (rotation == 180)
+				REG_FLD_MOD(dispc_reg_att[plane], 0x2, 13, 12);
+			else if (rotation == 0)
+				REG_FLD_MOD(dispc_reg_att[plane], 0x0, 13, 12);
+			}
+		}
+		if (rotation == 90 || rotation == 270)
+			REG_FLD_MOD(dispc_reg_att[plane], 0x1, 18, 18);
+		else
+			REG_FLD_MOD(dispc_reg_att[plane], 0x0, 18, 18);
+	attr_value = dispc_read_reg(DISPC_VID_ATTRIBUTES(0));
+	return 0;
+}
+
+#define MAX_PIXELS_PER_LINE     2048
+#define MAX_LINES               2048
+
+static void _dispc_calc_and_set_row_inc(enum omap_plane plane,
+	int screen_width, int cropwidth,
+	int cleft, enum omap_color_mode color_mode, int rotation, int mirror,
+	int fieldmode)
+{
+	int ps = 2, vr_ps = 1;
+	int row_inc_value = 0, pixel_inc_value = 0;
+	int temp;
+
+	switch (color_mode) {
+	case OMAP_DSS_COLOR_YUV2:
+	case OMAP_DSS_COLOR_UYVY:
+		if (mirror == 1 || rotation >= 0) {
+			/*
+			 * ps      - In VRFB space the pixel size for YUYV/UYVY
+			 * is 4 bytes
+			 * vr_ps - Actual pixel size for YUYV/UYVY  is 2 bytes
+			 */
+			ps = 4;
+			vr_ps = 2;
+		}
+		break;
+	case OMAP_DSS_COLOR_RGB24P:
+		ps = 3;		/* pixel size is 3 bytes */
+		break;
+
+	case OMAP_DSS_COLOR_RGB24U:
+		ps = 4;		/* pixel size is 4 bytes */
+		break;
+
+	case OMAP_DSS_COLOR_RGB16:
+	default:
+		ps = 2;		/* pixel size is 2 bytes */
+		break;
+	}
+	if (rotation == 90 || rotation == 270) {
+		row_inc_value = 1 + (MAX_PIXELS_PER_LINE - screen_width +
+			 (screen_width - cropwidth - cleft) + cleft) * ps;
+
+	} else if (rotation == 180 || rotation == 0) {
+		if (color_mode == OMAP_DSS_COLOR_YUV2
+			|| color_mode == OMAP_DSS_COLOR_UYVY) {
+			temp = MAX_PIXELS_PER_LINE - (screen_width / vr_ps);
+			temp += (screen_width - cropwidth - cleft) / vr_ps;
+			row_inc_value = ((temp + (cleft/vr_ps)) * ps);
+			row_inc_value++;
+
+		} else
+			row_inc_value = 1 + (MAX_PIXELS_PER_LINE -
+				screen_width + (screen_width - cropwidth -
+				cleft) + cleft) * ps;
+	} else {
+		row_inc_value = 1 + (screen_width * ps) - cropwidth * ps;
+	}
+	pixel_inc_value = 1;
+
+	if (fieldmode) {
+		if (rotation >= 0)
+			row_inc_value = row_inc_value +
+				MAX_PIXELS_PER_LINE * ps;
+		else
+			row_inc_value = row_inc_value + screen_width * ps;
+	}
+	_dispc_set_row_inc(plane, row_inc_value);
+
+}
+
 static int _dispc_setup_plane(enum omap_plane plane,
 		enum omap_channel channel_out,
-		u32 paddr, int screen_width,
+		u32 paddr, int tv_field1_offset, int screen_width,
 		int pos_x, int pos_y,
 		int width, int height,
 		int out_width, int out_height,
 		enum omap_color_mode color_mode,
-		int ilace)
+		int ilace, int rotation, int mirror)
 {
 	int fieldmode = 0;
 	int bpp;
 	int cconv;
 	int scaling = 0;
+	u32 attr_value;
 
 	if (plane == OMAP_DSS_GFX) {
 		if (width != out_width || height != out_height)
@@ -1009,7 +1112,6 @@ static int _dispc_setup_plane(enum omap_plane plane,
 		/* video plane */
 		if (width != out_width || height != out_height)
 			scaling = 1;
-
 		if (out_width < width/2 ||
 		   out_width > width*8)
 			return -EINVAL;
@@ -1019,7 +1121,6 @@ static int _dispc_setup_plane(enum omap_plane plane,
 			return -EINVAL;
 	}
 
-
 	switch (color_mode) {
 	case OMAP_DSS_COLOR_RGB16:
 		bpp = 16;
@@ -1066,6 +1167,13 @@ static int _dispc_setup_plane(enum omap_plane plane,
 
 	/* attributes */
 	_dispc_set_channel_out(plane, channel_out);
+
+	if (rotation >= 0) {
+		/* Set rotation and mirroring attributes */
+		_dispc_set_rotation_mirroring(plane, rotation,
+				mirror, color_mode);
+	}
+
 	_dispc_set_color_mode(plane, color_mode);
 	if (plane != OMAP_DSS_GFX)
 		_dispc_set_vid_color_conv(plane, cconv);
@@ -1075,11 +1183,11 @@ static int _dispc_setup_plane(enum omap_plane plane,
 	_dispc_set_plane_ba0(plane, paddr);
 
 	if (fieldmode)
-		_dispc_set_plane_ba1(plane, paddr + screen_width * bpp/8);
+		_dispc_set_plane_ba1(plane, paddr + tv_field1_offset);
+
 	else
 		_dispc_set_plane_ba1(plane, paddr);
 
-
 	_dispc_set_plane_pos(plane, pos_x, pos_y);
 
 	_dispc_set_pic_size(plane, width, height);
@@ -1087,11 +1195,10 @@ static int _dispc_setup_plane(enum omap_plane plane,
 	if (plane != OMAP_DSS_GFX)
 		_dispc_set_vid_size(plane, out_width, out_height);
 
-	_dispc_set_row_inc(plane,
-			   (screen_width - width) * bpp / 8 +
-			   (fieldmode ? screen_width * bpp / 8 : 0) +
-			   1);
+	_dispc_calc_and_set_row_inc(plane, screen_width, width, 0,
+			color_mode, rotation, mirror, fieldmode);
 
+	attr_value = dispc_read_reg(DISPC_VID_ATTRIBUTES(0));
 	return 0;
 }
 
@@ -1100,7 +1207,6 @@ static void _dispc_enable_plane(enum omap_plane plane, int enable)
 	REG_FLD_MOD(dispc_reg_att[plane], enable ? 1 : 0, 0, 0);
 }
 
-
 void dispc_enable_lcd_out(int enable)
 {
 	enable_clocks(1);
@@ -1143,7 +1249,6 @@ void dispc_enable_fifohandcheck(int enable)
 	enable_clocks(0);
 }
 
-
 void dispc_set_lcd_display_type(enum omap_lcd_display_type type)
 {
 	int mode;
@@ -1174,7 +1279,6 @@ void dispc_set_loadmode(enum omap_dss_load_mode mode)
 	enable_clocks(0);
 }
 
-
 void omap_dispc_set_default_color(enum omap_channel channel, u32 color)
 {
 	const struct dispc_reg def_reg[] = { DISPC_DEFAULT_COLOR0,
@@ -1613,7 +1717,7 @@ int dispc_set_clock_div(struct dispc_clock_info *cinfo)
 	return 0;
 }
 
-int omap_dispc_register_isr(omap_dispc_isr_t isr, void *arg, u32 mask)
+void *omap_dispc_register_isr(omap_dispc_isr_t isr, void *arg, u32 mask)
 {
 	int i;
 	int ret = -EBUSY;
@@ -1621,16 +1725,11 @@ int omap_dispc_register_isr(omap_dispc_isr_t isr, void *arg, u32 mask)
 	u32 new_mask = 0;
 
 	if (isr == NULL)
-		return -EINVAL;
+		return NULL;
 
 	spin_lock_irqsave(&dispc.irq_lock, flags);
 
 	for (i = 0; i < DISPC_MAX_NR_ISRS; i++) {
-		if (registered_isr[i].isr == isr) {
-			ret = -EINVAL;
-			break;
-		}
-
 		if (registered_isr[i].isr != NULL)
 			continue;
 
@@ -1641,6 +1740,7 @@ int omap_dispc_register_isr(omap_dispc_isr_t isr, void *arg, u32 mask)
 		enable_clocks(1);
 		new_mask = dispc_read_reg(DISPC_IRQENABLE);
 		new_mask |= mask;
+		dispc_write_reg(DISPC_IRQSTATUS, mask);
 		dispc_write_reg(DISPC_IRQENABLE, new_mask);
 		enable_clocks(0);
 
@@ -1648,42 +1748,48 @@ int omap_dispc_register_isr(omap_dispc_isr_t isr, void *arg, u32 mask)
 		break;
 	}
 
-	spin_unlock_irqrestore(&dispc.irq_lock, flags);
+	if (!ret)
+		return (void *)&registered_isr[i];
+	else
+		return (void *)NULL;
 
-	return ret;
+	spin_unlock_irqrestore(&dispc.irq_lock, flags);
 }
 EXPORT_SYMBOL(omap_dispc_register_isr);
 
-int omap_dispc_unregister_isr(omap_dispc_isr_t isr)
+int omap_dispc_unregister_isr(void *handle)
 {
 	int i, j;
 	unsigned long flags;
 	u32 new_mask = DISPC_IRQ_MASK_ERROR;
 	int ret = -EINVAL;
+	struct registered_isr *isr;
 
 	spin_lock_irqsave(&dispc.irq_lock, flags);
 
-	for (i = 0; i < DISPC_MAX_NR_ISRS; i++) {
-		if (registered_isr[i].isr != isr)
-			continue;
+	isr = (struct registered_isr *)handle;
 
-		registered_isr[i].isr = NULL;
-		registered_isr[i].arg = NULL;
-		registered_isr[i].mask = 0;
+	if (isr == NULL)
+		return -EINVAL;
 
-		for (j = 0; j < DISPC_MAX_NR_ISRS; j++)
-			new_mask |= registered_isr[j].mask;
+	for (i = 0; i < DISPC_MAX_NR_ISRS; i++) {
+		if (isr == (struct registered_isr *)&(registered_isr[i].isr)) {
 
-		enable_clocks(1);
-		dispc_write_reg(DISPC_IRQENABLE, new_mask);
-		enable_clocks(0);
+			registered_isr[i].isr = NULL;
+			registered_isr[i].arg = NULL;
+			registered_isr[i].mask = 0;
 
-		ret = 0;
-		break;
-	}
+			for (j = 0; j < DISPC_MAX_NR_ISRS; j++)
+				new_mask |= registered_isr[j].mask;
 
+			enable_clocks(1);
+			dispc_write_reg(DISPC_IRQENABLE, new_mask);
+			enable_clocks(0);
+			ret = 0;
+			break;
+		}
+	}
 	spin_unlock_irqrestore(&dispc.irq_lock, flags);
-
 	return ret;
 }
 EXPORT_SYMBOL(omap_dispc_unregister_isr);
@@ -1736,6 +1842,7 @@ void dispc_irq_handler(void)
 		if (registered_isr[i].mask & irqstatus) {
 			registered_isr[i].isr(registered_isr[i].arg,
 					      irqstatus);
+
 			handledirqs |= registered_isr[i].mask;
 		}
 	}
@@ -1865,12 +1972,12 @@ int dispc_enable_plane(enum omap_plane plane, int enable)
 }
 
 int dispc_setup_plane(enum omap_plane plane, enum omap_channel channel_out,
-		       u32 paddr, int screen_width,
+		       u32 paddr, int tv_field1_offset, int screen_width,
 		       int pos_x, int pos_y,
 		       int width, int height,
 		       int out_width, int out_height,
 		       enum omap_color_mode color_mode,
-		       int ilace)
+		       int ilace, int rotation, int mirror)
 {
 	int r = 0;
 
@@ -1880,15 +1987,14 @@ int dispc_setup_plane(enum omap_plane plane, enum omap_channel channel_out,
 	       width, height,
 	       out_width, out_height,
 	       ilace);
-
 	enable_clocks(1);
 
 	r = _dispc_setup_plane(plane, channel_out,
-			   paddr, screen_width,
+			   paddr, tv_field1_offset, screen_width,
 			   pos_x, pos_y,
 			   width, height,
 			   out_width, out_height,
-			   color_mode, ilace);
+			   color_mode, ilace, rotation, mirror);
 
 	enable_clocks(0);
 
@@ -1941,7 +2047,6 @@ void dispc_setup_partial_planes(struct omap_display *display,
 	DSSDBG("dispc_setup_partial_planes %d,%d %dx%d\n",
 		*xi, *yi, *wi, *hi);
 
-
 	mgr = display->manager;
 
 	if (!mgr) {
@@ -2095,11 +2200,11 @@ void dispc_setup_partial_planes(struct omap_display *display,
 				ovl->id, pa, psw, px, py, pw, ph, pow, poh);
 
 		dispc_setup_plane(ovl->id, mgr->id,
-				pa, psw,
+				pa, pi->tv_field1_offset, psw,
 				px, py,
 				pw, ph,
 				pow, poh,
-				pi->color_mode, 0);
+				pi->color_mode, 0, 0, 0);
 
 		dispc_enable_plane(ovl->id, 1);
 	}
diff --git a/arch/arm/plat-omap/dss/display.c b/arch/arm/plat-omap/dss/display.c
index e3ff778..c312cb2 100644
--- a/arch/arm/plat-omap/dss/display.c
+++ b/arch/arm/plat-omap/dss/display.c
@@ -245,9 +245,9 @@ static int omap_dss_unset_display(struct omap_overlay_manager *mgr)
 }
 
 static int omap_dss_setup_overlay_input(struct omap_overlay *ovl,
-		u32 paddr, void *vaddr, int screen_width,
+		u32 paddr, void *vaddr, int tv_field1_offset, int screen_width,
 		int width, int height,
-		enum omap_color_mode color_mode)
+		enum omap_color_mode color_mode, int rotation, int mirror)
 {
 	int r;
 	struct omap_overlay_info old_info;
@@ -262,7 +262,9 @@ static int omap_dss_setup_overlay_input(struct omap_overlay *ovl,
 	ovl->info.paddr = paddr;
 	ovl->info.vaddr = vaddr;
 	ovl->info.screen_width = screen_width;
-
+	ovl->info.rotation = rotation;
+	ovl->info.mirror = mirror;
+	ovl->info.tv_field1_offset = tv_field1_offset;
 	ovl->info.width = width;
 	ovl->info.height = height;
 	ovl->info.color_mode = color_mode;
@@ -381,6 +383,7 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
 
 		r = dispc_setup_plane(ovl->id, ovl->manager->id,
 				ovl->info.paddr,
+				ovl->info.tv_field1_offset,
 				ovl->info.screen_width,
 				ovl->info.pos_x,
 				ovl->info.pos_y,
@@ -389,13 +392,14 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
 				outw,
 				outh,
 				ovl->info.color_mode,
-				ilace);
+				ilace,
+				ovl->info.rotation,
+				ovl->info.mirror);
 
 		if (r) {
 			DSSERR("dispc_setup_plane failed\n");
 			goto exit;
 		}
-
 		dispc_enable_plane(ovl->id, 1);
 	}
 
@@ -599,7 +603,10 @@ void initialize_overlays(const char *def_disp_name)
 		for (i = 0; i < 3; i++) {
 			struct omap_overlay *ovl;
 			ovl = omap_dss_get_overlay(i);
-			omap_dss_set_manager(ovl, def_mgr);
+			if (i == 1)
+				omap_dss_set_manager(ovl, lcd_mgr);
+			else
+				omap_dss_set_manager(ovl, tv_mgr);
 		}
 	}
 
diff --git a/arch/arm/plat-omap/dss/dss.c b/arch/arm/plat-omap/dss/dss.c
index b9f35d8..bf4175f 100644
--- a/arch/arm/plat-omap/dss/dss.c
+++ b/arch/arm/plat-omap/dss/dss.c
@@ -480,6 +480,9 @@ static irqreturn_t dss_irq_handler_omap3(int irq, void *arg)
 		dsi_irq_handler();
 #endif
 
+	/* Workaround suggested by Tony  for spurious interrupt warning */
+	irqstatus = dss_read_reg(DSS_IRQSTATUS);
+
 	return IRQ_HANDLED;
 }
 
diff --git a/arch/arm/plat-omap/dss/dss.h b/arch/arm/plat-omap/dss/dss.h
index da628a7..c77412b 100644
--- a/arch/arm/plat-omap/dss/dss.h
+++ b/arch/arm/plat-omap/dss/dss.h
@@ -161,7 +161,6 @@ int sdi_init(void);
 void sdi_exit(void);
 void sdi_init_display(struct omap_display *display);
 
-
 /* DSI */
 int dsi_init(void);
 void dsi_exit(void);
@@ -213,12 +212,12 @@ void dispc_set_plane_size(enum omap_plane plane, int width, int height);
 void dispc_set_row_inc(enum omap_plane plane, int inc);
 
 int dispc_setup_plane(enum omap_plane plane, enum omap_channel channel_out,
-		      u32 paddr, int screen_width,
+		      u32 paddr, int tv_field1_offset, int screen_width,
 		      int pos_x, int pos_y,
 		      int width, int height,
 		      int out_width, int out_height,
 		      enum omap_color_mode color_mode,
-		      int ilace);
+		      int ilace, int rotation, int mirror);
 
 void dispc_go(enum omap_channel channel);
 void dispc_enable_lcd_out(int enable);
@@ -251,7 +250,6 @@ void dispc_setup_partial_planes(struct omap_display *display,
 				int *x, int *y, int *w, int *h);
 void dispc_draw_partial_planes(struct omap_display *display);
 
-
 ssize_t dispc_print_clocks(char *buf, ssize_t size);
 
 /* VENC */
diff --git a/arch/arm/plat-omap/include/mach/display.h b/arch/arm/plat-omap/include/mach/display.h
index 49ab00a..1a8fee7 100644
--- a/arch/arm/plat-omap/include/mach/display.h
+++ b/arch/arm/plat-omap/include/mach/display.h
@@ -320,6 +320,7 @@ struct omap_overlay_info {
 	int enabled;
 	u32 paddr;
 	void *vaddr;
+	int tv_field1_offset;
 	int screen_width;
 	int pos_x;
 	int pos_y;
@@ -327,6 +328,8 @@ struct omap_overlay_info {
 	int height;
 	int out_width;	/* if 0, out_width == width */
 	int out_height;	/* if 0, out_height == height */
+	int rotation;
+	int mirror;
 	enum omap_color_mode color_mode;
 };
 
@@ -349,9 +352,11 @@ struct omap_overlay {
 
 	int (*setup_input)(struct omap_overlay *ovl,
 			u32 paddr, void *vaddr,
+			int tv_field1_offset,
 			int screen_width,
 			int width, int height,
-			enum omap_color_mode color_mode);
+			enum omap_color_mode color_mode, int rotation,
+			int mirror);
 	int (*setup_output)(struct omap_overlay *ovl,
 			int pos_x, int pos_y,
 			int out_width, int out_height);
@@ -456,7 +461,7 @@ int omap_dss_get_num_overlays(void);
 struct omap_overlay *omap_dss_get_overlay(int num);
 
 typedef void (*omap_dispc_isr_t) (void *arg, u32 mask);
-int omap_dispc_register_isr(omap_dispc_isr_t isr, void *arg, u32 mask);
-int omap_dispc_unregister_isr(omap_dispc_isr_t isr);
+void *omap_dispc_register_isr(omap_dispc_isr_t isr, void *arg, u32 mask);
+int omap_dispc_unregister_isr(void *handle);
 
 #endif
-- 
1.5.6


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: Hello Tomi Valkeinen, I have some questions about dss2 driver.
  2009-03-11  4:57 Hello Tomi Valkeinen, I have some questions about dss2 driver InKi Dae
  2009-03-11  5:10 ` Shah, Hardik
@ 2009-03-11  7:47 ` Tomi Valkeinen
  2009-04-07  4:30   ` YUV rotation support for DSS2 - 2.6.29 [WAS Re: Hello Tomi Valkeinen, I have some questions about dss2 driver.] Gregoire Gentil
  1 sibling, 1 reply; 12+ messages in thread
From: Tomi Valkeinen @ 2009-03-11  7:47 UTC (permalink / raw)
  To: ext InKi Dae; +Cc: linux-omap@vger.kernel.org

Hi,

On Wed, 2009-03-11 at 05:57 +0100, ext InKi Dae wrote:
> I am using your dss2 driver downloaded from your git server and tried
> to rotate an image(RGB24U and YUV2 format) using OMAPFB_ROT_DMA
> command.
> but I can't see rotated image on screen. I added variables for
> rotating like below. as the result, LCD Panel is stoped.
> 
> omapfb.rotate=2
> omapfb.vrfb=n
> 
> 
> and then I tried again using OMAPFB_ROT_VRFB command like below.
> 
> omapfb.rotate=2
> omapfb.vrfb=y
> 
> In this case, I can see rotated image(only RGB24U format) on screen.
> You asid "Rotation and mirroring currently only supports RGB565 and
> RGB8888 modes. VRFB does not support mirroring" through
> /Documentation/arm/OMAP/DSS file.
> 
> Doesn't your dss2 driver support DMA rotation?

It does. However, you should use DMA rotation only with OMAP2 when the
framebuffer is in SRAM. It seems to work somewhat on OMAP3 and SDRAM,
but I've noticed it doesn't always work. I don't know if lowering pixel
clock, increasing dss fck or fiddling with fifo sizes could affect it.

> I am trying to add rotation feature for YUV2 image using VRFB to your
> dss2 driver.
> 
> for this, I think that it have to change rot and mirror become 0 if
> rotation_type is OMAPFB_ROT_VRFB to be rot=ofbi->rotation and mirror =
> ofbi->mirror (in omapfb-main.c file) and
> add codes for calculating offset0, offset1, pixel increment and row
> increment value for YUV2 format also pixel size becomes 4 in YUV2 case
> (in dispc.c fild).
> omap_vrfb_setup function must be modifed also (in vrfb.c file)?
> 
> Do you have any idea?

No, I haven't really looked at YUV rotations.

 Tomi

> I need your help and advice.
> 
> Thank you.
> - InKi-


^ permalink raw reply	[flat|nested] 12+ messages in thread

* YUV rotation support for DSS2 - 2.6.29 [WAS Re: Hello Tomi Valkeinen, I have some questions about dss2 driver.]
  2009-03-11  7:47 ` Tomi Valkeinen
@ 2009-04-07  4:30   ` Gregoire Gentil
  2009-04-07  4:41     ` Shah, Hardik
  0 siblings, 1 reply; 12+ messages in thread
From: Gregoire Gentil @ 2009-04-07  4:30 UTC (permalink / raw)
  To: tomi.valkeinen; +Cc: linux-omap@vger.kernel.org, beagleboard, plasm

[-- Attachment #1: Type: text/plain, Size: 1198 bytes --]

Tomi,

Tim has patched your latest DSS2 2.6.29 git (master branch) to add
support for YUV rotation. It has been successfully tested on the coming
Touch Book, as well as the Beagleboard Rev B6 with the exception of the
bug mentioned below. You may want to review this patch and perhaps
integrate once we have fixed the problem below.

A couple of questions and comments:

1. dss.c has no way of knowing whether VRFB is being used or not --
this is a problem because you need to decide whether to call
calc_rotation_offset_vrfb(...) or calc_rotation_offset(...). Any
suggestions on how the rotation mode should be passed between dss.c and
omapfb-main.c?

2. If I try to rotate both plane 0 and plane 1 to either 90 degrees or
270 (doesn't matter which is which), as soon as you try to play a video
you get VID1_FIFO_UNDERFLOW error messages, so it seems that the
hardware seems to be struggling a little when you have two sets of
90/270 degree rotations. If one of the planes is 0/180 and the other
is 90/270, then everything is fine. Would changing the FIFO settings
somehow improve this or do you have any ideas about what else might make
it work better?


Thanks in advance,

Grégoire Gentil


[-- Attachment #2: vrfb-yuv-rotation.patch --]
[-- Type: text/x-patch, Size: 6057 bytes --]

diff --git a/arch/arm/plat-omap/vrfb.c b/arch/arm/plat-omap/vrfb.c
index 7e0f8fc..77aa9a7 100644
--- a/arch/arm/plat-omap/vrfb.c
+++ b/arch/arm/plat-omap/vrfb.c
@@ -61,8 +61,10 @@ void omap_vrfb_setup(struct vrfb *vrfb, unsigned long paddr,
 			width, height, bytespp);
 
 	if (bytespp == 4)
+	{
 		pixel_size_exp = 2;
-	else if (bytespp == 2)
+		width >>= 1;
+	} else if (bytespp == 2)
 		pixel_size_exp = 1;
 	else
 		BUG();
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 2480a03..1f022ce 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -1089,7 +1089,8 @@ static void _dispc_set_scaling(enum omap_plane plane,
 }
 
 static void _dispc_set_rotation_attrs(enum omap_plane plane, u8 rotation,
-		bool mirroring, enum omap_color_mode color_mode)
+		bool mirroring, enum omap_color_mode color_mode, u16 width,
+		u16 height)
 {
 	if (color_mode == OMAP_DSS_COLOR_YUV2 ||
 			color_mode == OMAP_DSS_COLOR_UYVY) {
@@ -1107,7 +1108,7 @@ static void _dispc_set_rotation_attrs(enum omap_plane plane, u8 rotation,
 			case 0: vidrot = 0; break;
 			case 1: vidrot = 1; break;
 			case 2: vidrot = 2; break;
-			case 3: vidrot = 1; break;
+			case 3: vidrot = 3; break;
 			}
 		}
 
@@ -1121,6 +1122,13 @@ static void _dispc_set_rotation_attrs(enum omap_plane plane, u8 rotation,
 		REG_FLD_MOD(dispc_reg_att[plane], 0, 13, 12);
 		REG_FLD_MOD(dispc_reg_att[plane], 0, 18, 18);
 	}
+
+	/* Turn on DMA optimization. For this to work, both height
+	   and width need to be even... */
+	if(width % 2 == 0 && height % 2 == 0 && (rotation == 1 || rotation == 3))
+		REG_FLD_MOD(dispc_reg_att[plane], 1, 20, 20);
+	else
+		REG_FLD_MOD(dispc_reg_att[plane], 0, 20, 20);
 }
 
 static s32 pixinc(int pixels, u8 ps)
@@ -1283,6 +1291,76 @@ static void calc_rotation_offset(u8 rotation, bool mirror,
 	}
 }
 
+static void calc_rotation_offset_vrfb(u8 rotation, bool mirror,
+		u16 screen_width,
+		u16 width, u16 height,
+		enum omap_color_mode color_mode, bool fieldmode,
+		unsigned *offset0, unsigned *offset1,
+		s32 *row_inc, s32 *pix_inc)
+{
+	u8 ps;
+	u16 fbw, fbh;
+
+	DSSDBG("calc_rot(%d): scrw %d, %dx%d, cm %d\n", rotation, screen_width,
+			width, height, color_mode);
+
+	/* width & height are overlay sizes, convert to fb sizes */
+	if (rotation == 0 || rotation == 2) {
+		fbw = width;
+		fbh = height;
+	} else {
+		fbw = height;
+		fbh = width;
+	}
+
+	switch (color_mode) {
+	case OMAP_DSS_COLOR_RGB16:
+	case OMAP_DSS_COLOR_ARGB16:
+		ps = 2;
+		break;
+
+	case OMAP_DSS_COLOR_RGB24P:
+		ps = 3;
+		break;
+
+	case OMAP_DSS_COLOR_RGB24U:
+	case OMAP_DSS_COLOR_ARGB32:
+	case OMAP_DSS_COLOR_RGBA32:
+	case OMAP_DSS_COLOR_RGBX32:
+		ps = 4;
+		break;
+
+	case OMAP_DSS_COLOR_YUV2:
+	case OMAP_DSS_COLOR_UYVY:
+		ps = 4;
+		fbw >>= 1;
+		break;
+	default:
+		BUG();
+		return;
+	}
+
+	*pix_inc = 1;
+	switch(rotation + mirror * 4) {
+		case 0:
+		case 1:
+		case 2:
+		case 3:
+			*offset0 = *offset1 = 0;
+			break;
+		default:
+			BUG();
+	}
+
+        if(!mirror) {
+		if(rotation == 0 || rotation == 2)
+			*row_inc = 1 + (screen_width - fbw) * ps;
+		else
+			*row_inc = 1 + (screen_width - fbh) * ps;
+	} else
+		BUG();
+}
+
 static int _dispc_setup_plane(enum omap_plane plane,
 		enum omap_channel channel_out,
 		u32 paddr, u16 screen_width,
@@ -1361,7 +1439,7 @@ static int _dispc_setup_plane(enum omap_plane plane,
 	if (ilace && height >= out_height)
 		fieldmode = 1;
 
-	calc_rotation_offset(rotation, mirror,
+	calc_rotation_offset_vrfb(rotation, mirror,
 			screen_width, width, height, color_mode,
 			fieldmode,
 			&offset0, &offset1, &row_inc, &pix_inc);
@@ -1393,18 +1471,25 @@ static int _dispc_setup_plane(enum omap_plane plane,
 			out_width, out_height);
 
 	_dispc_set_plane_pos(plane, pos_x, pos_y);
-
 	_dispc_set_pic_size(plane, width, height);
 
 	if (plane != OMAP_DSS_GFX) {
-		_dispc_set_scaling(plane, width, height,
-				   out_width, out_height,
-				   ilace);
-		_dispc_set_vid_size(plane, out_width, out_height);
+		if(rotation == 0 || rotation == 2)
+		{
+			_dispc_set_scaling(plane, width, height,
+					   out_width, out_height,
+					   ilace);
+			_dispc_set_vid_size(plane, out_width, out_height);
+		} else {
+			_dispc_set_scaling(plane, width, height,
+					   out_height, out_width,
+					   ilace);
+			_dispc_set_vid_size(plane, out_height, out_width);
+		}
 		_dispc_set_vid_color_conv(plane, cconv);
 	}
 
-	_dispc_set_rotation_attrs(plane, rotation, mirror, color_mode);
+	_dispc_set_rotation_attrs(plane, rotation, mirror, color_mode, width, height);
 
 	return 0;
 }
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
index afe40a9..02d308a 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -420,10 +420,14 @@ void set_fb_fix(struct fb_info *fbi)
 	fix->ypanstep = 1;
 
 	if (rg->size) {
-		if (ofbi->rotation_type == OMAPFB_ROT_VRFB)
+		if (ofbi->rotation_type == OMAPFB_ROT_VRFB && ofbi->id == 0)
 			omap_vrfb_setup(&rg->vrfb, rg->paddr,
 					var->xres_virtual, var->yres_virtual,
 					var->bits_per_pixel >> 3);
+		else if (ofbi->rotation_type == OMAPFB_ROT_VRFB && ofbi->id != 0)
+			omap_vrfb_setup(&rg->vrfb, rg->paddr,
+					var->xres_virtual, var->yres_virtual,
+					var->bits_per_pixel >> 2);
 	}
 }
 
@@ -487,6 +491,8 @@ int check_fb_var(struct fb_info *fbi, struct fb_var_screeninfo *var)
 	yres_max = 2048;
 
 	bytespp = var->bits_per_pixel >> 3;
+	if(mode == OMAP_DSS_COLOR_YUV2 || mode == OMAP_DSS_COLOR_UYVY)
+		bytespp <<= 1;
 
 	/* XXX: some applications seem to set virtual res to 0. */
 	if (var->xres_virtual == 0)
@@ -696,13 +702,8 @@ static int omapfb_setup_overlay(struct fb_info *fbi, struct omap_overlay *ovl,
 
 	ovl->get_overlay_info(ovl, &info);
 
-	if (ofbi->rotation_type == OMAPFB_ROT_VRFB) {
-		rot = 0;
-		mirror = 0;
-	} else {
-		rot = ofbi->rotation;
-		mirror = ofbi->mirror;
-	}
+	rot = ofbi->rotation;
+	mirror = ofbi->mirror;
 
 	info.paddr = data_start_p;
 	info.vaddr = data_start_v;

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* RE: YUV rotation support for DSS2 - 2.6.29 [WAS Re: Hello Tomi Valkeinen, I have some questions about dss2 driver.]
  2009-04-07  4:30   ` YUV rotation support for DSS2 - 2.6.29 [WAS Re: Hello Tomi Valkeinen, I have some questions about dss2 driver.] Gregoire Gentil
@ 2009-04-07  4:41     ` Shah, Hardik
  2009-04-07 19:00       ` Tim Yamin
  0 siblings, 1 reply; 12+ messages in thread
From: Shah, Hardik @ 2009-04-07  4:41 UTC (permalink / raw)
  To: gregoire@gentil.com, tomi.valkeinen@nokia.com
  Cc: linux-omap@vger.kernel.org, beagleboard@googlegroups.com,
	plasm@roo.me.uk

[-- Attachment #1: Type: text/plain, Size: 2495 bytes --]



> -----Original Message-----
> From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-
> owner@vger.kernel.org] On Behalf Of Gregoire Gentil
> Sent: Tuesday, April 07, 2009 10:00 AM
> To: tomi.valkeinen@nokia.com
> Cc: linux-omap@vger.kernel.org; beagleboard@googlegroups.com; plasm@roo.me.uk
> Subject: YUV rotation support for DSS2 - 2.6.29 [WAS Re: Hello Tomi Valkeinen,
> I have some questions about dss2 driver.]
> 
> Tomi,
> 
> Tim has patched your latest DSS2 2.6.29 git (master branch) to add
> support for YUV rotation. It has been successfully tested on the coming
> Touch Book, as well as the Beagleboard Rev B6 with the exception of the
> bug mentioned below. You may want to review this patch and perhaps
> integrate once we have fixed the problem below.
> 
> A couple of questions and comments:
> 
> 1. dss.c has no way of knowing whether VRFB is being used or not --
> this is a problem because you need to decide whether to call
> calc_rotation_offset_vrfb(...) or calc_rotation_offset(...). Any
> suggestions on how the rotation mode should be passed between dss.c and
> omapfb-main.c?
> 
[Shah, Hardik] I have also patched the DSS to support the DSS YUV rotation.  Here the rotation type is passed to know the type of rotation required by driver.  I have also modified the FBDEV driver to use this patch.  Please find the both patches.  I have tested it on the old master of tomi. Commit id is 4261fafc4fdc0730b3d4dd83c036d8be09ec8575.  I am planning to rebase it on the latest master soon. I have tested the FBDEV driver with different rotation and resolution settings.

> 2. If I try to rotate both plane 0 and plane 1 to either 90 degrees or
> 270 (doesn't matter which is which), as soon as you try to play a video
> you get VID1_FIFO_UNDERFLOW error messages, so it seems that the
> hardware seems to be struggling a little when you have two sets of
> 90/270 degree rotations. If one of the planes is 0/180 and the other
> is 90/270, then everything is fine. Would changing the FIFO settings
> somehow improve this or do you have any ideas about what else might make
> it work better?
[Shah, Hardik] In past I saw setting the FIFO size eliminates this problem.  I have some FIFO setting can you please try this out and let me know the result.
FIFO_HIGH_THRES = 0x3FC and GFX_FIFO_LOW_THRES = 0x3BC.  This I tried in on OMAP3.

Regards,
Hardik Shah
> 
> 
> Thanks in advance,
> 
> Grégoire Gentil
[Shah, Hardik] Hi,

[-- Attachment #2: 0002-DSS2-OMAPFB-Changed-to-support-YUV-VRFB-rotation.patch --]
[-- Type: application/octet-stream, Size: 6018 bytes --]

From 7cb8ed8d13145ec031a7aa8771956b2f4a3c8978 Mon Sep 17 00:00:00 2001
From: Hardik Shah <hardik.shah@ti.com>
Date: Thu, 2 Apr 2009 17:03:34 +0530
Subject: [PATCH 1/1] DSS2: OMAPFB: Changed to support YUV VRFB rotation.

DSS2 requires the rotation_type to be passed by driver

Signed-off-by: Hardik Shah <hardik.shah@ti.com>
---
 drivers/video/omap2/omapfb/omapfb-main.c |   31 +++++++++++++++--------------
 drivers/video/omap2/omapfb/omapfb.h      |    7 +-----
 2 files changed, 17 insertions(+), 21 deletions(-)

diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
index ad2f0e3..e3fc71f 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -176,7 +176,7 @@ static unsigned omapfb_get_vrfb_offset(struct omapfb_info *ofbi, int rot)
 
 static u32 omapfb_get_region_rot_paddr(struct omapfb_info *ofbi)
 {
-	if (ofbi->rotation_type == OMAPFB_ROT_VRFB) {
+	if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB) {
 		unsigned offset;
 		int rot;
 
@@ -192,7 +192,7 @@ static u32 omapfb_get_region_rot_paddr(struct omapfb_info *ofbi)
 
 u32 omapfb_get_region_paddr(struct omapfb_info *ofbi)
 {
-	if (ofbi->rotation_type == OMAPFB_ROT_VRFB)
+	if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB)
 		return ofbi->region.vrfb.paddr[0];
 	else
 		return ofbi->region.paddr;
@@ -200,7 +200,7 @@ u32 omapfb_get_region_paddr(struct omapfb_info *ofbi)
 
 void __iomem *omapfb_get_region_vaddr(struct omapfb_info *ofbi)
 {
-	if (ofbi->rotation_type == OMAPFB_ROT_VRFB)
+	if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB)
 		return ofbi->region.vrfb.vaddr[0];
 	else
 		return ofbi->region.vaddr;
@@ -383,7 +383,7 @@ void set_fb_fix(struct fb_info *fbi)
 	fbi->screen_base = (char __iomem *)omapfb_get_region_vaddr(ofbi);
 
 	/* used by mmap in fbmem.c */
-	if (ofbi->rotation_type == OMAPFB_ROT_VRFB)
+	if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB)
 		fix->line_length =
 			(OMAP_VRFB_LINE_LEN * var->bits_per_pixel) >> 3;
 	else
@@ -420,7 +420,7 @@ void set_fb_fix(struct fb_info *fbi)
 	fix->ypanstep = 1;
 
 	if (rg->size) {
-		if (ofbi->rotation_type == OMAPFB_ROT_VRFB)
+		if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB)
 			omap_vrfb_setup(&rg->vrfb, rg->paddr,
 					var->xres_virtual, var->yres_virtual,
 					var->bits_per_pixel >> 3);
@@ -512,7 +512,7 @@ int check_fb_var(struct fb_info *fbi, struct fb_var_screeninfo *var)
 	if (var->yres > var->yres_virtual)
 		var->yres = var->yres_virtual;
 
-	if (ofbi->rotation_type == OMAPFB_ROT_VRFB)
+	if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB)
 		line_size = OMAP_VRFB_LINE_LEN * bytespp;
 	else
 		line_size = var->xres_virtual * bytespp;
@@ -534,7 +534,7 @@ int check_fb_var(struct fb_info *fbi, struct fb_var_screeninfo *var)
 
 	if (line_size * var->yres_virtual > max_frame_size) {
 		DBG("can't fit FB into memory, reducing x\n");
-		if (ofbi->rotation_type == OMAPFB_ROT_VRFB)
+		if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB)
 			return -EINVAL;
 
 		var->xres_virtual = max_frame_size / var->yres_virtual /
@@ -673,7 +673,7 @@ static int omapfb_setup_overlay(struct fb_info *fbi, struct omap_overlay *ovl,
 	offset = ((var->yoffset * var->xres_virtual +
 				var->xoffset) * var->bits_per_pixel) >> 3;
 
-	if (ofbi->rotation_type == OMAPFB_ROT_VRFB) {
+	if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB) {
 		data_start_p = omapfb_get_region_rot_paddr(ofbi);
 		data_start_v = NULL;
 	} else {
@@ -695,8 +695,8 @@ static int omapfb_setup_overlay(struct fb_info *fbi, struct omap_overlay *ovl,
 
 	ovl->get_overlay_info(ovl, &info);
 
-	if (ofbi->rotation_type == OMAPFB_ROT_VRFB) {
-		rot = 0;
+	if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB) {
+		rot = ofbi->rotation;
 		mirror = 0;
 	} else {
 		rot = ofbi->rotation;
@@ -709,6 +709,7 @@ static int omapfb_setup_overlay(struct fb_info *fbi, struct omap_overlay *ovl,
 	info.width = xres;
 	info.height = yres;
 	info.color_mode = mode;
+	info.rotation_type = ofbi->rotation_type;
 	info.rotation = rot;
 	info.mirror = mirror;
 
@@ -1106,7 +1107,7 @@ static void omapfb_free_fbmem(struct fb_info *fbi)
 	if (rg->vaddr)
 		iounmap(rg->vaddr);
 
-	if (ofbi->rotation_type == OMAPFB_ROT_VRFB) {
+	if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB) {
 		/* unmap the 0 angle rotation */
 		if (rg->vrfb.vaddr[0]) {
 			iounmap(rg->vrfb.vaddr[0]);
@@ -1166,7 +1167,7 @@ static int omapfb_alloc_fbmem(struct fb_info *fbi, unsigned long size,
 		return -ENOMEM;
 	}
 
-	if (ofbi->rotation_type != OMAPFB_ROT_VRFB) {
+	if (ofbi->rotation_type != OMAP_DSS_ROT_VRFB) {
 		vaddr = ioremap_wc(paddr, size);
 
 		if (!vaddr) {
@@ -1244,7 +1245,7 @@ static int omapfb_alloc_fbmem_display(struct fb_info *fbi, unsigned long size,
 
 		display->get_resolution(display, &w, &h);
 
-		if (ofbi->rotation_type == OMAPFB_ROT_VRFB) {
+		if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB) {
 			int oldw = w, oldh = h;
 
 			omap_vrfb_adjust_size(&w, &h, bytespp);
@@ -1593,8 +1594,8 @@ static int omapfb_create_framebuffers(struct omapfb2_device *fbdev)
 		ofbi->id = i;
 
 		/* assign these early, so that fb alloc can use them */
-		ofbi->rotation_type = def_vrfb ? OMAPFB_ROT_VRFB :
-			OMAPFB_ROT_DMA;
+		ofbi->rotation_type = def_vrfb ? OMAP_DSS_ROT_VRFB :
+			OMAP_DSS_ROT_DMA;
 		ofbi->rotation = def_rotate;
 		ofbi->mirror = def_mirror;
 
diff --git a/drivers/video/omap2/omapfb/omapfb.h b/drivers/video/omap2/omapfb/omapfb.h
index 65e9e6e..88e7675 100644
--- a/drivers/video/omap2/omapfb/omapfb.h
+++ b/drivers/video/omap2/omapfb/omapfb.h
@@ -51,11 +51,6 @@ struct omapfb2_mem_region {
 	bool		map;		/* kernel mapped by the driver */
 };
 
-enum omapfb_rotation_type {
-	OMAPFB_ROT_DMA = 0,
-	OMAPFB_ROT_VRFB = 1,
-};
-
 /* appended to fb_info */
 struct omapfb_info {
 	int id;
@@ -64,7 +59,7 @@ struct omapfb_info {
 	int num_overlays;
 	struct omap_overlay *overlays[OMAPFB_MAX_OVL_PER_FB];
 	struct omapfb2_device *fbdev;
-	enum omapfb_rotation_type rotation_type;
+	enum omap_dss_rotation_type rotation_type;
 	u8 rotation;
 	bool mirror;
 };
-- 
1.6.0.3


[-- Attachment #3: 0001-DSS2-Added-support-for-the-YUV-VRFB-rotation.patch --]
[-- Type: application/octet-stream, Size: 5852 bytes --]

From e67fafadde2b908ee5c4309fc3bd3cd5a110b0e0 Mon Sep 17 00:00:00 2001
From: Hardik Shah <hardik.shah@ti.com>
Date: Thu, 2 Apr 2009 16:58:39 +0530
Subject: [PATCH 1/1] DSS2: Added support for the YUV VRFB rotation.

Modified disc_setup_plane to get the rotation_type from
driver and set the row_inc value accordingly.

Signed-off-by: Hardik Shah <hardik.shah@ti.com>
---
 arch/arm/plat-omap/include/mach/display.h |    6 ++
 drivers/video/omap2/dss/dispc.c           |   77 ++++++++++++++++++++++++++++-
 drivers/video/omap2/dss/dss.h             |    1 +
 drivers/video/omap2/dss/manager.c         |    2 +
 4 files changed, 84 insertions(+), 2 deletions(-)

diff --git a/arch/arm/plat-omap/include/mach/display.h b/arch/arm/plat-omap/include/mach/display.h
index eaacf3e..d48b5d2 100644
--- a/arch/arm/plat-omap/include/mach/display.h
+++ b/arch/arm/plat-omap/include/mach/display.h
@@ -338,6 +338,11 @@ enum omap_dss_overlay_managers {
 
 struct omap_overlay_manager;
 
+enum omap_dss_rotation_type {
+	OMAP_DSS_ROT_DMA = 0,
+	OMAP_DSS_ROT_VRFB = 1,
+};
+
 struct omap_overlay_info {
 	bool enabled;
 
@@ -348,6 +353,7 @@ struct omap_overlay_info {
 	u16 height;
 	enum omap_color_mode color_mode;
 	u8 rotation;
+	enum omap_dss_rotation_type rotation_type;
 	bool mirror;
 
 	u16 pos_x;
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 711086f..597186b 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -1133,7 +1133,70 @@ static int pixinc(int pixels, u8 ps)
 		BUG();
 }
 
-static void calc_rotation_offset(u8 rotation, bool mirror,
+static void calc_vrfb_rotation_offset(u8 rotation, bool mirror,
+		u16 screen_width,
+		u16 width, u16 height,
+		enum omap_color_mode color_mode, bool fieldmode,
+		unsigned *offset0, unsigned *offset1,
+		u16 *row_inc, u16 *pix_inc)
+{
+	u8 ps;
+
+	switch (color_mode) {
+	case OMAP_DSS_COLOR_RGB16:
+	case OMAP_DSS_COLOR_ARGB16:
+		ps = 2;
+		break;
+
+	case OMAP_DSS_COLOR_RGB24P:
+		ps = 3;
+		break;
+
+	case OMAP_DSS_COLOR_RGB24U:
+	case OMAP_DSS_COLOR_ARGB32:
+	case OMAP_DSS_COLOR_RGBA32:
+	case OMAP_DSS_COLOR_RGBX32:
+	case OMAP_DSS_COLOR_YUV2:
+	case OMAP_DSS_COLOR_UYVY:
+		ps = 4;
+		break;
+
+	default:
+		BUG();
+		return;
+	}
+
+	DSSDBG("calc_rot(%d): scrw %d, %dx%d\n", rotation, screen_width,
+			width, height);
+	switch (rotation + mirror * 4) {
+	case 0:
+	case 2:
+		/* If the pixel format is YUV or UYVY divide the width
+		 * of the image by 2  for 0 degree and
+		 */
+		if (color_mode == OMAP_DSS_COLOR_YUV2 ||
+			color_mode == OMAP_DSS_COLOR_UYVY)
+			width = width >> 1;
+	case 1:
+	case 3:
+		*offset0 = 0;
+		if (fieldmode)
+			*offset1 = screen_width * ps;
+		else
+			*offset1 = 0;
+
+		*row_inc = pixinc(1 + (screen_width - width) +
+				(fieldmode ? screen_width : 0),
+				ps);
+		*pix_inc = pixinc(1, ps);
+		break;
+	default: {
+		BUG();
+	}
+	}
+}
+
+static void calc_dma_rotation_offset(u8 rotation, bool mirror,
 		u16 screen_width,
 		u16 width, u16 height,
 		enum omap_color_mode color_mode, bool fieldmode,
@@ -1296,6 +1359,7 @@ static int _dispc_setup_plane(enum omap_plane plane,
 		u16 out_width, u16 out_height,
 		enum omap_color_mode color_mode,
 		bool ilace,
+		enum omap_dss_rotation_type rotation_type,
 		u8 rotation, int mirror,
 		u8 global_alpha)
 {
@@ -1363,7 +1427,13 @@ static int _dispc_setup_plane(enum omap_plane plane,
 		fieldmode = 1;
 
 	//printk("%s %d\n", __func__, __LINE__);
-	calc_rotation_offset(rotation, mirror,
+	if (rotation_type == OMAP_DSS_ROT_DMA)
+		calc_dma_rotation_offset(rotation, mirror,
+			screen_width, width, height, color_mode,
+			fieldmode,
+			&offset0, &offset1, &row_inc, &pix_inc);
+	else
+		calc_vrfb_rotation_offset(rotation, mirror,
 			screen_width, width, height, color_mode,
 			fieldmode,
 			&offset0, &offset1, &row_inc, &pix_inc);
@@ -2747,6 +2817,7 @@ int dispc_setup_plane(enum omap_plane plane, enum omap_channel channel_out,
 		       u16 out_width, u16 out_height,
 		       enum omap_color_mode color_mode,
 		       bool ilace,
+		       enum omap_dss_rotation_type rotation_type,
 		       u8 rotation, bool mirror,
 		       u8 global_alpha)
 {
@@ -2778,6 +2849,7 @@ int dispc_setup_plane(enum omap_plane plane, enum omap_channel channel_out,
 			   width, height,
 			   out_width, out_height,
 			   color_mode, ilace,
+			   rotation_type,
 			   rotation, mirror, global_alpha);
 
 	enable_clocks(0);
@@ -2991,6 +3063,7 @@ void dispc_setup_partial_planes(struct omap_display *display,
 				pw, ph,
 				pow, poh,
 				pi->color_mode, 0,
+				pi->rotation_type,
 				pi->rotation, // XXX rotation probably wrong
 				pi->mirror,
 				g_alpha);
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index 4576821..53ccac2 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -268,6 +268,7 @@ int dispc_setup_plane(enum omap_plane plane, enum omap_channel channel_out,
 		      u16 out_width, u16 out_height,
 		      enum omap_color_mode color_mode,
 		      bool ilace,
+		      enum omap_dss_rotation_type rotation_type,
 		      u8 rotation, bool mirror,
 		      u8 global_alpha);
 
diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
index e829156..ff29bc5 100644
--- a/drivers/video/omap2/dss/manager.c
+++ b/drivers/video/omap2/dss/manager.c
@@ -195,6 +195,7 @@ static ssize_t manager_color_key_enabled_store(struct omap_overlay_manager *mgr,
 	return size;
 }
 
+
 struct manager_attribute {
 	struct attribute attr;
 	ssize_t (*show)(struct omap_overlay_manager *, char *);
@@ -397,6 +398,7 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
 				outh,
 				ovl->info.color_mode,
 				ilace,
+				ovl->info.rotation_type,
 				ovl->info.rotation,
 				ovl->info.mirror,
 				ovl->info.global_alpha);
-- 
1.6.0.3


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: YUV rotation support for DSS2 - 2.6.29 [WAS Re: Hello Tomi Valkeinen, I have some questions about dss2 driver.]
  2009-04-07  4:41     ` Shah, Hardik
@ 2009-04-07 19:00       ` Tim Yamin
  2009-04-13 12:05         ` Shah, Hardik
  0 siblings, 1 reply; 12+ messages in thread
From: Tim Yamin @ 2009-04-07 19:00 UTC (permalink / raw)
  To: Shah, Hardik
  Cc: gregoire@gentil.com, tomi.valkeinen@nokia.com,
	linux-omap@vger.kernel.org, beagleboard@googlegroups.com

[-- Attachment #1: Type: text/plain, Size: 1293 bytes --]

Hi Hardik / Tomi,

> [Shah, Hardik] I have also patched the DSS to support the DSS YUV rotation.  Here the rotation type is passed to know the type of rotation required by driver.  I have also modified the FBDEV driver to use this patch.  Please find the both patches.  I have tested it on the old master of tomi. Commit id is 4261fafc4fdc0730b3d4dd83c036d8be09ec8575.  I am planning to rebase it on the latest master soon. I have tested the FBDEV driver with different rotation and resolution settings.

I've merged my changes with your patches and rebased against master,
please find the new patch attached.

> [Shah, Hardik] In past I saw setting the FIFO size eliminates this problem.  I have some FIFO setting can you please try this out and let me know the result.
> FIFO_HIGH_THRES = 0x3FC and GFX_FIFO_LOW_THRES = 0x3BC.  This I tried in on OMAP3.

Tried this (see attached patch) but does not help -- still getting
these errors as soon as I try to play a video:

omapdss DISPC error: VID1_FIFO_UNDERFLOW, disabling VID1
omapdss DISPC error: SYNC_LOST, disabling LCD

The FIFOs are configured as follows:

omapdss DISPC: fifo(0) size 1024, low/high old 3008/3071, new 956/1020
omapdss DISPC: fifo(1) size 1024, low/high old 956/1020, new 956/1020

Cheers,

Tim

[-- Attachment #2: 0002-Change-FIFO-settings-as-suggested-by-Hardik.patch --]
[-- Type: text/x-patch, Size: 1083 bytes --]

From 5c575fd5226164c75e0bc98a5ead80ee6900fdc1 Mon Sep 17 00:00:00 2001
From: Tim Yamin <plasm@roo.me.uk>
Date: Tue, 7 Apr 2009 11:27:54 -0700
Subject: [PATCH] Change FIFO settings as suggested by Hardik.

---
 drivers/video/omap2/dss/dispc.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 550a2a0..61785e3 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -960,6 +960,12 @@ void dispc_setup_plane_fifo(enum omap_plane plane, u32 low, u32 high)
 
 	BUG_ON(low > size || high > size);
 
+	if(size == 1024)
+	{
+		high = 0x3FC;
+		low = 0x3BC;
+	}
+
 	DSSDBG("fifo(%d) size %d, low/high old %u/%u, new %u/%u\n",
 			plane, size,
 			REG_GET(ftrs_reg[plane], 11, 0),
@@ -1463,6 +1469,8 @@ static int _dispc_setup_plane(enum omap_plane plane,
 			out_width, out_height);
 
 	_dispc_set_plane_pos(plane, pos_x, pos_y);
+	if (plane != OMAP_DSS_GFX)
+		_dispc_set_plane_pos(plane, 5, 5);
 
 	_dispc_set_pic_size(plane, width, height);
 
-- 
1.5.6.3


[-- Attachment #3: 0001-DSS2-Add-YUV-VRFB-rotation-support.patch --]
[-- Type: text/x-patch, Size: 13265 bytes --]

From 826edf9b2b9af7b9bc32f4363724af174911175c Mon Sep 17 00:00:00 2001
From: Tim Yamin <plasm@roo.me.uk>
Date: Tue, 7 Apr 2009 11:52:35 -0700
Subject: [PATCH] DSS2: Add YUV VRFB rotation support

This is a rebased version of Hardik Shah's patch with a few additional
tweaks from me.

Signed-off-by: Tim Yamin <plasm@roo.me.uk>
---
 arch/arm/plat-omap/include/mach/display.h |    6 ++
 arch/arm/plat-omap/vrfb.c                 |    4 +-
 drivers/video/omap2/dss/dispc.c           |   87 ++++++++++++++++++++++++++--
 drivers/video/omap2/dss/dss.h             |    1 +
 drivers/video/omap2/dss/manager.c         |    1 +
 drivers/video/omap2/omapfb/omapfb-main.c  |   66 +++++++++++-----------
 drivers/video/omap2/omapfb/omapfb.h       |    7 +--
 7 files changed, 126 insertions(+), 46 deletions(-)

diff --git a/arch/arm/plat-omap/include/mach/display.h b/arch/arm/plat-omap/include/mach/display.h
index 6b702c7..b0a6272 100644
--- a/arch/arm/plat-omap/include/mach/display.h
+++ b/arch/arm/plat-omap/include/mach/display.h
@@ -341,6 +341,11 @@ enum omap_dss_overlay_managers {
 
 struct omap_overlay_manager;
 
+enum omap_dss_rotation_type {
+	OMAP_DSS_ROT_DMA = 0,
+	OMAP_DSS_ROT_VRFB = 1,
+};
+
 struct omap_overlay_info {
 	bool enabled;
 
@@ -351,6 +356,7 @@ struct omap_overlay_info {
 	u16 height;
 	enum omap_color_mode color_mode;
 	u8 rotation;
+	enum omap_dss_rotation_type rotation_type;
 	bool mirror;
 
 	u16 pos_x;
diff --git a/arch/arm/plat-omap/vrfb.c b/arch/arm/plat-omap/vrfb.c
index 7e0f8fc..77aa9a7 100644
--- a/arch/arm/plat-omap/vrfb.c
+++ b/arch/arm/plat-omap/vrfb.c
@@ -61,8 +61,10 @@ void omap_vrfb_setup(struct vrfb *vrfb, unsigned long paddr,
 			width, height, bytespp);
 
 	if (bytespp == 4)
+	{
 		pixel_size_exp = 2;
-	else if (bytespp == 2)
+		width >>= 1;
+	} else if (bytespp == 2)
 		pixel_size_exp = 1;
 	else
 		BUG();
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index ae7be3d..b1dbb79 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -1106,7 +1106,7 @@ static void _dispc_set_rotation_attrs(enum omap_plane plane, u8 rotation,
 			case 0: vidrot = 0; break;
 			case 1: vidrot = 1; break;
 			case 2: vidrot = 2; break;
-			case 3: vidrot = 1; break;
+			case 3: vidrot = 3; break;
 			}
 		}
 
@@ -1134,7 +1134,70 @@ static s32 pixinc(int pixels, u8 ps)
 		BUG();
 }
 
-static void calc_rotation_offset(u8 rotation, bool mirror,
+static void calc_vrfb_rotation_offset(u8 rotation, bool mirror,
+		u16 screen_width,
+		u16 width, u16 height,
+		enum omap_color_mode color_mode, bool fieldmode,
+		unsigned *offset0, unsigned *offset1,
+		s32 *row_inc, s32 *pix_inc)
+{
+	u8 ps;
+
+	switch (color_mode) {
+	case OMAP_DSS_COLOR_RGB16:
+	case OMAP_DSS_COLOR_ARGB16:
+		ps = 2;
+		break;
+
+	case OMAP_DSS_COLOR_RGB24P:
+		ps = 3;
+		break;
+
+	case OMAP_DSS_COLOR_RGB24U:
+	case OMAP_DSS_COLOR_ARGB32:
+	case OMAP_DSS_COLOR_RGBA32:
+	case OMAP_DSS_COLOR_RGBX32:
+	case OMAP_DSS_COLOR_YUV2:
+	case OMAP_DSS_COLOR_UYVY:
+		ps = 4;
+		break;
+
+	default:
+		BUG();
+		return;
+	}
+
+	DSSDBG("calc_rot(%d): scrw %d, %dx%d\n", rotation, screen_width,
+			width, height);
+	switch (rotation + mirror * 4) {
+	case 0:
+	case 2:
+		/*
+		 * If the pixel format is YUV or UYVY divide the width
+		 * of the image by 2.
+		 */
+		if (color_mode == OMAP_DSS_COLOR_YUV2 ||
+			color_mode == OMAP_DSS_COLOR_UYVY)
+			width = width >> 1;
+	case 1:
+	case 3:
+		*offset0 = 0;
+		if (fieldmode)
+			*offset1 = screen_width * ps;
+		else
+			*offset1 = 0;
+
+		*row_inc = pixinc(1 + (screen_width - width) +
+				(fieldmode ? screen_width : 0),
+				ps);
+		*pix_inc = pixinc(1, ps);
+		break;
+	default:
+		BUG();
+	}
+}
+
+static void calc_dma_rotation_offset(u8 rotation, bool mirror,
 		u16 screen_width,
 		u16 width, u16 height,
 		enum omap_color_mode color_mode, bool fieldmode,
@@ -1357,6 +1420,7 @@ static int _dispc_setup_plane(enum omap_plane plane,
 		u16 out_width, u16 out_height,
 		enum omap_color_mode color_mode,
 		bool ilace,
+		enum omap_dss_rotation_type rotation_type,
 		u8 rotation, int mirror)
 {
 	const int maxdownscale = cpu_is_omap34xx() ? 4 : 2;
@@ -1463,10 +1527,16 @@ static int _dispc_setup_plane(enum omap_plane plane,
 			return -EINVAL;
 	}
 
-	calc_rotation_offset(rotation, mirror,
-			screen_width, width, frame_height, color_mode,
-			fieldmode,
-			&offset0, &offset1, &row_inc, &pix_inc);
+	if (rotation_type == OMAP_DSS_ROT_DMA)
+		calc_dma_rotation_offset(rotation, mirror,
+				screen_width, width, height, color_mode,
+				fieldmode,
+				&offset0, &offset1, &row_inc, &pix_inc);
+	else
+		calc_vrfb_rotation_offset(rotation, mirror,
+				screen_width, width, height, color_mode,
+				fieldmode,
+				&offset0, &offset1, &row_inc, &pix_inc);
 
 	DSSDBG("offset0 %u, offset1 %u, row_inc %d, pix_inc %d\n",
 			offset0, offset1, row_inc, pix_inc);
@@ -2879,6 +2949,7 @@ int dispc_setup_plane(enum omap_plane plane, enum omap_channel channel_out,
 		       u16 out_width, u16 out_height,
 		       enum omap_color_mode color_mode,
 		       bool ilace,
+		       enum omap_dss_rotation_type rotation_type,
 		       u8 rotation, bool mirror)
 {
 	int r = 0;
@@ -2899,6 +2970,7 @@ int dispc_setup_plane(enum omap_plane plane, enum omap_channel channel_out,
 			   width, height,
 			   out_width, out_height,
 			   color_mode, ilace,
+			   rotation_type,
 			   rotation, mirror);
 
 	enable_clocks(0);
@@ -3112,7 +3184,8 @@ void dispc_setup_partial_planes(struct omap_display *display,
 				pw, ph,
 				pow, poh,
 				pi->color_mode, 0,
-				pi->rotation, // XXX rotation probably wrong
+				pi->rotation_type,
+				pi->rotation,
 				pi->mirror);
 
 		dispc_enable_plane(ovl->id, 1);
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index 0be42b6..c722eee 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -269,6 +269,7 @@ int dispc_setup_plane(enum omap_plane plane, enum omap_channel channel_out,
 		      u16 out_width, u16 out_height,
 		      enum omap_color_mode color_mode,
 		      bool ilace,
+		      enum omap_dss_rotation_type rotation_type,
 		      u8 rotation, bool mirror);
 
 void dispc_go(enum omap_channel channel);
diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
index b0fee80..8ca0bbb 100644
--- a/drivers/video/omap2/dss/manager.c
+++ b/drivers/video/omap2/dss/manager.c
@@ -395,6 +395,7 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
 				outh,
 				ovl->info.color_mode,
 				ilace,
+				ovl->info.rotation_type,
 				ovl->info.rotation,
 				ovl->info.mirror);
 
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
index 12ce0c3..8327681 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -176,15 +176,9 @@ static unsigned omapfb_get_vrfb_offset(struct omapfb_info *ofbi, int rot)
 
 static u32 omapfb_get_region_rot_paddr(struct omapfb_info *ofbi)
 {
-	if (ofbi->rotation_type == OMAPFB_ROT_VRFB) {
-		unsigned offset;
-		int rot;
-
-		rot = ofbi->rotation;
-
-		offset = omapfb_get_vrfb_offset(ofbi, rot);
-
-		return ofbi->region.vrfb.paddr[rot] + offset;
+	if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB) {
+		return ofbi->region.vrfb.paddr[ofbi->rotation]
+			+ omapfb_get_vrfb_offset(ofbi, ofbi->rotation);
 	} else {
 		return ofbi->region.paddr;
 	}
@@ -192,7 +186,7 @@ static u32 omapfb_get_region_rot_paddr(struct omapfb_info *ofbi)
 
 u32 omapfb_get_region_paddr(struct omapfb_info *ofbi)
 {
-	if (ofbi->rotation_type == OMAPFB_ROT_VRFB)
+	if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB)
 		return ofbi->region.vrfb.paddr[0];
 	else
 		return ofbi->region.paddr;
@@ -200,7 +194,7 @@ u32 omapfb_get_region_paddr(struct omapfb_info *ofbi)
 
 void __iomem *omapfb_get_region_vaddr(struct omapfb_info *ofbi)
 {
-	if (ofbi->rotation_type == OMAPFB_ROT_VRFB)
+	if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB)
 		return ofbi->region.vrfb.vaddr[0];
 	else
 		return ofbi->region.vaddr;
@@ -383,7 +377,7 @@ void set_fb_fix(struct fb_info *fbi)
 	fbi->screen_base = (char __iomem *)omapfb_get_region_vaddr(ofbi);
 
 	/* used by mmap in fbmem.c */
-	if (ofbi->rotation_type == OMAPFB_ROT_VRFB)
+	if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB)
 		fix->line_length =
 			(OMAP_VRFB_LINE_LEN * var->bits_per_pixel) >> 3;
 	else
@@ -419,11 +413,21 @@ void set_fb_fix(struct fb_info *fbi)
 	fix->xpanstep = 1;
 	fix->ypanstep = 1;
 
-	if (rg->size) {
-		if (ofbi->rotation_type == OMAPFB_ROT_VRFB)
-			omap_vrfb_setup(&rg->vrfb, rg->paddr,
-					var->xres_virtual, var->yres_virtual,
-					var->bits_per_pixel >> 3);
+	if (rg->size && ofbi->rotation_type == OMAP_DSS_ROT_VRFB) {
+		switch(var->nonstd)
+		{
+			case OMAPFB_COLOR_YUV422:
+			case OMAPFB_COLOR_YUV420:
+			case OMAPFB_COLOR_YUY422:
+				omap_vrfb_setup(&rg->vrfb, rg->paddr,
+						var->xres_virtual, var->yres_virtual,
+						var->bits_per_pixel >> 2);
+				break;
+			default:
+				omap_vrfb_setup(&rg->vrfb, rg->paddr,
+						var->xres_virtual, var->yres_virtual,
+						var->bits_per_pixel >> 3);
+		}
 	}
 }
 
@@ -512,7 +516,7 @@ int check_fb_var(struct fb_info *fbi, struct fb_var_screeninfo *var)
 	if (var->yres > var->yres_virtual)
 		var->yres = var->yres_virtual;
 
-	if (ofbi->rotation_type == OMAPFB_ROT_VRFB)
+	if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB)
 		line_size = OMAP_VRFB_LINE_LEN * bytespp;
 	else
 		line_size = var->xres_virtual * bytespp;
@@ -534,7 +538,7 @@ int check_fb_var(struct fb_info *fbi, struct fb_var_screeninfo *var)
 
 	if (line_size * var->yres_virtual > max_frame_size) {
 		DBG("can't fit FB into memory, reducing x\n");
-		if (ofbi->rotation_type == OMAPFB_ROT_VRFB)
+		if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB)
 			return -EINVAL;
 
 		var->xres_virtual = max_frame_size / var->yres_virtual /
@@ -657,7 +661,7 @@ static int omapfb_setup_overlay(struct fb_info *fbi, struct omap_overlay *ovl,
 	struct omap_overlay_info info;
 	int xres, yres;
 	int screen_width;
-	int rot, mirror;
+	int mirror;
 
 	DBG("setup_overlay %d, posx %d, posy %d, outw %d, outh %d\n", ofbi->id,
 			posx, posy, outw, outh);
@@ -673,7 +677,7 @@ static int omapfb_setup_overlay(struct fb_info *fbi, struct omap_overlay *ovl,
 	offset = ((var->yoffset * var->xres_virtual +
 				var->xoffset) * var->bits_per_pixel) >> 3;
 
-	if (ofbi->rotation_type == OMAPFB_ROT_VRFB) {
+	if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB) {
 		data_start_p = omapfb_get_region_rot_paddr(ofbi);
 		data_start_v = NULL;
 	} else {
@@ -696,13 +700,10 @@ static int omapfb_setup_overlay(struct fb_info *fbi, struct omap_overlay *ovl,
 
 	ovl->get_overlay_info(ovl, &info);
 
-	if (ofbi->rotation_type == OMAPFB_ROT_VRFB) {
-		rot = 0;
+	if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB)
 		mirror = 0;
-	} else {
-		rot = ofbi->rotation;
+	else
 		mirror = ofbi->mirror;
-	}
 
 	info.paddr = data_start_p;
 	info.vaddr = data_start_v;
@@ -710,7 +711,8 @@ static int omapfb_setup_overlay(struct fb_info *fbi, struct omap_overlay *ovl,
 	info.width = xres;
 	info.height = yres;
 	info.color_mode = mode;
-	info.rotation = rot;
+	info.rotation_type = ofbi->rotation_type;
+	info.rotation = ofbi->rotation;
 	info.mirror = mirror;
 
 	info.pos_x = posx;
@@ -1106,7 +1108,7 @@ static void omapfb_free_fbmem(struct fb_info *fbi)
 	if (rg->vaddr)
 		iounmap(rg->vaddr);
 
-	if (ofbi->rotation_type == OMAPFB_ROT_VRFB) {
+	if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB) {
 		/* unmap the 0 angle rotation */
 		if (rg->vrfb.vaddr[0]) {
 			iounmap(rg->vrfb.vaddr[0]);
@@ -1166,7 +1168,7 @@ static int omapfb_alloc_fbmem(struct fb_info *fbi, unsigned long size,
 		return -ENOMEM;
 	}
 
-	if (ofbi->rotation_type != OMAPFB_ROT_VRFB) {
+	if (ofbi->rotation_type != OMAP_DSS_ROT_VRFB) {
 		vaddr = ioremap_wc(paddr, size);
 
 		if (!vaddr) {
@@ -1245,7 +1247,7 @@ static int omapfb_alloc_fbmem_display(struct fb_info *fbi, unsigned long size,
 
 		display->get_resolution(display, &w, &h);
 
-		if (ofbi->rotation_type == OMAPFB_ROT_VRFB) {
+		if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB) {
 #ifdef DEBUG
 			int oldw = w, oldh = h;
 #endif
@@ -1602,8 +1604,8 @@ static int omapfb_create_framebuffers(struct omapfb2_device *fbdev)
 		ofbi->id = i;
 
 		/* assign these early, so that fb alloc can use them */
-		ofbi->rotation_type = def_vrfb ? OMAPFB_ROT_VRFB :
-			OMAPFB_ROT_DMA;
+		ofbi->rotation_type = def_vrfb ? OMAP_DSS_ROT_VRFB :
+			OMAP_DSS_ROT_DMA;
 		ofbi->rotation = def_rotate;
 		ofbi->mirror = def_mirror;
 
diff --git a/drivers/video/omap2/omapfb/omapfb.h b/drivers/video/omap2/omapfb/omapfb.h
index 65e9e6e..88e7675 100644
--- a/drivers/video/omap2/omapfb/omapfb.h
+++ b/drivers/video/omap2/omapfb/omapfb.h
@@ -51,11 +51,6 @@ struct omapfb2_mem_region {
 	bool		map;		/* kernel mapped by the driver */
 };
 
-enum omapfb_rotation_type {
-	OMAPFB_ROT_DMA = 0,
-	OMAPFB_ROT_VRFB = 1,
-};
-
 /* appended to fb_info */
 struct omapfb_info {
 	int id;
@@ -64,7 +59,7 @@ struct omapfb_info {
 	int num_overlays;
 	struct omap_overlay *overlays[OMAPFB_MAX_OVL_PER_FB];
 	struct omapfb2_device *fbdev;
-	enum omapfb_rotation_type rotation_type;
+	enum omap_dss_rotation_type rotation_type;
 	u8 rotation;
 	bool mirror;
 };
-- 
1.5.6.3


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* RE: YUV rotation support for DSS2 - 2.6.29 [WAS Re: Hello Tomi Valkeinen, I have some questions about dss2 driver.]
  2009-04-07 19:00       ` Tim Yamin
@ 2009-04-13 12:05         ` Shah, Hardik
  2009-04-13 21:00           ` Tim Yamin
  0 siblings, 1 reply; 12+ messages in thread
From: Shah, Hardik @ 2009-04-13 12:05 UTC (permalink / raw)
  To: Tim Yamin
  Cc: gregoire@gentil.com, tomi.valkeinen@nokia.com,
	linux-omap@vger.kernel.org, beagleboard@googlegroups.com

[-- Attachment #1: Type: text/plain, Size: 2738 bytes --]

Hi,


> -----Original Message-----
> From: plasmaroo@gmail.com [mailto:plasmaroo@gmail.com] On Behalf Of Tim Yamin
> Sent: Wednesday, April 08, 2009 12:31 AM
> To: Shah, Hardik
> Cc: gregoire@gentil.com; tomi.valkeinen@nokia.com; linux-omap@vger.kernel.org;
> beagleboard@googlegroups.com
> Subject: Re: YUV rotation support for DSS2 - 2.6.29 [WAS Re: Hello Tomi
> Valkeinen, I have some questions about dss2 driver.]
> 
> Hi Hardik / Tomi,
> 
> > [Shah, Hardik] I have also patched the DSS to support the DSS YUV rotation.
>  Here the rotation type is passed to know the type of rotation required by
> driver.  I have also modified the FBDEV driver to use this patch.  Please find
> the both patches.  I have tested it on the old master of tomi. Commit id is
> 4261fafc4fdc0730b3d4dd83c036d8be09ec8575.  I am planning to rebase it on the
> latest master soon. I have tested the FBDEV driver with different rotation and
> resolution settings.

Hi Tim,
I  have done few changes to your patch.  

-	else if (bytespp == 2)
+		width >>= 1;
Will not work for 32 bit formats like ARGB or RGB24u.

Secondly I have fixed lot many check patch warnings/errors in your patch.  So please do that before providing patches.

Third I have implemented VRFB mirroring also. 

I have tested YUV, UYVY, RGB24u, RGB16, and ARGB on V4L2 driver with rotation and mirroring with different resolutions on LCD and its working fine.


Tim,

Will you please test the YUV rotation with frame buffer driver with the attached patch and let us know the result.  I have tested RGB rotation and its working fine.



Hi Tomi,
If YUV rotation with frame buffer passes can you please review the patch and merge it to your latest.

Regards,
Hardik
> 
> I've merged my changes with your patches and rebased against master,
> please find the new patch attached.
[Shah, Hardik] Hi Tim,
I have modified your DSS2 rotation patch to make it more generic to support YUV as well as ARGB32 and RGB24u formats.
> 
> > [Shah, Hardik] In past I saw setting the FIFO size eliminates this problem.
>  I have some FIFO setting can you please try this out and let me know the
> result.
> > FIFO_HIGH_THRES = 0x3FC and GFX_FIFO_LOW_THRES = 0x3BC.  This I tried in on
> OMAP3.
> 
> Tried this (see attached patch) but does not help -- still getting
> these errors as soon as I try to play a video:
> 
> omapdss DISPC error: VID1_FIFO_UNDERFLOW, disabling VID1
> omapdss DISPC error: SYNC_LOST, disabling LCD
> 
> The FIFOs are configured as follows:
> 
> omapdss DISPC: fifo(0) size 1024, low/high old 3008/3071, new 956/1020
> omapdss DISPC: fifo(1) size 1024, low/high old 956/1020, new 956/1020
> 
> Cheers,
> 
> Tim

[-- Attachment #2: 0002-DSS2-OMAPFB-Added-support-for-the-YUV-VRFB-rotatio.patch --]
[-- Type: application/octet-stream, Size: 7764 bytes --]

From c40d8f7f94fd5294393753445f31922bcd274a6a Mon Sep 17 00:00:00 2001
From: Hardik Shah <hardik.shah@ti.com>
Date: Thu, 9 Apr 2009 12:13:07 +0530
Subject: [PATCH 2/2] DSS2: OMAPFB: Added support for the YUV VRFB rotation and mirroring.

DSS2 now requires roatation_type to be specified by driver.
Added support for that.
DSS2 OMAPFB: Modified to pass the dss mode to omap_vrfb_setup function.

VRFB size register requires the width to be halved when the
mode is YUV or UYVY.  So VRFB is modifed to pass the mode to omap_vrfb_setup
function.

Few changes done by Tim Yamin
Signed-off-by: Tim Yamin <plasm@roo.me.uk>
Signed-off-by: Hardik Shah <hardik.shah@ti.com>
---
 arch/arm/plat-omap/vrfb.c                |    4 +-
 drivers/video/omap2/omapfb/omapfb-main.c |   59 ++++++++++++++----------------
 drivers/video/omap2/omapfb/omapfb.h      |    7 +---
 3 files changed, 30 insertions(+), 40 deletions(-)

diff --git a/arch/arm/plat-omap/vrfb.c b/arch/arm/plat-omap/vrfb.c
index e0036f7..5610539 100644
--- a/arch/arm/plat-omap/vrfb.c
+++ b/arch/arm/plat-omap/vrfb.c
@@ -88,9 +88,9 @@ void omap_vrfb_setup(struct vrfb *vrfb, unsigned long paddr,
 			color_mode == OMAP_DSS_COLOR_UYVY)
 		width >>= 1;
 
-	if (bytespp == 4) {
+	if (bytespp == 4)
 		pixel_size_exp = 2;
-	} else if (bytespp == 2)
+	else if (bytespp == 2)
 		pixel_size_exp = 1;
 	else
 		BUG();
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
index 12ce0c3..9043265 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -176,15 +176,9 @@ static unsigned omapfb_get_vrfb_offset(struct omapfb_info *ofbi, int rot)
 
 static u32 omapfb_get_region_rot_paddr(struct omapfb_info *ofbi)
 {
-	if (ofbi->rotation_type == OMAPFB_ROT_VRFB) {
-		unsigned offset;
-		int rot;
-
-		rot = ofbi->rotation;
-
-		offset = omapfb_get_vrfb_offset(ofbi, rot);
-
-		return ofbi->region.vrfb.paddr[rot] + offset;
+	if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB) {
+		return ofbi->region.vrfb.paddr[ofbi->rotation]
+			+ omapfb_get_vrfb_offset(ofbi, ofbi->rotation);
 	} else {
 		return ofbi->region.paddr;
 	}
@@ -192,7 +186,7 @@ static u32 omapfb_get_region_rot_paddr(struct omapfb_info *ofbi)
 
 u32 omapfb_get_region_paddr(struct omapfb_info *ofbi)
 {
-	if (ofbi->rotation_type == OMAPFB_ROT_VRFB)
+	if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB)
 		return ofbi->region.vrfb.paddr[0];
 	else
 		return ofbi->region.paddr;
@@ -200,7 +194,7 @@ u32 omapfb_get_region_paddr(struct omapfb_info *ofbi)
 
 void __iomem *omapfb_get_region_vaddr(struct omapfb_info *ofbi)
 {
-	if (ofbi->rotation_type == OMAPFB_ROT_VRFB)
+	if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB)
 		return ofbi->region.vrfb.vaddr[0];
 	else
 		return ofbi->region.vaddr;
@@ -383,7 +377,7 @@ void set_fb_fix(struct fb_info *fbi)
 	fbi->screen_base = (char __iomem *)omapfb_get_region_vaddr(ofbi);
 
 	/* used by mmap in fbmem.c */
-	if (ofbi->rotation_type == OMAPFB_ROT_VRFB)
+	if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB)
 		fix->line_length =
 			(OMAP_VRFB_LINE_LEN * var->bits_per_pixel) >> 3;
 	else
@@ -419,11 +413,14 @@ void set_fb_fix(struct fb_info *fbi)
 	fix->xpanstep = 1;
 	fix->ypanstep = 1;
 
-	if (rg->size) {
-		if (ofbi->rotation_type == OMAPFB_ROT_VRFB)
-			omap_vrfb_setup(&rg->vrfb, rg->paddr,
-					var->xres_virtual, var->yres_virtual,
-					var->bits_per_pixel >> 3);
+	if (rg->size && ofbi->rotation_type == OMAP_DSS_ROT_VRFB) {
+		enum omap_color_mode mode = 0;
+		mode = fb_mode_to_dss_mode(var);
+
+		omap_vrfb_setup(&rg->vrfb, rg->paddr,
+				var->xres_virtual,
+				var->yres_virtual,
+				mode);
 	}
 }
 
@@ -512,7 +509,7 @@ int check_fb_var(struct fb_info *fbi, struct fb_var_screeninfo *var)
 	if (var->yres > var->yres_virtual)
 		var->yres = var->yres_virtual;
 
-	if (ofbi->rotation_type == OMAPFB_ROT_VRFB)
+	if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB)
 		line_size = OMAP_VRFB_LINE_LEN * bytespp;
 	else
 		line_size = var->xres_virtual * bytespp;
@@ -534,7 +531,7 @@ int check_fb_var(struct fb_info *fbi, struct fb_var_screeninfo *var)
 
 	if (line_size * var->yres_virtual > max_frame_size) {
 		DBG("can't fit FB into memory, reducing x\n");
-		if (ofbi->rotation_type == OMAPFB_ROT_VRFB)
+		if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB)
 			return -EINVAL;
 
 		var->xres_virtual = max_frame_size / var->yres_virtual /
@@ -657,7 +654,7 @@ static int omapfb_setup_overlay(struct fb_info *fbi, struct omap_overlay *ovl,
 	struct omap_overlay_info info;
 	int xres, yres;
 	int screen_width;
-	int rot, mirror;
+	int mirror;
 
 	DBG("setup_overlay %d, posx %d, posy %d, outw %d, outh %d\n", ofbi->id,
 			posx, posy, outw, outh);
@@ -673,7 +670,7 @@ static int omapfb_setup_overlay(struct fb_info *fbi, struct omap_overlay *ovl,
 	offset = ((var->yoffset * var->xres_virtual +
 				var->xoffset) * var->bits_per_pixel) >> 3;
 
-	if (ofbi->rotation_type == OMAPFB_ROT_VRFB) {
+	if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB) {
 		data_start_p = omapfb_get_region_rot_paddr(ofbi);
 		data_start_v = NULL;
 	} else {
@@ -696,13 +693,10 @@ static int omapfb_setup_overlay(struct fb_info *fbi, struct omap_overlay *ovl,
 
 	ovl->get_overlay_info(ovl, &info);
 
-	if (ofbi->rotation_type == OMAPFB_ROT_VRFB) {
-		rot = 0;
+	if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB)
 		mirror = 0;
-	} else {
-		rot = ofbi->rotation;
+	else
 		mirror = ofbi->mirror;
-	}
 
 	info.paddr = data_start_p;
 	info.vaddr = data_start_v;
@@ -710,7 +704,8 @@ static int omapfb_setup_overlay(struct fb_info *fbi, struct omap_overlay *ovl,
 	info.width = xres;
 	info.height = yres;
 	info.color_mode = mode;
-	info.rotation = rot;
+	info.rotation_type = ofbi->rotation_type;
+	info.rotation = ofbi->rotation;
 	info.mirror = mirror;
 
 	info.pos_x = posx;
@@ -1106,7 +1101,7 @@ static void omapfb_free_fbmem(struct fb_info *fbi)
 	if (rg->vaddr)
 		iounmap(rg->vaddr);
 
-	if (ofbi->rotation_type == OMAPFB_ROT_VRFB) {
+	if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB) {
 		/* unmap the 0 angle rotation */
 		if (rg->vrfb.vaddr[0]) {
 			iounmap(rg->vrfb.vaddr[0]);
@@ -1166,7 +1161,7 @@ static int omapfb_alloc_fbmem(struct fb_info *fbi, unsigned long size,
 		return -ENOMEM;
 	}
 
-	if (ofbi->rotation_type != OMAPFB_ROT_VRFB) {
+	if (ofbi->rotation_type != OMAP_DSS_ROT_VRFB) {
 		vaddr = ioremap_wc(paddr, size);
 
 		if (!vaddr) {
@@ -1245,7 +1240,7 @@ static int omapfb_alloc_fbmem_display(struct fb_info *fbi, unsigned long size,
 
 		display->get_resolution(display, &w, &h);
 
-		if (ofbi->rotation_type == OMAPFB_ROT_VRFB) {
+		if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB) {
 #ifdef DEBUG
 			int oldw = w, oldh = h;
 #endif
@@ -1602,8 +1597,8 @@ static int omapfb_create_framebuffers(struct omapfb2_device *fbdev)
 		ofbi->id = i;
 
 		/* assign these early, so that fb alloc can use them */
-		ofbi->rotation_type = def_vrfb ? OMAPFB_ROT_VRFB :
-			OMAPFB_ROT_DMA;
+		ofbi->rotation_type = def_vrfb ? OMAP_DSS_ROT_VRFB :
+			OMAP_DSS_ROT_DMA;
 		ofbi->rotation = def_rotate;
 		ofbi->mirror = def_mirror;
 
diff --git a/drivers/video/omap2/omapfb/omapfb.h b/drivers/video/omap2/omapfb/omapfb.h
index 65e9e6e..88e7675 100644
--- a/drivers/video/omap2/omapfb/omapfb.h
+++ b/drivers/video/omap2/omapfb/omapfb.h
@@ -51,11 +51,6 @@ struct omapfb2_mem_region {
 	bool		map;		/* kernel mapped by the driver */
 };
 
-enum omapfb_rotation_type {
-	OMAPFB_ROT_DMA = 0,
-	OMAPFB_ROT_VRFB = 1,
-};
-
 /* appended to fb_info */
 struct omapfb_info {
 	int id;
@@ -64,7 +59,7 @@ struct omapfb_info {
 	int num_overlays;
 	struct omap_overlay *overlays[OMAPFB_MAX_OVL_PER_FB];
 	struct omapfb2_device *fbdev;
-	enum omapfb_rotation_type rotation_type;
+	enum omap_dss_rotation_type rotation_type;
 	u8 rotation;
 	bool mirror;
 };
-- 
1.6.0.3


[-- Attachment #3: 0001-DSS2-VRFB-rotation-and-mirroring-implemented.patch --]
[-- Type: application/octet-stream, Size: 8958 bytes --]

From 6fbfc5fc2291a421e1f748dfd81a7bf643e77e72 Mon Sep 17 00:00:00 2001
From: Hardik Shah <hardik.shah@ti.com>
Date: Thu, 9 Apr 2009 12:09:44 +0530
Subject: [PATCH 1/2] DSS2: VRFB rotation and mirroring implemented.

DSS2 modified to accept the rotation_type input
to get the dma or VRFB rotation.

DSS2: VRFB: Changed to pass DSS mode to vrfb_setup instead of Bpp.

VRFB size registers requires the width to be halved when the
mode is YUV or UYVY.  So modifed to pass the mode to omap_vrfb_setup
function.

Code added by Tim Yamin for few bug fixes

Signed-off-by: Tim Yamin <plasm@roo.me.uk>
Signed-off-by: Hardik Shah <hardik.shah@ti.com>
---
 arch/arm/plat-omap/include/mach/display.h |    6 ++
 arch/arm/plat-omap/include/mach/vrfb.h    |    3 +-
 arch/arm/plat-omap/vrfb.c                 |   36 +++++++++-
 drivers/video/omap2/dss/dispc.c           |  109 +++++++++++++++++++++++++++--
 drivers/video/omap2/dss/dss.h             |    1 +
 drivers/video/omap2/dss/manager.c         |    1 +
 6 files changed, 144 insertions(+), 12 deletions(-)

diff --git a/arch/arm/plat-omap/include/mach/display.h b/arch/arm/plat-omap/include/mach/display.h
index 6b702c7..b0a6272 100644
--- a/arch/arm/plat-omap/include/mach/display.h
+++ b/arch/arm/plat-omap/include/mach/display.h
@@ -341,6 +341,11 @@ enum omap_dss_overlay_managers {
 
 struct omap_overlay_manager;
 
+enum omap_dss_rotation_type {
+	OMAP_DSS_ROT_DMA = 0,
+	OMAP_DSS_ROT_VRFB = 1,
+};
+
 struct omap_overlay_info {
 	bool enabled;
 
@@ -351,6 +356,7 @@ struct omap_overlay_info {
 	u16 height;
 	enum omap_color_mode color_mode;
 	u8 rotation;
+	enum omap_dss_rotation_type rotation_type;
 	bool mirror;
 
 	u16 pos_x;
diff --git a/arch/arm/plat-omap/include/mach/vrfb.h b/arch/arm/plat-omap/include/mach/vrfb.h
index 2047862..12c7fab 100644
--- a/arch/arm/plat-omap/include/mach/vrfb.h
+++ b/arch/arm/plat-omap/include/mach/vrfb.h
@@ -24,6 +24,7 @@
 #ifndef __VRFB_H
 #define __VRFB_H
 
+#include <mach/display.h>
 #define OMAP_VRFB_LINE_LEN 2048
 
 struct vrfb
@@ -42,6 +43,6 @@ extern void omap_vrfb_adjust_size(u16 *width, u16 *height,
 		u8 bytespp);
 extern void omap_vrfb_setup(struct vrfb *vrfb, unsigned long paddr,
 		u16 width, u16 height,
-		u8 bytespp);
+		enum omap_color_mode color_mode);
 
 #endif /* __VRFB_H */
diff --git a/arch/arm/plat-omap/vrfb.c b/arch/arm/plat-omap/vrfb.c
index 7e0f8fc..e0036f7 100644
--- a/arch/arm/plat-omap/vrfb.c
+++ b/arch/arm/plat-omap/vrfb.c
@@ -5,7 +5,6 @@
 
 #include <mach/io.h>
 #include <mach/vrfb.h>
-
 /*#define DEBUG*/
 
 #ifdef DEBUG
@@ -50,19 +49,48 @@ EXPORT_SYMBOL(omap_vrfb_adjust_size);
 
 void omap_vrfb_setup(struct vrfb *vrfb, unsigned long paddr,
 		u16 width, u16 height,
-		u8 bytespp)
+		enum omap_color_mode color_mode)
 {
 	unsigned pixel_size_exp;
 	u16 vrfb_width;
 	u16 vrfb_height;
 	u8 ctx = vrfb->context;
+	u8 bytespp;
 
 	DBG("omapfb_set_vrfb(%d, %lx, %dx%d, %d)\n", ctx, paddr,
 			width, height, bytespp);
 
-	if (bytespp == 4)
+	switch (color_mode) {
+	case OMAP_DSS_COLOR_RGB16:
+	case OMAP_DSS_COLOR_ARGB16:
+		bytespp = 2;
+		break;
+
+	case OMAP_DSS_COLOR_RGB24P:
+		bytespp = 3;
+		break;
+
+	case OMAP_DSS_COLOR_RGB24U:
+	case OMAP_DSS_COLOR_ARGB32:
+	case OMAP_DSS_COLOR_RGBA32:
+	case OMAP_DSS_COLOR_RGBX32:
+	case OMAP_DSS_COLOR_YUV2:
+	case OMAP_DSS_COLOR_UYVY:
+		bytespp = 4;
+		break;
+
+	default:
+		BUG();
+		return;
+	}
+
+	if (color_mode == OMAP_DSS_COLOR_YUV2 ||
+			color_mode == OMAP_DSS_COLOR_UYVY)
+		width >>= 1;
+
+	if (bytespp == 4) {
 		pixel_size_exp = 2;
-	else if (bytespp == 2)
+	} else if (bytespp == 2)
 		pixel_size_exp = 1;
 	else
 		BUG();
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index ae7be3d..9f6c821 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -1106,7 +1106,7 @@ static void _dispc_set_rotation_attrs(enum omap_plane plane, u8 rotation,
 			case 0: vidrot = 0; break;
 			case 1: vidrot = 1; break;
 			case 2: vidrot = 2; break;
-			case 3: vidrot = 1; break;
+			case 3: vidrot = 3; break;
 			}
 		}
 
@@ -1134,7 +1134,92 @@ static s32 pixinc(int pixels, u8 ps)
 		BUG();
 }
 
-static void calc_rotation_offset(u8 rotation, bool mirror,
+static void calc_vrfb_rotation_offset(u8 rotation, bool mirror,
+		u16 screen_width,
+		u16 width, u16 height,
+		enum omap_color_mode color_mode, bool fieldmode,
+		unsigned *offset0, unsigned *offset1,
+		s32 *row_inc, s32 *pix_inc)
+{
+	u8 ps;
+
+	switch (color_mode) {
+	case OMAP_DSS_COLOR_RGB16:
+	case OMAP_DSS_COLOR_ARGB16:
+		ps = 2;
+		break;
+
+	case OMAP_DSS_COLOR_RGB24P:
+		ps = 3;
+		break;
+
+	case OMAP_DSS_COLOR_RGB24U:
+	case OMAP_DSS_COLOR_ARGB32:
+	case OMAP_DSS_COLOR_RGBA32:
+	case OMAP_DSS_COLOR_RGBX32:
+	case OMAP_DSS_COLOR_YUV2:
+	case OMAP_DSS_COLOR_UYVY:
+		ps = 4;
+		break;
+
+	default:
+		BUG();
+		return;
+	}
+
+	DSSDBG("calc_rot(%d): scrw %d, %dx%d\n", rotation, screen_width,
+			width, height);
+	switch (rotation + mirror * 4) {
+	case 0:
+	case 2:
+		/*
+		 * If the pixel format is YUV or UYVY divide the width
+		 * of the image by 2 for 0 and 180 degree rotation.
+		 */
+		if (color_mode == OMAP_DSS_COLOR_YUV2 ||
+			color_mode == OMAP_DSS_COLOR_UYVY)
+			width = width >> 1;
+	case 1:
+	case 3:
+		*offset0 = 0;
+		if (fieldmode)
+			*offset1 = screen_width * ps;
+		else
+			*offset1 = 0;
+
+		*row_inc = pixinc(1 + (screen_width - width) +
+				(fieldmode ? screen_width : 0),
+				ps);
+		*pix_inc = pixinc(1, ps);
+		break;
+
+	case 4:
+	case 6:
+		/* If the pixel format is YUV or UYVY divide the width
+		 * of the image by 2  for 0 degree and 180 degree
+		 */
+		if (color_mode == OMAP_DSS_COLOR_YUV2 ||
+			color_mode == OMAP_DSS_COLOR_UYVY)
+			width = width >> 1;
+	case 5:
+	case 7:
+		*offset0 = 0;
+		if (fieldmode)
+			*offset1 = screen_width * ps;
+		else
+			*offset1 = 0;
+		*row_inc = pixinc(1 - (screen_width + width) -
+				(fieldmode ? screen_width : 0),
+				ps);
+		*pix_inc = pixinc(1, ps);
+		break;
+
+	default:
+		BUG();
+	}
+}
+
+static void calc_dma_rotation_offset(u8 rotation, bool mirror,
 		u16 screen_width,
 		u16 width, u16 height,
 		enum omap_color_mode color_mode, bool fieldmode,
@@ -1357,6 +1442,7 @@ static int _dispc_setup_plane(enum omap_plane plane,
 		u16 out_width, u16 out_height,
 		enum omap_color_mode color_mode,
 		bool ilace,
+		enum omap_dss_rotation_type rotation_type,
 		u8 rotation, int mirror)
 {
 	const int maxdownscale = cpu_is_omap34xx() ? 4 : 2;
@@ -1463,10 +1549,16 @@ static int _dispc_setup_plane(enum omap_plane plane,
 			return -EINVAL;
 	}
 
-	calc_rotation_offset(rotation, mirror,
-			screen_width, width, frame_height, color_mode,
-			fieldmode,
-			&offset0, &offset1, &row_inc, &pix_inc);
+	if (rotation_type == OMAP_DSS_ROT_DMA)
+		calc_dma_rotation_offset(rotation, mirror,
+				screen_width, width, frame_height, color_mode,
+				fieldmode,
+				&offset0, &offset1, &row_inc, &pix_inc);
+	else
+		calc_vrfb_rotation_offset(rotation, mirror,
+				screen_width, width, frame_height, color_mode,
+				fieldmode,
+				&offset0, &offset1, &row_inc, &pix_inc);
 
 	DSSDBG("offset0 %u, offset1 %u, row_inc %d, pix_inc %d\n",
 			offset0, offset1, row_inc, pix_inc);
@@ -2879,6 +2971,7 @@ int dispc_setup_plane(enum omap_plane plane, enum omap_channel channel_out,
 		       u16 out_width, u16 out_height,
 		       enum omap_color_mode color_mode,
 		       bool ilace,
+		       enum omap_dss_rotation_type rotation_type,
 		       u8 rotation, bool mirror)
 {
 	int r = 0;
@@ -2899,6 +2992,7 @@ int dispc_setup_plane(enum omap_plane plane, enum omap_channel channel_out,
 			   width, height,
 			   out_width, out_height,
 			   color_mode, ilace,
+			   rotation_type,
 			   rotation, mirror);
 
 	enable_clocks(0);
@@ -3112,7 +3206,8 @@ void dispc_setup_partial_planes(struct omap_display *display,
 				pw, ph,
 				pow, poh,
 				pi->color_mode, 0,
-				pi->rotation, // XXX rotation probably wrong
+				pi->rotation_type,
+				pi->rotation,
 				pi->mirror);
 
 		dispc_enable_plane(ovl->id, 1);
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index 0be42b6..c722eee 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -269,6 +269,7 @@ int dispc_setup_plane(enum omap_plane plane, enum omap_channel channel_out,
 		      u16 out_width, u16 out_height,
 		      enum omap_color_mode color_mode,
 		      bool ilace,
+		      enum omap_dss_rotation_type rotation_type,
 		      u8 rotation, bool mirror);
 
 void dispc_go(enum omap_channel channel);
diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
index b0fee80..8ca0bbb 100644
--- a/drivers/video/omap2/dss/manager.c
+++ b/drivers/video/omap2/dss/manager.c
@@ -395,6 +395,7 @@ static int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
 				outh,
 				ovl->info.color_mode,
 				ilace,
+				ovl->info.rotation_type,
 				ovl->info.rotation,
 				ovl->info.mirror);
 
-- 
1.6.0.3


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: YUV rotation support for DSS2 - 2.6.29 [WAS Re: Hello Tomi Valkeinen, I have some questions about dss2 driver.]
  2009-04-13 12:05         ` Shah, Hardik
@ 2009-04-13 21:00           ` Tim Yamin
  2009-04-15  9:35             ` Shah, Hardik
  2009-04-15 10:07             ` Shah, Hardik
  0 siblings, 2 replies; 12+ messages in thread
From: Tim Yamin @ 2009-04-13 21:00 UTC (permalink / raw)
  To: Shah, Hardik
  Cc: gregoire@gentil.com, tomi.valkeinen@nokia.com,
	linux-omap@vger.kernel.org, beagleboard@googlegroups.com

[-- Attachment #1: Type: text/plain, Size: 581 bytes --]

Hi Hardik,

Thanks for fixing up the patch. I can confirm that YUV rotation is
fine and patches are ready to be merged -- although the attached fix
is needed as well for the userspace layer to know the correct row
strides when writing YUV to the framebuffer.

I'm still having VID1_FIFO_UNDERFLOW errors when I try to play rotated
video on plane 1 and plane 0 is rotated as well. Do you have any ideas
how to debug this further?

Thanks,

Tim

> Hi Tomi,
> If YUV rotation with frame buffer passes can you please review the patch and merge it to your latest.
>
> Regards,
> Hardik

[-- Attachment #2: 0001-DSS2-OMAPFB-Set-line_length-correctly-for-YUV-with.patch --]
[-- Type: text/x-patch, Size: 1918 bytes --]

From 4ba3f8b1d2feef00ac6c8de827262d255cebb185 Mon Sep 17 00:00:00 2001
From: Tim Yamin <plasm@roo.me.uk>
Date: Mon, 13 Apr 2009 13:57:42 -0700
Subject: [PATCH] DSS2: OMAPFB: Set line_length correctly for YUV with VRFB.

Signed-off-by: Tim Yamin <plasm@roo.me.uk>
---
 drivers/video/omap2/omapfb/omapfb-main.c |   30 +++++++++++++++++++++++++-----
 1 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
index 9043265..675a7c9 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -377,10 +377,19 @@ void set_fb_fix(struct fb_info *fbi)
 	fbi->screen_base = (char __iomem *)omapfb_get_region_vaddr(ofbi);
 
 	/* used by mmap in fbmem.c */
-	if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB)
-		fix->line_length =
-			(OMAP_VRFB_LINE_LEN * var->bits_per_pixel) >> 3;
-	else
+	if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB) {
+		switch (var->nonstd) {
+		case OMAPFB_COLOR_YUV422:
+		case OMAPFB_COLOR_YUY422:
+			fix->line_length =
+				(OMAP_VRFB_LINE_LEN * var->bits_per_pixel) >> 2;
+			break;
+		default:
+			fix->line_length =
+				(OMAP_VRFB_LINE_LEN * var->bits_per_pixel) >> 3;
+			break;
+		}
+	} else
 		fix->line_length =
 			(var->xres_virtual * var->bits_per_pixel) >> 3;
 	fix->smem_start = omapfb_get_region_paddr(ofbi);
@@ -689,7 +698,18 @@ static int omapfb_setup_overlay(struct fb_info *fbi, struct omap_overlay *ovl,
 		goto err;
 	}
 
-	screen_width = fix->line_length / (var->bits_per_pixel >> 3);
+	switch (var->nonstd) {
+	case OMAPFB_COLOR_YUV422:
+	case OMAPFB_COLOR_YUY422:
+		if (ofbi->rotation_type == OMAP_DSS_ROT_VRFB) {
+			screen_width = fix->line_length
+				/ (var->bits_per_pixel >> 2);
+			break;
+		}
+	default:
+		screen_width = fix->line_length / (var->bits_per_pixel >> 3);
+		break;
+	}
 
 	ovl->get_overlay_info(ovl, &info);
 
-- 
1.5.6.3


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* RE: YUV rotation support for DSS2 - 2.6.29 [WAS Re: Hello Tomi Valkeinen, I have some questions about dss2 driver.]
  2009-04-13 21:00           ` Tim Yamin
@ 2009-04-15  9:35             ` Shah, Hardik
  2009-04-16 10:06               ` Tomi Valkeinen
  2009-04-15 10:07             ` Shah, Hardik
  1 sibling, 1 reply; 12+ messages in thread
From: Shah, Hardik @ 2009-04-15  9:35 UTC (permalink / raw)
  To: Tim Yamin, tomi.valkeinen@nokia.com
  Cc: gregoire@gentil.com, linux-omap@vger.kernel.org,
	beagleboard@googlegroups.com

Hi Tomi,
Can you please merge the YUV rotation patches with your latest?

Thanks and Regards,
Haardik

> -----Original Message-----
> From: plasmaroo@gmail.com [mailto:plasmaroo@gmail.com] On Behalf Of Tim Yamin
> Sent: Tuesday, April 14, 2009 2:30 AM
> To: Shah, Hardik
> Cc: gregoire@gentil.com; tomi.valkeinen@nokia.com; linux-omap@vger.kernel.org;
> beagleboard@googlegroups.com
> Subject: Re: YUV rotation support for DSS2 - 2.6.29 [WAS Re: Hello Tomi
> Valkeinen, I have some questions about dss2 driver.]
> 
> Hi Hardik,
> 
> Thanks for fixing up the patch. I can confirm that YUV rotation is
> fine and patches are ready to be merged -- although the attached fix
> is needed as well for the userspace layer to know the correct row
> strides when writing YUV to the framebuffer.
> 
> I'm still having VID1_FIFO_UNDERFLOW errors when I try to play rotated
> video on plane 1 and plane 0 is rotated as well. Do you have any ideas
> how to debug this further?
> 
> Thanks,
> 
> Tim
> 
> > Hi Tomi,
> > If YUV rotation with frame buffer passes can you please review the patch and
> merge it to your latest.
> >
> > Regards,
> > Hardik

^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: YUV rotation support for DSS2 - 2.6.29 [WAS Re: Hello Tomi Valkeinen, I have some questions about dss2 driver.]
  2009-04-13 21:00           ` Tim Yamin
  2009-04-15  9:35             ` Shah, Hardik
@ 2009-04-15 10:07             ` Shah, Hardik
  2009-04-15 19:16               ` Tim Yamin
  1 sibling, 1 reply; 12+ messages in thread
From: Shah, Hardik @ 2009-04-15 10:07 UTC (permalink / raw)
  To: Tim Yamin
  Cc: gregoire@gentil.com, tomi.valkeinen@nokia.com,
	linux-omap@vger.kernel.org, beagleboard@googlegroups.com



> -----Original Message-----
> From: plasmaroo@gmail.com [mailto:plasmaroo@gmail.com] On Behalf Of Tim Yamin
> Sent: Tuesday, April 14, 2009 2:30 AM
> To: Shah, Hardik
> Cc: gregoire@gentil.com; tomi.valkeinen@nokia.com; linux-omap@vger.kernel.org;
> beagleboard@googlegroups.com
> Subject: Re: YUV rotation support for DSS2 - 2.6.29 [WAS Re: Hello Tomi
> Valkeinen, I have some questions about dss2 driver.]
> 
> Hi Hardik,
> 
> Thanks for fixing up the patch. I can confirm that YUV rotation is
> fine and patches are ready to be merged -- although the attached fix
> is needed as well for the userspace layer to know the correct row
> strides when writing YUV to the framebuffer.
> 
> I'm still having VID1_FIFO_UNDERFLOW errors when I try to play rotated
> video on plane 1 and plane 0 is rotated as well. Do you have any ideas
> how to debug this further?
[Shah, Hardik] Hi Tim,
Try to increase the pixel clock to functional clock ratio to 6 or 8.  This may help as you are getting under run errors.

Thanks,
Hardik 
> 
> Thanks,
> 
> Tim
> 
> > Hi Tomi,
> > If YUV rotation with frame buffer passes can you please review the patch and
> merge it to your latest.
> >
> > Regards,
> > Hardik

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: YUV rotation support for DSS2 - 2.6.29 [WAS Re: Hello Tomi Valkeinen, I have some questions about dss2 driver.]
  2009-04-15 10:07             ` Shah, Hardik
@ 2009-04-15 19:16               ` Tim Yamin
  0 siblings, 0 replies; 12+ messages in thread
From: Tim Yamin @ 2009-04-15 19:16 UTC (permalink / raw)
  To: Shah, Hardik
  Cc: gregoire@gentil.com, tomi.valkeinen@nokia.com,
	linux-omap@vger.kernel.org, beagleboard@googlegroups.com

Hi Hardik,

2009/4/15 Shah, Hardik <hardik.shah@ti.com>:
> [Shah, Hardik] Hi Tim,
> Try to increase the pixel clock to functional clock ratio to 6 or 8.  This may help as you are getting under run errors.

Thanks for the help -- so it seems that it's a clock issue. At 800x600
rotation of both planes simultaneously by 90 degrees is working just
fine. At 1024x768 it seems that it's not possible because of the
clocking: the pixel clock is 56MHz so the maximum
OMAP2_DSS_MIN_FCK_PER_PCK constant is 3, which does not seem to be
sufficient.

Cheers,

Tim
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: YUV rotation support for DSS2 - 2.6.29 [WAS Re: Hello Tomi Valkeinen, I have some questions about dss2 driver.]
  2009-04-15  9:35             ` Shah, Hardik
@ 2009-04-16 10:06               ` Tomi Valkeinen
  0 siblings, 0 replies; 12+ messages in thread
From: Tomi Valkeinen @ 2009-04-16 10:06 UTC (permalink / raw)
  To: ext Shah, Hardik
  Cc: Tim Yamin, gregoire@gentil.com, linux-omap@vger.kernel.org,
	beagleboard@googlegroups.com

Hi Hardik and Tim,

Thanks for the patches. They look fine to me, and are applied to my
tree.

 Tomi

On Wed, 2009-04-15 at 11:35 +0200, ext Shah, Hardik wrote:
> Hi Tomi,
> Can you please merge the YUV rotation patches with your latest?
> 
> Thanks and Regards,
> Haardik
> 
> > -----Original Message-----
> > From: plasmaroo@gmail.com [mailto:plasmaroo@gmail.com] On Behalf Of Tim Yamin
> > Sent: Tuesday, April 14, 2009 2:30 AM
> > To: Shah, Hardik
> > Cc: gregoire@gentil.com; tomi.valkeinen@nokia.com; linux-omap@vger.kernel.org;
> > beagleboard@googlegroups.com
> > Subject: Re: YUV rotation support for DSS2 - 2.6.29 [WAS Re: Hello Tomi
> > Valkeinen, I have some questions about dss2 driver.]
> > 
> > Hi Hardik,
> > 
> > Thanks for fixing up the patch. I can confirm that YUV rotation is
> > fine and patches are ready to be merged -- although the attached fix
> > is needed as well for the userspace layer to know the correct row
> > strides when writing YUV to the framebuffer.
> > 
> > I'm still having VID1_FIFO_UNDERFLOW errors when I try to play rotated
> > video on plane 1 and plane 0 is rotated as well. Do you have any ideas
> > how to debug this further?
> > 
> > Thanks,
> > 
> > Tim
> > 
> > > Hi Tomi,
> > > If YUV rotation with frame buffer passes can you please review the patch and
> > merge it to your latest.
> > >
> > > Regards,
> > > Hardik


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2009-04-16 10:06 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-11  4:57 Hello Tomi Valkeinen, I have some questions about dss2 driver InKi Dae
2009-03-11  5:10 ` Shah, Hardik
2009-03-11  7:47 ` Tomi Valkeinen
2009-04-07  4:30   ` YUV rotation support for DSS2 - 2.6.29 [WAS Re: Hello Tomi Valkeinen, I have some questions about dss2 driver.] Gregoire Gentil
2009-04-07  4:41     ` Shah, Hardik
2009-04-07 19:00       ` Tim Yamin
2009-04-13 12:05         ` Shah, Hardik
2009-04-13 21:00           ` Tim Yamin
2009-04-15  9:35             ` Shah, Hardik
2009-04-16 10:06               ` Tomi Valkeinen
2009-04-15 10:07             ` Shah, Hardik
2009-04-15 19:16               ` Tim Yamin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox