Re: [PATCH] drm/i915: bdw expands ACTHD to 64bit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 03/19/2014 09:54 PM, Chris Wilson wrote:
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index 7a01911c16f8..a6ceb2c6f36d 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -417,13 +417,19 @@ static void ring_write_tail(struct intel_ring_buffer *ring,
  	I915_WRITE_TAIL(ring, value);
  }

-u32 intel_ring_get_active_head(struct intel_ring_buffer *ring)
+u64 intel_ring_get_active_head(struct intel_ring_buffer *ring)
  {
  	drm_i915_private_t *dev_priv = ring->dev->dev_private;
-	u32 acthd_reg = INTEL_INFO(ring->dev)->gen >= 4 ?
-			RING_ACTHD(ring->mmio_base) : ACTHD;

-	return I915_READ(acthd_reg);
+	u32 reg = (INTEL_INFO(ring->dev)->gen >= 4 ?
+		   RING_ACTHD(ring->mmio_base) : ACTHD);
+	u64 acthd;
+
+	acthd = I915_READ(reg);
+	if (INTEL_INFO(ring->dev)->gen >= 8)
+		acthd |= (u64)I915_READ(RING_ACTHD_UDW(ring->mmio_base)) << 32;
+
+	return acthd;
  }

Can it happen, and does anyone care, for a low dword to wrap so instead of say, 0x00010000, this function falsely returns 0x0001ffff ?

Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux