Merge branch 'drm-intel-next' of git://people.freedesktop.org/~keithp/linux into...
[firefly-linux-kernel-4.4.55.git] / drivers / gpu / drm / i915 / i915_irq.c
index b40004b559771dc0244814335d44fb1537625087..58493114c942a0459c3de7ab48bb16af8a1ace84 100644 (file)
@@ -1205,7 +1205,7 @@ static void i915_pageflip_stall_check(struct drm_device *dev, int pipe)
        } else {
                int dspaddr = DSPADDR(intel_crtc->plane);
                stall_detected = I915_READ(dspaddr) == (obj->gtt_offset +
-                                                       crtc->y * crtc->fb->pitch +
+                                                       crtc->y * crtc->fb->pitches[0] +
                                                        crtc->x * crtc->fb->bits_per_pixel/8);
        }
 
@@ -1669,7 +1669,7 @@ void i915_hangcheck_elapsed(unsigned long data)
 {
        struct drm_device *dev = (struct drm_device *)data;
        drm_i915_private_t *dev_priv = dev->dev_private;
-       uint32_t acthd, instdone, instdone1;
+       uint32_t acthd, instdone, instdone1, acthd_bsd, acthd_blt;
        bool err = false;
 
        if (!i915_enable_hangcheck)
@@ -1686,16 +1686,21 @@ void i915_hangcheck_elapsed(unsigned long data)
        }
 
        if (INTEL_INFO(dev)->gen < 4) {
-               acthd = I915_READ(ACTHD);
                instdone = I915_READ(INSTDONE);
                instdone1 = 0;
        } else {
-               acthd = I915_READ(ACTHD_I965);
                instdone = I915_READ(INSTDONE_I965);
                instdone1 = I915_READ(INSTDONE1);
        }
+       acthd = intel_ring_get_active_head(&dev_priv->ring[RCS]);
+       acthd_bsd = HAS_BSD(dev) ?
+               intel_ring_get_active_head(&dev_priv->ring[VCS]) : 0;
+       acthd_blt = HAS_BLT(dev) ?
+               intel_ring_get_active_head(&dev_priv->ring[BCS]) : 0;
 
        if (dev_priv->last_acthd == acthd &&
+           dev_priv->last_acthd_bsd == acthd_bsd &&
+           dev_priv->last_acthd_blt == acthd_blt &&
            dev_priv->last_instdone == instdone &&
            dev_priv->last_instdone1 == instdone1) {
                if (dev_priv->hangcheck_count++ > 1) {
@@ -1727,6 +1732,8 @@ void i915_hangcheck_elapsed(unsigned long data)
                dev_priv->hangcheck_count = 0;
 
                dev_priv->last_acthd = acthd;
+               dev_priv->last_acthd_bsd = acthd_bsd;
+               dev_priv->last_acthd_blt = acthd_blt;
                dev_priv->last_instdone = instdone;
                dev_priv->last_instdone1 = instdone1;
        }