All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel.vetter@ffwll.ch>
To: intel-gfx@lists.freedesktop.org
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Subject: [PATCH 4/4] agp/intel-gtt: extract mch buffer flush in i830 chipset flush
Date: Sun,  9 May 2010 13:41:26 +0200	[thread overview]
Message-ID: <1273405286-3560-5-git-send-email-daniel.vetter@ffwll.ch> (raw)
In-Reply-To: <1273405286-3560-1-git-send-email-daniel.vetter@ffwll.ch>

Just a small clean up. The real fix will add tons of code here,
so it's nice to shrink the function a tad bit, first.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/char/agp/intel-gtt.c |   24 ++++++++++++++++--------
 1 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/drivers/char/agp/intel-gtt.c b/drivers/char/agp/intel-gtt.c
index bed0ed6..0277314 100644
--- a/drivers/char/agp/intel-gtt.c
+++ b/drivers/char/agp/intel-gtt.c
@@ -808,6 +808,20 @@ setup:
 	intel_private.i8xx_cache_flush_num = 0;
 }
 
+static void intel_flush_mch_write_buffer(void)
+{
+	memset(intel_private.i8xx_cpu_flush_page, 0,
+	       I830_MCH_WRITE_BUFFER_SIZE);
+
+	mb();
+	if (cpu_has_clflush) {
+		clflush_cache_range(intel_private.i8xx_cpu_flush_page,
+				    I830_MCH_WRITE_BUFFER_SIZE);
+	} else if (wbinvd_on_all_cpus() != 0)
+		printk(KERN_ERR "Timed out waiting for cache flush.\n");
+	mb();
+}
+
 /* The chipset_flush interface needs to get data that has already been
  * flushed out of the CPU all the way out to main memory, because the GPU
  * doesn't snoop those buffers.
@@ -846,14 +860,8 @@ static void intel_i830_chipset_flush(struct agp_bridge_data *bridge)
 			intel_private.i8xx_gtt_cc_pages + offset1);
 	mb();
 
-	memset(intel_private.i8xx_cpu_flush_page, 0,
-	       I830_MCH_WRITE_BUFFER_SIZE);
-
-	if (cpu_has_clflush) {
-		clflush_cache_range(intel_private.i8xx_cpu_flush_page,
-				    I830_MCH_WRITE_BUFFER_SIZE);
-	} else if (wbinvd_on_all_cpus() != 0)
-		printk(KERN_ERR "Timed out waiting for cache flush.\n");
+	/* start chipset flush */
+	intel_flush_mch_write_buffer();
 
 	/* read check values */
 	mb();
-- 
1.7.1

      parent reply	other threads:[~2010-05-09 11:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-09 11:41 [PATCH 0/4] gtt cache coherency checker for i830 class hw Daniel Vetter
2010-05-09 11:41 ` [PATCH 1/4] agp/intel-gtt: steal the last gtt page Daniel Vetter
2010-05-09 11:41 ` [PATCH 2/4] drm/i915: add locking around chipset flush Daniel Vetter
2010-05-09 11:41 ` [PATCH 3/4] agp/intel-gtt: check cache-coherency on i830 class chipsets Daniel Vetter
2010-05-09 11:41 ` Daniel Vetter [this message]

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=1273405286-3560-5-git-send-email-daniel.vetter@ffwll.ch \
    --to=daniel.vetter@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.