Skip to content

Commit

Permalink
i965: Pretend that CCS modified images are two planes
Browse files Browse the repository at this point in the history
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 3c926f7 commit ca03d32
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/mesa/drivers/dri/i965/intel_screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ intel_query_image(__DRIimage *image, int attrib, int *value)
case __DRI_IMAGE_ATTRIB_FOURCC:
return intel_lookup_fourcc(image->dri_format, value);
case __DRI_IMAGE_ATTRIB_NUM_PLANES:
*value = 1;
*value = image->aux_offset ? 2: 1;
return true;
case __DRI_IMAGE_ATTRIB_OFFSET:
*value = image->offset;
Expand Down Expand Up @@ -978,9 +978,18 @@ intel_from_planar(__DRIimage *parent, int plane, void *loaderPrivate)
int width, height, offset, stride, dri_format, index;
struct intel_image_format *f;
__DRIimage *image;

if (parent == NULL || parent->planar_format == NULL)
return NULL;
bool is_aux = parent->aux_offset && plane == 1;

if (parent == NULL || parent->planar_format == NULL) {
if (is_aux) {
offset = parent->aux_offset;
stride = ALIGN(parent->pitch / 32, 128);
height = ALIGN(DIV_ROUND_UP(parent->height, 16), 32);
dri_format = parent->dri_format;
goto done;
}
return NULL;
}

f = parent->planar_format;

Expand All @@ -994,6 +1003,7 @@ intel_from_planar(__DRIimage *parent, int plane, void *loaderPrivate)
offset = parent->offsets[index];
stride = parent->strides[index];

done:
image = intel_allocate_image(parent->screen, dri_format, loaderPrivate);
if (image == NULL)
return NULL;
Expand Down

0 comments on commit ca03d32

Please sign in to comment.