summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2017-08-16 12:09:16 -0700
committerJason Ekstrand <[email protected]>2017-09-14 14:47:42 -0700
commit939b53d3325e4b53d1dbc4051d4dcb000fa4aba1 (patch)
treeff18f25b08b5783b74aeb368258e56de735c5b42 /src/mesa
parent9c52aef7d7858058712c0f5926e324af052690df (diff)
i965/screen: Implement queryDmaBufFormatModifierAttirbs
Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Daniel Stone <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/intel_screen.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c
index 1ec79088815..ad081f06584 100644
--- a/src/mesa/drivers/dri/i965/intel_screen.c
+++ b/src/mesa/drivers/dri/i965/intel_screen.c
@@ -823,6 +823,27 @@ intel_query_image(__DRIimage *image, int attrib, int *value)
}
}
+static GLboolean
+intel_query_format_modifier_attribs(__DRIscreen *dri_screen,
+ uint32_t fourcc, uint64_t modifier,
+ int attrib, uint64_t *value)
+{
+ struct intel_screen *screen = dri_screen->driverPrivate;
+ const struct intel_image_format *f = intel_image_format_lookup(fourcc);
+
+ if (!modifier_is_supported(&screen->devinfo, f, 0, modifier))
+ return false;
+
+ switch (attrib) {
+ case __DRI_IMAGE_FORMAT_MODIFIER_ATTRIB_PLANE_COUNT:
+ *value = isl_drm_modifier_has_aux(modifier) ? 2 : f->nplanes;
+ return true;
+
+ default:
+ return false;
+ }
+}
+
static __DRIimage *
intel_dup_image(__DRIimage *orig_image, void *loaderPrivate)
{
@@ -1267,7 +1288,7 @@ intel_from_planar(__DRIimage *parent, int plane, void *loaderPrivate)
}
static const __DRIimageExtension intelImageExtension = {
- .base = { __DRI_IMAGE, 15 },
+ .base = { __DRI_IMAGE, 16 },
.createImageFromName = intel_create_image_from_name,
.createImageFromRenderbuffer = intel_create_image_from_renderbuffer,
@@ -1289,6 +1310,7 @@ static const __DRIimageExtension intelImageExtension = {
.createImageFromDmaBufs2 = intel_create_image_from_dma_bufs2,
.queryDmaBufFormats = intel_query_dma_buf_formats,
.queryDmaBufModifiers = intel_query_dma_buf_modifiers,
+ .queryDmaBufFormatModifierAttribs = intel_query_format_modifier_attribs,
};
static uint64_t