Bug 85576

Summary: [BDW] i915.enable_ppgtt=0 causes graphical corruption
Product: DRI Reporter: James Ausmus <james.ausmus>
Component: DRM/IntelAssignee: Intel GFX Bugs mailing list <intel-gfx-bugs>
Status: CLOSED FIXED QA Contact: Intel GFX Bugs mailing list <intel-gfx-bugs>
Severity: normal    
Priority: medium CC: intel-gfx-bugs
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
graphics corruption video
none
graphics corruption video none

Description James Ausmus 2014-10-28 22:28:31 UTC
Observed on dinq kernel (421d829 drm/i915: use intel_fb_obj() macros to assign gem objects) on multiple BDW platforms on ChromiumOS when mousing over entries in a right-click browser menu.

Video of graphics corruption attached.
Comment 1 James Ausmus 2014-10-28 22:37:10 UTC
Created attachment 108595 [details]
graphics corruption video
Comment 2 James Ausmus 2014-10-28 22:38:57 UTC
Created attachment 108596 [details]
graphics corruption video
Comment 3 Chris Wilson 2014-10-29 09:14:56 UTC
The issue is that the cache setting bits in the Global GTT PTE are ignored. At best we can throw a warning that setting i915.enable_ppgtt=0 is a bad idea, or we might be able to disable the render caches using a debug register. Fundamentally though it is a CANTFIX/WONTFIX.
Comment 4 Ville Syrjala 2014-10-29 11:20:22 UTC
(In reply to Chris Wilson from comment #3)
> The issue is that the cache setting bits in the Global GTT PTE are ignored.
> At best we can throw a warning that setting i915.enable_ppgtt=0 is a bad
> idea, or we might be able to disable the render caches using a debug
> register. Fundamentally though it is a CANTFIX/WONTFIX.

Is the problem caused by this nice piece if hardware design?
"***For GGTT, there is NO pat_sel[2:0] from the entry, so RTL will always use the value corresponding to pat_sel = 000***"

If so then I think we might need to make PAT entry 0 UC, which is a bit sad since it's the opposite of how the CPU PAT is set up, but at least it would give correct behaviour. The only concern is that all GGTT accesses will then be UC which I suppose could lead to some performance issues. But MOCS can still override it so anything that has MOCS could still get WB if needed.
Comment 5 Rodrigo Vivi 2014-10-30 21:13:12 UTC
James, could you please try this?

diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index cb7adab..a82b8a7 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -1911,7 +1911,7 @@ static void bdw_setup_private_ppat(struct drm_i915_private *dev_priv)
 {
        uint64_t pat;
 
-       pat = GEN8_PPAT(0, GEN8_PPAT_WB | GEN8_PPAT_LLC)     | /* for normal objects, no eLLC */
+       pat = GEN8_PPAT(0, GEN8_PPAT_UC)     | /* TEST for bug 85576 */
Comment 6 James Ausmus 2014-10-30 22:06:57 UTC
Yep, that fixes it!
Comment 7 Jani Nikula 2014-11-07 08:44:11 UTC
Fixed in drm-intel-fixes by

commit d6a8b72edc92471283925ceb4ba12799b67c3ff8
Author: Rodrigo Vivi <rodrigo.vivi@intel.com>
Date:   Wed Nov 5 16:56:36 2014 -0800

    drm/i915: Disable caches for Global GTT.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.