Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/i915: Clear the existing watermarks for g4x when modifying the cursor sr

In a couple of places we attempt to adjust the existing watermark
registers to update them for the new cursor watermarks. This goes
horribly wrong as instead of clearing the cursor bits prior to or'ing in
the new values, we clear the rest of the register with the result that
the watermark registers contain bogus values.

References: https://bugs.freedesktop.org/show_bug.cgi?id=47034
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

authored by

Chris Wilson and committed by
Daniel Vetter
8c919b28 bfd7590d

+5 -4
+5 -4
drivers/gpu/drm/i915/intel_pm.c
··· 1325 1325 (planeb_wm << DSPFW_PLANEB_SHIFT) | 1326 1326 planea_wm); 1327 1327 I915_WRITE(DSPFW2, 1328 - (I915_READ(DSPFW2) & DSPFW_CURSORA_MASK) | 1328 + (I915_READ(DSPFW2) & ~DSPFW_CURSORA_MASK) | 1329 1329 (cursora_wm << DSPFW_CURSORA_SHIFT)); 1330 1330 I915_WRITE(DSPFW3, 1331 - (I915_READ(DSPFW3) | (cursor_sr << DSPFW_CURSOR_SR_SHIFT))); 1331 + (I915_READ(DSPFW3) & ~DSPFW_CURSOR_SR_MASK) | 1332 + (cursor_sr << DSPFW_CURSOR_SR_SHIFT)); 1332 1333 } 1333 1334 1334 1335 static void g4x_update_wm(struct drm_device *dev) ··· 1375 1374 (planeb_wm << DSPFW_PLANEB_SHIFT) | 1376 1375 planea_wm); 1377 1376 I915_WRITE(DSPFW2, 1378 - (I915_READ(DSPFW2) & DSPFW_CURSORA_MASK) | 1377 + (I915_READ(DSPFW2) & ~DSPFW_CURSORA_MASK) | 1379 1378 (cursora_wm << DSPFW_CURSORA_SHIFT)); 1380 1379 /* HPLL off in SR has some issues on G4x... disable it */ 1381 1380 I915_WRITE(DSPFW3, 1382 - (I915_READ(DSPFW3) & ~DSPFW_HPLL_SR_EN) | 1381 + (I915_READ(DSPFW3) & ~(DSPFW_HPLL_SR_EN | DSPFW_CURSOR_SR_MASK)) | 1383 1382 (cursor_sr << DSPFW_CURSOR_SR_SHIFT)); 1384 1383 } 1385 1384