Module Name:    src
Committed By:   riastradh
Date:           Wed Feb 25 13:35:25 UTC 2015

Modified Files:
        src/sys/external/bsd/drm2/dist/drm/i915: intel_ringbuffer.c

Log Message:
Back-port attempt [2/2] to fix i915drmkms on G4X, from Linux.

commit 95468892fdfeef6d1004b524e35957629efdbe00
Author: Chris Wilson <ch...@chris-wilson.co.uk>
Date:   Thu Aug 7 15:39:54 2014 +0100

    drm/i915: Reset the HEAD pointer for the ring after writing START

    Ville found an old w/a documented for g4x that suggested that we need to
    reset the HEAD after writing START. This is a useful fixup for some of
    the g4x ring initialisation woes, but as usual, not all.

    v2: Do the rewrite unconditionally anyway


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
    src/sys/external/bsd/drm2/dist/drm/i915/intel_ringbuffer.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/i915/intel_ringbuffer.c
diff -u src/sys/external/bsd/drm2/dist/drm/i915/intel_ringbuffer.c:1.5 src/sys/external/bsd/drm2/dist/drm/i915/intel_ringbuffer.c:1.6
--- src/sys/external/bsd/drm2/dist/drm/i915/intel_ringbuffer.c:1.5	Wed Feb 25 13:30:02 2015
+++ src/sys/external/bsd/drm2/dist/drm/i915/intel_ringbuffer.c	Wed Feb 25 13:35:25 2015
@@ -507,6 +507,14 @@ static int init_ring_common(struct intel
 	 * also enforces ordering), otherwise the hw might lose the new ring
 	 * register values. */
 	I915_WRITE_START(ring, i915_gem_obj_ggtt_offset(obj));
+
+	/* WaClearRingBufHeadRegAtInit:ctg,elk */
+	if (I915_READ_HEAD(ring))
+		DRM_DEBUG("%s initialization failed [head=%08x], fudging\n",
+			  ring->name, I915_READ_HEAD(ring));
+	I915_WRITE_HEAD(ring, 0);
+	(void)I915_READ_HEAD(ring);
+
 	I915_WRITE_CTL(ring,
 			((ring->size - PAGE_SIZE) & RING_NR_PAGES)
 			| RING_VALID);

Reply via email to