summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2017-08-16 12:01:15 -0700
committerJason Ekstrand <[email protected]>2017-09-14 14:47:40 -0700
commit9c52aef7d7858058712c0f5926e324af052690df (patch)
tree12ee26b6586e232ddd921f598169a753efb2260d /src
parent8824141b8d48d9120ddbf542d6fb661046c41c62 (diff)
i965/screen: Report the correct number of image planes
For non-CCS images, we were reporting just one plane even though they may have multiple in the case of YUV. Reviewed-by: Ben Widawsky <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Daniel Stone <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/intel_screen.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c
index b11c22d038e..1ec79088815 100644
--- a/src/mesa/drivers/dri/i965/intel_screen.c
+++ b/src/mesa/drivers/dri/i965/intel_screen.c
@@ -799,7 +799,14 @@ 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 = isl_drm_modifier_has_aux(image->modifier) ? 2 : 1;
+ if (isl_drm_modifier_has_aux(image->modifier)) {
+ assert(!image->planar_format || image->planar_format->nplanes == 1);
+ *value = 2;
+ } else if (image->planar_format) {
+ *value = image->planar_format->nplanes;
+ } else {
+ *value = 1;
+ }
return true;
case __DRI_IMAGE_ATTRIB_OFFSET:
*value = image->offset;