linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: dmunsie@cecropia.com (Dennis Munsie)
To: linux-fbdev-devel@lists.sourceforge.net
Subject: [PATCH 2.6.17-rc6-mm2 5/5] intelfb: RESEND - add vsync interrupt support
Date: Tue, 20 Jun 2006 14:31:38 -0400 (EDT)	[thread overview]
Message-ID: <20060620183138.3332290CE14@xenon> (raw)

From: Eric Hustvedt <ehustvedt@cecropia.com>

[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>
---

 drivers/video/intelfb/intelfb.h    |    2 ++
 drivers/video/intelfb/intelfbdrv.c |    2 ++
 drivers/video/intelfb/intelfbhw.c  |   16 +++++++++++++++-
 3 files changed, 19 insertions(+), 1 deletion(-)

diff -X linux-2.6.17-rc4-vsyncwait/Documentation/dontdiff -Naurp linux-2.6.17-rc4-vsyncwait/drivers/video/intelfb/intelfb.h linux-2.6.17-rc4-panning/drivers/video/intelfb/intelfb.h
--- linux-2.6.17-rc4-vsyncwait/drivers/video/intelfb/intelfb.h	2006-06-09 10:41:06.000000000 -0600
+++ linux-2.6.17-rc4-panning/drivers/video/intelfb/intelfb.h	2006-06-09 11:06:08.000000000 -0600
@@ -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 {
diff -X linux-2.6.17-rc4-vsyncwait/Documentation/dontdiff -Naurp linux-2.6.17-rc4-vsyncwait/drivers/video/intelfb/intelfbdrv.c linux-2.6.17-rc4-panning/drivers/video/intelfb/intelfbdrv.c
--- linux-2.6.17-rc4-vsyncwait/drivers/video/intelfb/intelfbdrv.c	2006-06-09 10:45:10.000000000 -0600
+++ linux-2.6.17-rc4-panning/drivers/video/intelfb/intelfbdrv.c	2006-06-09 11:08:22.000000000 -0600
@@ -900,6 +900,8 @@ intelfb_pci_register(struct pci_dev *pde
 	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;
 
 	return 0;
 
diff -X linux-2.6.17-rc4-vsyncwait/Documentation/dontdiff -Naurp linux-2.6.17-rc4-vsyncwait/drivers/video/intelfb/intelfbhw.c linux-2.6.17-rc4-panning/drivers/video/intelfb/intelfbhw.c
--- linux-2.6.17-rc4-vsyncwait/drivers/video/intelfb/intelfbhw.c	2006-06-09 10:48:26.000000000 -0600
+++ linux-2.6.17-rc4-panning/drivers/video/intelfb/intelfbhw.c	2006-06-09 11:12:34.000000000 -0600
@@ -371,7 +371,13 @@ intelfbhw_pan_display(struct fb_var_scre
 
 	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);
+	}
 
 	return 0;
 }
@@ -2013,6 +2019,10 @@ intelfbhw_irq(int irq, void *dev_id, str
 
 	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;
 	}
@@ -2055,6 +2065,10 @@ intelfbhw_disable_irq(struct intelfb_inf
 	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);

                 reply	other threads:[~2006-06-20 18:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060620183138.3332290CE14@xenon \
    --to=dmunsie@cecropia.com \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).