Skip to content

Commit

Permalink
i965: Support images with offset aux buffers
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
bwidawsk committed Jan 3, 2017
1 parent b5c1f1e commit 33b5811
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/mesa/drivers/dri/i965/intel_image.h
Expand Up @@ -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.
* \{
Expand Down
5 changes: 5 additions & 0 deletions src/mesa/drivers/dri/i965/intel_screen.c
Expand Up @@ -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;
}

Expand Down

0 comments on commit 33b5811

Please sign in to comment.