i965: Add a cache_coherent field to brw_bo
authorMatt Turner <mattst88@gmail.com>
Thu, 18 May 2017 19:02:39 +0000 (12:02 -0700)
committerMatt Turner <mattst88@gmail.com>
Tue, 6 Jun 2017 18:47:46 +0000 (11:47 -0700)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_bufmgr.c
src/mesa/drivers/dri/i965/brw_bufmgr.h
src/mesa/drivers/dri/i965/intel_mipmap_tree.c

index 9a65d32dd0a59e89c52ceffe87bc82958424ffac..2b42182d265c8a39388dd7ada4fb7f65b5e6ace3 100644 (file)
@@ -351,6 +351,7 @@ retry:
    bo->name = name;
    p_atomic_set(&bo->refcount, 1);
    bo->reusable = true;
+   bo->cache_coherent = bufmgr->has_llc;
 
    pthread_mutex_unlock(&bufmgr->lock);
 
index 1e3e8cff456713e0d93463a33a97a5e9b9d43d7b..6ce14bbcba6702bd4169a59f01ca57c2082ec644 100644 (file)
@@ -123,6 +123,11 @@ struct brw_bo {
     * Boolean of whether this buffer can be re-used
     */
    bool reusable;
+
+   /**
+    * Boolean of whether this buffer is cache coherent
+    */
+   bool cache_coherent;
 };
 
 #define BO_ALLOC_FOR_RENDER (1<<0)
index ebf77b655018bcb9eae64cccf17e9f1f0d38f4cb..34b8651b004ff873f9bbbd0cc1200b07a80ccacb 100644 (file)
@@ -628,6 +628,9 @@ miptree_create(struct brw_context *brw,
                                   alloc_flags);
    }
 
+   if (layout_flags & MIPTREE_LAYOUT_FOR_SCANOUT)
+      mt->bo->cache_coherent = false;
+
    return mt;
 }