[Mesa-dev] [PATCH 17/32] i965: Support images with offset aux buffers

Ben Widawsky ben at bwidawsk.net
Tue Jan 3 02:37:08 UTC 2017


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>
---
 src/mesa/drivers/dri/i965/intel_image.h  | 3 +++
 src/mesa/drivers/dri/i965/intel_screen.c | 5 +++++
 2 files changed, 8 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/intel_image.h b/src/mesa/drivers/dri/i965/intel_image.h
index bbda95282c..7b3c624e2f 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 df5d69834f..394816eb57 100644
--- a/src/mesa/drivers/dri/i965/intel_screen.c
+++ b/src/mesa/drivers/dri/i965/intel_screen.c
@@ -575,6 +575,11 @@ create_image_with_modifier(struct intel_screen *screen,
    image->tile_y = I915_TILING_Y;
    image->modifier = modifier;
 
+   if (image->planar_format)
+      assert(image->planar_format->nplanes == 1);
+
+   image->aux_offset = 0; /* y_tiled_height * pitch; */
+
    return true;
 }
 
-- 
2.11.0



More information about the mesa-dev mailing list