[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>
struct intelfb_vsync {
wait_queue_head_t wait;
unsigned int count;
struct intelfb_vsync {
wait_queue_head_t wait;
unsigned int count;
+ int pan_display;
+ u32 pan_offset;
init_waitqueue_head(&dinfo->vsync.wait);
spin_lock_init(&dinfo->int_lock);
dinfo->irq_flags = 0;
init_waitqueue_head(&dinfo->vsync.wait);
spin_lock_init(&dinfo->int_lock);
dinfo->irq_flags = 0;
+ dinfo->vsync.pan_display = 0;
+ dinfo->vsync.pan_offset = 0;
offset += dinfo->fb.offset << 12;
offset += dinfo->fb.offset << 12;
- OUTREG(DSPABASE, offset);
+ dinfo->vsync.pan_offset = offset;
+ if ((var->activate & FB_ACTIVATE_VBL) && !intelfbhw_enable_irq(dinfo, 0)) {
+ dinfo->vsync.pan_display = 1;
+ } else {
+ dinfo->vsync.pan_display = 0;
+ OUTREG(DSPABASE, offset);
+ }
if (tmp & VSYNC_PIPE_A_INTERRUPT) {
dinfo->vsync.count++;
if (tmp & VSYNC_PIPE_A_INTERRUPT) {
dinfo->vsync.count++;
+ if (dinfo->vsync.pan_display) {
+ dinfo->vsync.pan_display = 0;
+ OUTREG(DSPABASE, dinfo->vsync.pan_offset);
+ }
wake_up_interruptible(&dinfo->vsync.wait);
handled = 1;
}
wake_up_interruptible(&dinfo->vsync.wait);
handled = 1;
}
u16 tmp;
if (test_and_clear_bit(0, &dinfo->irq_flags)) {
u16 tmp;
if (test_and_clear_bit(0, &dinfo->irq_flags)) {
+ if (dinfo->vsync.pan_display) {
+ dinfo->vsync.pan_display = 0;
+ OUTREG(DSPABASE, dinfo->vsync.pan_offset);
+ }
spin_lock_irq(&dinfo->int_lock);
OUTREG16(HWSTAM, 0xffff);
OUTREG16(IMR, 0xffff);
spin_lock_irq(&dinfo->int_lock);
OUTREG16(HWSTAM, 0xffff);
OUTREG16(IMR, 0xffff);