summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Widawsky <ben@bwidawsk.net>2016-11-29 13:22:48 -0800
committerBen Widawsky <ben@bwidawsk.net>2017-03-13 10:37:38 -0700
commitff15847eb2b192cd1ab23ae32b8656162be4d628 (patch)
tree5db81a4437bb7a5808943b7234c19cdc4fe7d087
parent03d1421759870eb8033d4e35248130d3b4065e68 (diff)
i965: Support images with offset aux buffers
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@bwidawsk.net> Acked-by: Daniel Stone <daniels@collabora.com>
-rw-r--r--src/mesa/drivers/dri/i965/intel_image.h3
-rw-r--r--src/mesa/drivers/dri/i965/intel_screen.c5
2 files changed, 8 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_image.h b/src/mesa/drivers/dri/i965/intel_image.h
index 3a35487dc4..6814970295 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 440362f803..bfd18abaf6 100644
--- a/src/mesa/drivers/dri/i965/intel_screen.c
+++ b/src/mesa/drivers/dri/i965/intel_screen.c
@@ -603,6 +603,11 @@ create_image_with_modifier(struct intel_screen *screen,
image->pitch = pitch;
image->modifier = modifier;
+ if (image->planar_format)
+ assert(image->planar_format->nplanes == 1);
+
+ image->aux_offset = 0; /* y_tiled_height * pitch; */
+
return true;
}