Skip to contentSkip to conversation

omapfb vsync support

PATCH New Brian Swetland 1 participant 1 message Feb 27, 2006 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 omapfb vsync support

Here's a patch that provides the FBIO_WAITFORVSYNC ioctl (same one used by the ati and nvidia drivers) to the omapfb driver. We could use the omap-specific ioctl, but it seemed to make more sense to use an existing one. Opinions?

Brian

drivers/video/omap/lcdc.c +25 -0
diff -u linux-omap-2.6/drivers/video/omap/lcdc.c linux-omap-work/drivers/video/omap/lcdc.c
@@ -294,6 +294,12 @@
 		}
 	}
 
+	if (status & OMAP_LCDC_STAT_VSYNC) {
+		struct omapfb_device* fbdev = (struct omapfb_device*)dev_id;
+		fbdev->vblank.count++;
+		wake_up_interruptible(&fbdev->vblank.wait);
+	}
+	
 	/* Clear these interrupt status bits.
 	 * Sync_lost, FUF bits were cleared by disabling the LCD controller
 	 * LOADED_PALETTE can be cleared this way only in palette only
@@ -899,6 +905,22 @@
 	clk_put(omap_lcdc.lcd_ck);
 }
 
+static void omap_lcdc_enable_vsync_irq(void)
+{
+	if (!(omap_lcdc.irq_mask & OMAP_LCDC_IRQ_VSYNC)) {
+		enable_irqs(OMAP_LCDC_IRQ_VSYNC);
+		enable_controller();
+	}
+}
+
+static void omap_lcdc_disable_vsync_irq(void)
+{
+	if (omap_lcdc.irq_mask & OMAP_LCDC_IRQ_VSYNC) {
+		disable_irqs(OMAP_LCDC_IRQ_VSYNC);
+		enable_controller();
+	}
+}
+
 struct lcd_ctrl omap1_int_ctrl = {
 	.name			= "internal",
 	.init			= omap_lcdc_init,
@@ -913,6 +935,9 @@
 	.setup_plane		= omap_lcdc_setup_plane,
 	.enable_plane		= omap_lcdc_enable_plane,
 	.setcolreg		= omap_lcdc_setcolreg,
+	.set_color_key		= NULL,
+	.enable_vsync_irq	= omap_lcdc_enable_vsync_irq,
+	.disable_vsync_irq	= omap_lcdc_disable_vsync_irq
 };
 
 MODULE_DESCRIPTION("TI OMAP LCDC controller");
drivers/video/omap/omapfb_main.c +43 -0

73 lines not on this page · raw message

include/asm-arm/arch-omap/omapfb.h +10 -0
diff -u linux-omap-2.6/include/asm-arm/arch-omap/omapfb.h linux-omap-work/include/asm-arm/arch-omap/omapfb.h
@@ -139,6 +139,7 @@
 #define OMAP_LCDC_SIGNAL_MASK		0x003f
 
 #define OMAP_LCDC_PANEL_TFT		0x0100
+#define OMAP_LCDC_PANEL_INIT_AFTER_LCDC 0x0200
 
 #ifdef CONFIG_ARCH_OMAP1
 #define OMAPFB_PLANE_NUM		1
@@ -257,6 +258,8 @@
 					   int update_hw_mem);
 	int		(*set_color_key)  (struct omapfb_color_key *ck);
 
+	void		(*enable_vsync_irq)(void);
+	void		(*disable_vsync_irq)(void);
 };
 
 enum omapfb_state {
@@ -265,6 +268,11 @@
 	OMAPFB_ACTIVE	= 100
 };
 
+struct omap_interrupt {
+	wait_queue_head_t	wait;
+	unsigned int		count;
+};
+
 struct omapfb_device {
 	int			state;
 	int                     ext_lcdc;               /* Using external
@@ -287,6 +295,8 @@
 							   interface */
 	struct fb_info		*fb_info;
 
+	struct omap_interrupt vblank;
+
 	struct device		*dev;
 };