i915: report GBM_BO_MAP_CACHE_WC for scanout

If a bo has BO_USE_SCANOUT, and it is ever scanned out, the kernel
driver changes its cache level to WC.  But the change is not reflected
in the guest.  Let's be conservative and report GBM_BO_MAP_CACHE_WC when
BO_USE_SCANOUT is set.

BUG=b:323433235
TEST=Squid works properly with cross-domain on volteer

Change-Id: I9325ffc0cfef8778917e13d5021ae884ac7a6dfb
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/5255422
Reviewed-by: Dominik Behr <dbehr@chromium.org>
Tested-by: Yiwei Zhang <zzyiwei@chromium.org>
Commit-Queue: Yiwei Zhang <zzyiwei@chromium.org>
diff --git a/i915.c b/i915.c
index 39cb332..0c35c9d 100644
--- a/i915.c
+++ b/i915.c
@@ -902,11 +902,7 @@
 		}
 	}
 
-	/*
-	 * TODO This seems to work.  But perhaps better decisions based on
-	 * use_flags should be made.
-	 */
-	bo->meta.cached = i915->has_llc;
+	bo->meta.cached = i915->has_llc && !(bo->meta.use_flags & BO_USE_SCANOUT);
 
 	return 0;
 }