]> git.karo-electronics.de Git - linux-beck.git/commitdiff
drm/i915: Introduce intel_uncore_unclaimed_mmio
authorMika Kuoppala <mika.kuoppala@linux.intel.com>
Tue, 15 Dec 2015 14:25:07 +0000 (16:25 +0200)
committerMika Kuoppala <mika.kuoppala@intel.com>
Fri, 8 Jan 2016 11:09:18 +0000 (13:09 +0200)
Currently interrupt code is the only place checking
for the unclaimed register access prior to actual register
macros using the same functionality. Rename the function
and make it return bool so that the possible error message
context is clear in the caller side. The motivation is to allow
usage of unclaimed detection on arbitrary places.

v2: rebase, s/access/mmio, s/dev/dev_priv

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1450189512-30360-2-git-send-email-mika.kuoppala@intel.com
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_irq.c
drivers/gpu/drm/i915/intel_uncore.c

index 8cf655c6fc0335522c50b5c9f930051864255ddc..aa32e8872a95dae9956d458e5efe422fcf0c639c 100644 (file)
@@ -2717,7 +2717,7 @@ extern void intel_uncore_sanitize(struct drm_device *dev);
 extern void intel_uncore_early_sanitize(struct drm_device *dev,
                                        bool restore_forcewake);
 extern void intel_uncore_init(struct drm_device *dev);
-extern void intel_uncore_check_errors(struct drm_device *dev);
+extern bool intel_uncore_unclaimed_mmio(struct drm_i915_private *dev_priv);
 extern void intel_uncore_fini(struct drm_device *dev);
 extern void intel_uncore_forcewake_reset(struct drm_device *dev, bool restore);
 const char *intel_uncore_forcewake_domain_to_str(const enum forcewake_domain_id id);
index b775decf9d27342c49fbd4c9f09e379b93a84b97..e7e44a9729058f7412a02384b598c98bb1525119 100644 (file)
@@ -2190,7 +2190,8 @@ static irqreturn_t ironlake_irq_handler(int irq, void *arg)
 
        /* We get interrupts on unclaimed registers, so check for this before we
         * do any I915_{READ,WRITE}. */
-       intel_uncore_check_errors(dev);
+       if (intel_uncore_unclaimed_mmio(dev_priv))
+               DRM_ERROR("Unclaimed register before interrupt\n");
 
        /* disable master interrupt before clearing iir  */
        de_ier = I915_READ(DEIER);
index 358cb9cb219e7fd6536b164f0fcd434c9545e6b0..7ab5916f90ddcd7ebeb07ae41a219872104836cd 100644 (file)
@@ -1596,8 +1596,7 @@ bool intel_has_gpu_reset(struct drm_device *dev)
        return intel_get_gpu_reset(dev) != NULL;
 }
 
-void intel_uncore_check_errors(struct drm_device *dev)
+bool intel_uncore_unclaimed_mmio(struct drm_i915_private *dev_priv)
 {
-       if (check_for_unclaimed_mmio(to_i915(dev)))
-               DRM_ERROR("Unclaimed register before interrupt\n");
+       return check_for_unclaimed_mmio(dev_priv);
 }