[Mesa-dev] [PATCH v14 21/36] i965: add a no_aux field to identify buffers without aux data

Varad Gautam varadgautam at gmail.com
Tue May 30 11:53:54 UTC 2017


From: Varad Gautam <varad.gautam at collabora.com>

v2: split this into a separate patch (Jason)

Signed-off-by: Ben Widawsky <ben at bwidawsk.net>
Signed-off-by: Daniel Stone <daniels at collabora.com>
Cc: Jason Ekstrand <jason at jlekstrand.net>
---
 src/mesa/drivers/dri/i965/brw_context.c       | 3 +++
 src/mesa/drivers/dri/i965/intel_fbo.h         | 7 +++++++
 src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 3 ++-
 3 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index c815a04..e2fd7b8 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -1720,6 +1720,9 @@ intel_update_image_buffer(struct brw_context *intel,
    if (last_mt && last_mt->bo == buffer->bo)
       return;
 
+   if (!buffer->aux_offset)
+      rb->no_aux = true;
+
    intel_update_winsys_renderbuffer_miptree(intel, rb, buffer->bo,
                                             buffer->width, buffer->height,
                                             buffer->pitch);
diff --git a/src/mesa/drivers/dri/i965/intel_fbo.h b/src/mesa/drivers/dri/i965/intel_fbo.h
index 08b82e8..9265aab 100644
--- a/src/mesa/drivers/dri/i965/intel_fbo.h
+++ b/src/mesa/drivers/dri/i965/intel_fbo.h
@@ -111,6 +111,13 @@ struct intel_renderbuffer
     * for the duration of a mapping.
     */
    bool singlesample_mt_is_tmp;
+
+   /**
+    * Set to true if this buffer definitely does not have auxiliary data, like
+    * CCS, associated with it. It's generally to be used when importing a
+    * DRIimage, where that DRIimage had no modifier.
+    */
+   bool no_aux;
 };
 
 
diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
index 2e3225e..ce62b9a 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -898,7 +898,8 @@ intel_update_winsys_renderbuffer_miptree(struct brw_context *intel,
                                                  height,
                                                  1,
                                                  pitch,
-                                                 MIPTREE_LAYOUT_FOR_SCANOUT);
+                                                 MIPTREE_LAYOUT_FOR_SCANOUT |
+                                                 irb->no_aux ? MIPTREE_LAYOUT_DISABLE_AUX: 0);
    if (!singlesample_mt)
       goto fail;
 
-- 
2.10.0



More information about the mesa-dev mailing list