mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ben Widawsky <ben@bwidawsk.net>
To: Dave Airlie <airlied@redhat.com>
Cc: Keith Packard <keithp@keithp.com>,
	dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, Ben Widawsky <ben@bwidawsk.net>
Subject: [PATCH] drm/i915: iommu workaround related cleanups
Date: Tue,  1 Nov 2011 11:29:49 -0700	[thread overview]
Message-ID: <1320172189-3478-1-git-send-email-ben@bwidawsk.net> (raw)
In-Reply-To: <CAPM=9txN-YspvSERzUDjkwdciB-TwOvgHEXiAnG53PKA1PGfgQ@mail.gmail.com>

Cleanups recommended by Dave Airlie.

Cc: Keith Packard <keithp@keithp.com>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
---
 drivers/char/agp/intel-agp.h |    6 ++++++
 drivers/char/agp/intel-gtt.c |    7 ++++---
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/char/agp/intel-agp.h b/drivers/char/agp/intel-agp.h
index 5da67f1..d8fa7d6 100644
--- a/drivers/char/agp/intel-agp.h
+++ b/drivers/char/agp/intel-agp.h
@@ -238,4 +238,10 @@
 int intel_gmch_probe(struct pci_dev *pdev,
 			       struct agp_bridge_data *bridge);
 void intel_gmch_remove(struct pci_dev *pdev);
+
+#ifdef CONFIG_INTEL_IOMMU
+/* This is a special note from the iommu driver that we are mapped through it */
+extern int intel_iommu_gfx_mapped;
+#endif
+
 #endif
diff --git a/drivers/char/agp/intel-gtt.c b/drivers/char/agp/intel-gtt.c
index c92424c..11985fb 100644
--- a/drivers/char/agp/intel-gtt.c
+++ b/drivers/char/agp/intel-gtt.c
@@ -1183,14 +1183,13 @@ static void gen6_cleanup(void)
 {
 }
 
+#ifdef CONFIG_INTEL_IOMMU
 /* Certain Gen5 chipsets require require idling the GPU before
  * unmapping anything from the GTT when VT-d is enabled.
  */
 static inline int needs_idle_maps(void)
 {
-#ifdef CONFIG_INTEL_IOMMU
 	const unsigned short gpu_devid = intel_private.pcidev->device;
-	extern int intel_iommu_gfx_mapped;
 
 	/* Query intel_iommu to see if we need the workaround. Presumably that
 	 * was loaded first.
@@ -1199,9 +1198,11 @@ static inline int needs_idle_maps(void)
 	     gpu_devid == PCI_DEVICE_ID_INTEL_IRONLAKE_M_IG) &&
 	     intel_iommu_gfx_mapped)
 		return 1;
-#endif
 	return 0;
 }
+#else
+static inline bool needs_idle_maps(void) { return false; }
+#endif
 
 static int i9xx_setup(void)
 {
-- 
1.7.7.1


  reply	other threads:[~2011-11-01 18:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-28 17:56 [PATCH] agp: iommu_gfx_mapped only available if CONFIG_INTEL_IOMMU is set Keith Packard
2011-10-28 18:24 ` [Intel-gfx] " Ben Widawsky
2011-11-01 15:36 ` Dave Airlie
2011-11-01 18:29   ` Ben Widawsky [this message]
2011-11-01 21:24     ` [PATCH] drm/i915: iommu workaround related cleanups Ben Widawsky

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=1320172189-3478-1-git-send-email-ben@bwidawsk.net \
    --to=ben@bwidawsk.net \
    --cc=airlied@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=keithp@keithp.com \
    --cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®