From 9a5f019b1a9ea6a75ba36d7c312ff069006ed479 Mon Sep 17 00:00:00 2001 From: Eric Hustvedt Date: Tue, 20 Jun 2006 14:36:41 -0400 Subject: intelfb: add vsync interrupt support [02/05] intelfb: Add interrupt related register definitions Add constants for accessing HWSTAM, IER, IIR, and IMR registers. Add constants for interrupt types supported by the 8xx and 9xx chipsets. The registers are also stored in the hwstate struct and dumped in the debug routine. Signed-off-by: Eric Hustvedt --- drivers/video/intelfb/intelfb.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers/video/intelfb/intelfb.h') diff --git a/drivers/video/intelfb/intelfb.h b/drivers/video/intelfb/intelfb.h index e290d7460e1..cb016fe4d48 100644 --- a/drivers/video/intelfb/intelfb.h +++ b/drivers/video/intelfb/intelfb.h @@ -195,6 +195,10 @@ struct intelfb_hwstate { u32 mem_mode; u32 fw_blc_0; u32 fw_blc_1; + u16 hwstam; + u16 ier; + u16 iir; + u16 imr; }; struct intelfb_heap_data { -- cgit From 7649757bd900bc900adcd95ab08903cdc28342fa Mon Sep 17 00:00:00 2001 From: Eric Hustvedt Date: Tue, 20 Jun 2006 14:36:41 -0400 Subject: intelfb: add vsync interrupt support [03/05] intelfb: Implement basic interrupt handling Functions have been added to enable and disable interrupts using the MMIO registers. Currently only pipe A vsync interrupts are enabled. A generalized vsync accounting struct is defined, with the intent that it can encapsulate per-pipe vsync related info in the future. Currently a single instance is hard-coded. The interrupt service routine currently only looks for vsync interrupts on pipe A, and increments a counter and wakes up anyone waiting on it. This implementation is heavily influenced by similar implementations in the atyfb and matroxfb drivers. Signed-off-by: Eric Hustvedt --- drivers/video/intelfb/intelfb.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'drivers/video/intelfb/intelfb.h') diff --git a/drivers/video/intelfb/intelfb.h b/drivers/video/intelfb/intelfb.h index cb016fe4d48..dab1f2d764d 100644 --- a/drivers/video/intelfb/intelfb.h +++ b/drivers/video/intelfb/intelfb.h @@ -208,6 +208,11 @@ struct intelfb_heap_data { u32 size; // in bytes }; +struct intelfb_vsync { + wait_queue_head_t wait; + unsigned int count; +}; + struct intelfb_info { struct fb_info *info; struct fb_ops *fbops; @@ -271,6 +276,12 @@ struct intelfb_info { int fixed_mode; int ring_active; int flag; + unsigned long irq_flags; + int open; + + /* vsync */ + struct intelfb_vsync vsync; + spinlock_t int_lock; /* hw cursor */ int cursor_on; -- cgit From 37bced38b3d09c3de7c871790eddde81a3ce57cb Mon Sep 17 00:00:00 2001 From: Eric Hustvedt Date: Tue, 20 Jun 2006 14:36:42 -0400 Subject: intelfb: add vsync interrupt support [04/05] intelfb: implement FBIO_WAITFORVSYNC ioctl The (unofficial) FBIO_WAITFORVSYNC ioctl is implemented by sleeping on the appropriate waitqueue, as defined in my earlier patch. Currently, only display 0 (aka pipe A) is supported. Signed-off-by: Eric Hustvedt --- drivers/video/intelfb/intelfb.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers/video/intelfb/intelfb.h') diff --git a/drivers/video/intelfb/intelfb.h b/drivers/video/intelfb/intelfb.h index dab1f2d764d..65ac37071a0 100644 --- a/drivers/video/intelfb/intelfb.h +++ b/drivers/video/intelfb/intelfb.h @@ -304,6 +304,10 @@ struct intelfb_info { #define IS_I9XX(dinfo) (((dinfo)->chipset == INTEL_915G)||(dinfo->chipset == INTEL_915GM)||((dinfo)->chipset == INTEL_945G)||(dinfo->chipset==INTEL_945GM)) +#ifndef FBIO_WAITFORVSYNC +#define FBIO_WAITFORVSYNC _IOW('F', 0x20, __u32) +#endif + /*** function prototypes ***/ extern int intelfb_var_to_depth(const struct fb_var_screeninfo *var); -- cgit From f80d0d23f2010b7682e06449345e8199a2b2619c Mon Sep 17 00:00:00 2001 From: Eric Hustvedt Date: Tue, 20 Jun 2006 14:36:42 -0400 Subject: intelfb: add vsync interrupt support [05/05] intelfb: Honor FB_ACTIVATE_VBL for display panning Extends the intelfb_vsync struct to store panning offset. The interrupt service routine uses the stored panning offset if a pan is requested for the vsync. intelfbhw_disable_irq also pans the display if there is a pending request. Signed-off-by: Eric Hustvedt --- drivers/video/intelfb/intelfb.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/video/intelfb/intelfb.h') diff --git a/drivers/video/intelfb/intelfb.h b/drivers/video/intelfb/intelfb.h index 65ac37071a0..abd4c5632e3 100644 --- a/drivers/video/intelfb/intelfb.h +++ b/drivers/video/intelfb/intelfb.h @@ -211,6 +211,8 @@ struct intelfb_heap_data { struct intelfb_vsync { wait_queue_head_t wait; unsigned int count; + int pan_display; + u32 pan_offset; }; struct intelfb_info { -- cgit From 183b1214402a205bf6eea2030686249c7d365fd1 Mon Sep 17 00:00:00 2001 From: Dennis Munsie Date: Tue, 20 Jun 2006 14:55:55 -0400 Subject: intelfb: add preliminary i2c support [03/07] intelfb: add intelfb_i2c_chan struct. Signed-off-by: Dennis Munsie --- drivers/video/intelfb/intelfb.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'drivers/video/intelfb/intelfb.h') diff --git a/drivers/video/intelfb/intelfb.h b/drivers/video/intelfb/intelfb.h index abd4c5632e3..5a216b81aa2 100644 --- a/drivers/video/intelfb/intelfb.h +++ b/drivers/video/intelfb/intelfb.h @@ -6,6 +6,10 @@ #include #include +#ifdef CONFIG_FB_INTEL_I2C +#include +#include +#endif /*** Version/name ***/ #define INTELFB_VERSION "0.9.4" @@ -208,6 +212,15 @@ struct intelfb_heap_data { u32 size; // in bytes }; +#ifdef CONFIG_FB_INTEL_I2C +struct intelfb_i2c_chan { + struct intelfb_info *dinfo; + u32 reg; + struct i2c_adapter adapter; + struct i2c_algo_bit_data algo; +}; +#endif + struct intelfb_vsync { wait_queue_head_t wait; unsigned int count; -- cgit From 399fb4316ab4fe4c46d1e4ed8b12d56c94b4c251 Mon Sep 17 00:00:00 2001 From: Dennis Munsie Date: Tue, 20 Jun 2006 14:55:55 -0400 Subject: intelfb: add preliminary i2c support [04/07] intelfb: add intelfb_output_rec struct and the constants for it's fields. Signed-off-by: Dennis Munsie --- drivers/video/intelfb/intelfb.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'drivers/video/intelfb/intelfb.h') diff --git a/drivers/video/intelfb/intelfb.h b/drivers/video/intelfb/intelfb.h index 5a216b81aa2..179db05f195 100644 --- a/drivers/video/intelfb/intelfb.h +++ b/drivers/video/intelfb/intelfb.h @@ -119,6 +119,24 @@ /* Intel agpgart driver */ #define AGP_PHYSICAL_MEMORY 2 +/* these are outputs from the chip - integrated only + external chips are via DVO or SDVO output */ +#define INTELFB_OUTPUT_UNUSED 0 +#define INTELFB_OUTPUT_ANALOG 1 +#define INTELFB_OUTPUT_DVO 2 +#define INTELFB_OUTPUT_SDVO 3 +#define INTELFB_OUTPUT_LVDS 4 +#define INTELFB_OUTPUT_TVOUT 5 + +#define INTELFB_DVO_CHIP_NONE 0 +#define INTELFB_DVO_CHIP_LVDS 1 +#define INTELFB_DVO_CHIP_TMDS 2 +#define INTELFB_DVO_CHIP_TVOUT 4 + +#define INTELFB_OUTPUT_PIPE_NC 0 +#define INTELFB_OUTPUT_PIPE_A 1 +#define INTELFB_OUTPUT_PIPE_B 2 + /*** Data Types ***/ /* supported chipsets */ @@ -221,6 +239,17 @@ struct intelfb_i2c_chan { }; #endif +struct intelfb_output_rec { + int type; + int pipe; + int flags; + +#ifdef CONFIG_FB_INTEL_I2C + struct intelfb_i2c_chan i2c_bus; + struct intelfb_i2c_chan ddc_bus; +#endif +}; + struct intelfb_vsync { wait_queue_head_t wait; unsigned int count; -- cgit From dd696ec852dc34c40e2a18cc426c8f462c0715a5 Mon Sep 17 00:00:00 2001 From: Dennis Munsie Date: Tue, 20 Jun 2006 14:55:55 -0400 Subject: intelfb: add preliminary i2c support [05/07] intelfb: add output fields to dinfo. Signed-off-by: Dennis Munsie --- drivers/video/intelfb/intelfb.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'drivers/video/intelfb/intelfb.h') diff --git a/drivers/video/intelfb/intelfb.h b/drivers/video/intelfb/intelfb.h index 179db05f195..9092bda9d4b 100644 --- a/drivers/video/intelfb/intelfb.h +++ b/drivers/video/intelfb/intelfb.h @@ -119,6 +119,11 @@ /* Intel agpgart driver */ #define AGP_PHYSICAL_MEMORY 2 +/* store information about an Ixxx DVO */ +/* The i830->i865 use multiple DVOs with multiple i2cs */ +/* the i915, i945 have a single sDVO i2c bus - which is different */ +#define MAX_OUTPUTS 6 + /* these are outputs from the chip - integrated only external chips are via DVO or SDVO output */ #define INTELFB_OUTPUT_UNUSED 0 @@ -344,6 +349,10 @@ struct intelfb_info { /* index into plls */ int pll_index; + + /* outputs */ + int num_outputs; + struct intelfb_output_rec output[MAX_OUTPUTS]; }; #define IS_I9XX(dinfo) (((dinfo)->chipset == INTEL_915G)||(dinfo->chipset == INTEL_915GM)||((dinfo)->chipset == INTEL_945G)||(dinfo->chipset==INTEL_945GM)) -- cgit From 41c9480a1d22e8f28b8675a2d7ec7fd4c50bc900 Mon Sep 17 00:00:00 2001 From: Dennis Munsie Date: Tue, 20 Jun 2006 14:55:55 -0400 Subject: intelfb: add preliminary i2c support [06/07] intelfb: adds intelfb_i2c.c which contains the infrastructure needed to enumerate the i2c busses on the intelfb. Signed-off-by: Dennis Munsie --- drivers/video/intelfb/intelfb.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers/video/intelfb/intelfb.h') diff --git a/drivers/video/intelfb/intelfb.h b/drivers/video/intelfb/intelfb.h index 9092bda9d4b..6ef38c90c4d 100644 --- a/drivers/video/intelfb/intelfb.h +++ b/drivers/video/intelfb/intelfb.h @@ -365,4 +365,8 @@ struct intelfb_info { extern int intelfb_var_to_depth(const struct fb_var_screeninfo *var); +#ifdef CONFIG_FB_INTEL_I2C +extern void intelfb_create_i2c_busses(struct intelfb_info *dinfo); +#endif + #endif /* _INTELFB_H */ -- cgit From 7627899b11ece118b46fbf652e944f9a239f6cd1 Mon Sep 17 00:00:00 2001 From: Dennis Munsie Date: Tue, 20 Jun 2006 14:55:55 -0400 Subject: intelfb: add preliminary i2c support Adds code to unregister the I2C buses in the cleanup function. Signed-off-by: Dennis Munsie --- drivers/video/intelfb/intelfb.h | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/video/intelfb/intelfb.h') diff --git a/drivers/video/intelfb/intelfb.h b/drivers/video/intelfb/intelfb.h index 6ef38c90c4d..abdadc2a1b4 100644 --- a/drivers/video/intelfb/intelfb.h +++ b/drivers/video/intelfb/intelfb.h @@ -367,6 +367,7 @@ extern int intelfb_var_to_depth(const struct fb_var_screeninfo *var); #ifdef CONFIG_FB_INTEL_I2C extern void intelfb_create_i2c_busses(struct intelfb_info *dinfo); +extern void intelfb_delete_i2c_busses(struct intelfb_info *dinfo); #endif #endif /* _INTELFB_H */ -- cgit From d5afabcea215a828eb00df992b429486aae14c2f Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 22 Aug 2006 10:10:56 +1000 Subject: intelfb: fix mtrr_reg signedness This is my fix for gcc 4.1 sign issue reported by Eric Sesterhenn . Signed-off-by: Dave Airlie --- drivers/video/intelfb/intelfb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/video/intelfb/intelfb.h') diff --git a/drivers/video/intelfb/intelfb.h b/drivers/video/intelfb/intelfb.h index abdadc2a1b4..80b94c19a9f 100644 --- a/drivers/video/intelfb/intelfb.h +++ b/drivers/video/intelfb/intelfb.h @@ -278,7 +278,7 @@ struct intelfb_info { u8 fbmem_gart; /* mtrr support */ - u32 mtrr_reg; + int mtrr_reg; u32 has_mtrr; /* heap data */ -- cgit