[Mesa-dev] [PATCH 17/34] i965: Support images with offset aux buffers
Pohjolainen, Topi
topi.pohjolainen at gmail.com
Wed Jan 25 19:01:56 UTC 2017
On Mon, Jan 23, 2017 at 10:21:40PM -0800, Ben Widawsky wrote:
> 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 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. */
Haa, another word for aux :)
Seriously though, do we need to bump the dri version number?
> + 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 e3fe2a468f..8c46a62529 100644
> --- a/src/mesa/drivers/dri/i965/intel_screen.c
> +++ b/src/mesa/drivers/dri/i965/intel_screen.c
> @@ -638,6 +638,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;
> }
>
> --
> 2.11.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list