From 8e743ccef8f19b1226ceb8d6a5ceab65584a620d Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 13 Jun 2014 08:27:05 +0100 Subject: sna/gen8: Check for WT support before attempting to use the WT mocs 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 --- src/sna/gen6_common.h | 2 +- src/sna/gen8_render.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/sna/gen6_common.h b/src/sna/gen6_common.h index 8b60ef62..6668620b 100644 --- a/src/sna/gen6_common.h +++ b/src/sna/gen6_common.h @@ -36,7 +36,7 @@ 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, diff --git a/src/sna/gen8_render.c b/src/sna/gen8_render.c index 466fe01a..a48ccf4f 100644 --- a/src/sna/gen8_render.c +++ b/src/sna/gen8_render.c @@ -1377,7 +1377,7 @@ gen8_bind_bo(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; -- cgit v1.2.3