[Mesa-dev] [PATCH v15 01/16] i965: Support images with offset aux buffers

Daniel Stone daniels at collabora.com
Tue Jun 6 17:20:09 UTC 2017


From: Ben Widawsky <ben at bwidawsk.net>

Previously our aux buffers (MCS, and HiZ) never had an offset because
they were in their own buffer object. When using the CCS lossless
compression feature, it's desirable to store the data at an offset from
the main framebuffer, ie. share a buffer object. This patch just makes
having an aux offset possible.

Signed-off-by: Ben Widawsky <ben at bwidawsk.net>
Acked-by: Daniel Stone <daniels at collabora.com>
Signed-off-by: Daniel Stone <daniels at collabora.com>
---
 src/mesa/drivers/dri/i965/intel_image.h  | 3 +++
 src/mesa/drivers/dri/i965/intel_screen.c | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/intel_image.h b/src/mesa/drivers/dri/i965/intel_image.h
index cf0610540f..45f1a51827 100644
--- a/src/mesa/drivers/dri/i965/intel_image.h
+++ b/src/mesa/drivers/dri/i965/intel_image.h
@@ -92,6 +92,9 @@ struct __DRIimageRec {
    /** The image was created with EGL_EXT_image_dma_buf_import. */
    bool dma_buf_imported;
 
+   /** The image has some ancillary data associated with it at offset. */
+   uint32_t aux_offset;
+
    /**
     * Provided by EGL_EXT_image_dma_buf_import.
     * \{
diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c
index 10835f991a..9bc0895f39 100644
--- a/src/mesa/drivers/dri/i965/intel_screen.c
+++ b/src/mesa/drivers/dri/i965/intel_screen.c
@@ -690,6 +690,8 @@ intel_create_image_common(__DRIscreen *dri_screen,
    image->height = height;
    image->modifier = modifier;
 
+   image->aux_offset = 0; /* y_tiled_height * pitch */
+
    return image;
 }
 
-- 
2.13.0



More information about the mesa-dev mailing list