Skip to contentSkip to conversation

omap-sdp3430_Mirroring patch

PATCH rajesh k 1 participant 1 message Sep 12, 2008

Subsystems (3)
lore
Share & tools
lore

rajesh k

author
#0 lore raw

From: Rajesh K <[email protected]>

OMAP FBDEV:Add VRFB framebuffer mirroring support for OMAP SDP 3430

This patch Should apply on top of rotation patch to enable the mirroring feature.This patch provides mirroring support for OMAP SDP 3430. You will have to append video=omapfb:rotate=0 parameters to your u-boot arguments to get this working. This supports 0,90,180 and 270 degree mirroring.

Iqbal Shareef <[email protected]>

---
 arch/arm/plat-omap/include/mach/omapfb.h |    3 +
 drivers/video/omap/dispc.c               |   73 ++++++++++++++++++++++++++++++
 drivers/video/omap/omapfb_main.c         |   12 +++++
 3 files changed, 88 insertions(+), 0 deletions(-)
arch/arm/plat-omap/include/mach/omapfb.h +3 -0
index 6abc327..27483e8 100644
@@ -79,6 +79,7 @@
 #define OMAPFB_MEMTYPE_SDRAM		0
 #define OMAPFB_MEMTYPE_SRAM		1
 #define OMAPFB_MEMTYPE_MAX		1
+#define OMAPFBIO_MIRROR             _IOW('F', 0x21, u_int32_t)
 
 enum omapfb_color_format {
 	OMAPFB_COLOR_RGB565 = 0,
@@ -307,6 +308,8 @@ struct lcd_ctrl {
 					   int pos_x, int pos_y, int width,
 					   int height, int color_mode);
 	int		(*set_rotate)	  (int plane, int angle);
+	int             (*set_mirror)     (struct fb_info *fbi,
+						int plane, int mirror);
 	int		(*setup_mem)	  (int plane, size_t size,
 					   int mem_type, unsigned long *paddr);
 	int		(*mmap)		  (struct fb_info *info,
drivers/video/omap/dispc.c +73 -0

101 lines not on this page · raw message

drivers/video/omap/omapfb_main.c +12 -0
index 92d571c..42af550 100644
@@ -1083,6 +1083,9 @@ EXPORT_SYMBOL(omapfb_write_first_pixel);
 static int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd,
 			unsigned long arg)
 {
+	int mirroring;
+	int ret = 0;
+	void __user *argp = (void __user *)arg;
 	struct omapfb_plane_struct *plane = fbi->par;
 	struct omapfb_device	*fbdev = plane->fbdev;
 	struct fb_ops		*ops = fbi->fbops;
@@ -1107,6 +1110,15 @@ static int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd,
 		else
 			omapfb_mirror(fbi, p.mirror);
 		break;
+	case OMAPFBIO_MIRROR:
+		if (!copy_from_user(&mirroring, argp, sizeof(mirroring))) {
+			if (plane->fbdev->ctrl->set_mirror != NULL) {
+				ret = plane->fbdev->ctrl->set_mirror(fbi,
+						OMAPFB_PLANE_GFX, mirroring);
+			}
+			return ret;
+		}
+		break;
 	case OMAPFB_SYNC_GFX:
 		omapfb_sync(fbi);
 		break;
Signature · 1 line
1.5.3.2