It appears the kernel has a better idea when WT is supported on which
gen8 parts. I assumed it was always supported, but experience suggests
otherwise, so only use WT support when advertised.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79967
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
static inline bool is_uncached(struct sna *sna,
struct kgem_bo *bo)
{
- return bo->scanout && !sna->kgem.has_wt;
+ return bo->io || (bo->scanout && !sna->kgem.has_wt);
}
inline static bool can_switch_to_blt(struct sna *sna,
domains = I915_GEM_DOMAIN_RENDER << 16 |I915_GEM_DOMAIN_RENDER;
} else
domains = I915_GEM_DOMAIN_SAMPLER << 16;
- ss[1] = bo->io ? 0 : is_scanout ? (MOCS_WT | MOCS_ALL_CACHES) << 24 : (MOCS_WB | MOCS_ALL_CACHES) << 24;
+ ss[1] = is_uncached(sna, bo) ? 0 : is_scanout ? (MOCS_WT | MOCS_ALL_CACHES) << 24 : (MOCS_WB | MOCS_ALL_CACHES) << 24;
ss[2] = ((width - 1) << SURFACE_WIDTH_SHIFT |
(height - 1) << SURFACE_HEIGHT_SHIFT);
ss[3] = (bo->pitch - 1) << SURFACE_PITCH_SHIFT;