aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/intelfb
diff options
context:
space:
mode:
authorEric Hustvedt <ehustvedt@cecropia.com>2006-06-20 14:36:42 -0400
committerDave Airlie <airlied@linux.ie>2006-07-03 04:59:47 -0400
commitf80d0d23f2010b7682e06449345e8199a2b2619c (patch)
tree4562504d7d10a87a9da62bdb0098850fd1fb13c9 /drivers/video/intelfb
parent37bced38b3d09c3de7c871790eddde81a3ce57cb (diff)
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 <ehustvedt@cecropia.com>
Diffstat (limited to 'drivers/video/intelfb')
-rw-r--r--drivers/video/intelfb/intelfb.h2
-rw-r--r--drivers/video/intelfb/intelfbdrv.c2
-rw-r--r--drivers/video/intelfb/intelfbhw.c16
3 files changed, 19 insertions, 1 deletions
diff --git a/drivers/video/intelfb/intelfb.h b/drivers/video/intelfb/intelfb.h
index 65ac37071a02..abd4c5632e38 100644
--- a/drivers/video/intelfb/intelfb.h
+++ b/drivers/video/intelfb/intelfb.h
@@ -211,6 +211,8 @@ struct intelfb_heap_data {
211struct intelfb_vsync { 211struct intelfb_vsync {
212 wait_queue_head_t wait; 212 wait_queue_head_t wait;
213 unsigned int count; 213 unsigned int count;
214 int pan_display;
215 u32 pan_offset;
214}; 216};
215 217
216struct intelfb_info { 218struct intelfb_info {
diff --git a/drivers/video/intelfb/intelfbdrv.c b/drivers/video/intelfb/intelfbdrv.c
index 08f8241bb92a..9e93f820a939 100644
--- a/drivers/video/intelfb/intelfbdrv.c
+++ b/drivers/video/intelfb/intelfbdrv.c
@@ -900,6 +900,8 @@ intelfb_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent)
900 init_waitqueue_head(&dinfo->vsync.wait); 900 init_waitqueue_head(&dinfo->vsync.wait);
901 spin_lock_init(&dinfo->int_lock); 901 spin_lock_init(&dinfo->int_lock);
902 dinfo->irq_flags = 0; 902 dinfo->irq_flags = 0;
903 dinfo->vsync.pan_display = 0;
904 dinfo->vsync.pan_offset = 0;
903 905
904 return 0; 906 return 0;
905 907
diff --git a/drivers/video/intelfb/intelfbhw.c b/drivers/video/intelfb/intelfbhw.c
index 0f9631c2ad33..8038f558611d 100644
--- a/drivers/video/intelfb/intelfbhw.c
+++ b/drivers/video/intelfb/intelfbhw.c
@@ -371,7 +371,13 @@ intelfbhw_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
371 371
372 offset += dinfo->fb.offset << 12; 372 offset += dinfo->fb.offset << 12;
373 373
374 OUTREG(DSPABASE, offset); 374 dinfo->vsync.pan_offset = offset;
375 if ((var->activate & FB_ACTIVATE_VBL) && !intelfbhw_enable_irq(dinfo, 0)) {
376 dinfo->vsync.pan_display = 1;
377 } else {
378 dinfo->vsync.pan_display = 0;
379 OUTREG(DSPABASE, offset);
380 }
375 381
376 return 0; 382 return 0;
377} 383}
@@ -1965,6 +1971,10 @@ intelfbhw_irq(int irq, void *dev_id, struct pt_regs *fp) {
1965 1971
1966 if (tmp & VSYNC_PIPE_A_INTERRUPT) { 1972 if (tmp & VSYNC_PIPE_A_INTERRUPT) {
1967 dinfo->vsync.count++; 1973 dinfo->vsync.count++;
1974 if (dinfo->vsync.pan_display) {
1975 dinfo->vsync.pan_display = 0;
1976 OUTREG(DSPABASE, dinfo->vsync.pan_offset);
1977 }
1968 wake_up_interruptible(&dinfo->vsync.wait); 1978 wake_up_interruptible(&dinfo->vsync.wait);
1969 handled = 1; 1979 handled = 1;
1970 } 1980 }
@@ -2007,6 +2017,10 @@ intelfbhw_disable_irq(struct intelfb_info *dinfo) {
2007 u16 tmp; 2017 u16 tmp;
2008 2018
2009 if (test_and_clear_bit(0, &dinfo->irq_flags)) { 2019 if (test_and_clear_bit(0, &dinfo->irq_flags)) {
2020 if (dinfo->vsync.pan_display) {
2021 dinfo->vsync.pan_display = 0;
2022 OUTREG(DSPABASE, dinfo->vsync.pan_offset);
2023 }
2010 spin_lock_irq(&dinfo->int_lock); 2024 spin_lock_irq(&dinfo->int_lock);
2011 OUTREG16(HWSTAM, 0xffff); 2025 OUTREG16(HWSTAM, 0xffff);
2012 OUTREG16(IMR, 0xffff); 2026 OUTREG16(IMR, 0xffff);