From 8eba1ac32907545526b235bcbe2d7d147cf6e8c3 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Sun, 22 Dec 2019 21:49:10 +0100 Subject: [PATCH] i965: implement createImageWithModifiers2 This implements __DRIimageExtension version 19. Signed-off-by: Simon Ser Signed-off-by: Lucas Stach Reviewed-by: Daniel Stone Part-of: --- src/mesa/drivers/dri/i965/brw_screen.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_screen.c b/src/mesa/drivers/dri/i965/brw_screen.c index b158e1f..835b711 100644 --- a/src/mesa/drivers/dri/i965/brw_screen.c +++ b/src/mesa/drivers/dri/i965/brw_screen.c @@ -731,11 +731,6 @@ brw_create_image_common(__DRIscreen *dri_screen, uint64_t modifier = DRM_FORMAT_MOD_INVALID; bool ok; - /* Callers of this may specify a modifier, or a dri usage, but not both. The - * newer modifier interface deprecates the older usage flags. - */ - assert(!(use && count)); - if (use & __DRI_IMAGE_USE_CURSOR) { if (width != 64 || height != 64) return NULL; @@ -916,6 +911,17 @@ brw_create_image_with_modifiers(__DRIscreen *dri_screen, modifiers, count, loaderPrivate); } +static __DRIimage * +brw_create_image_with_modifiers2(__DRIscreen *dri_screen, + int width, int height, int format, + const uint64_t *modifiers, + const unsigned count, unsigned int use, + void *loaderPrivate) +{ + return brw_create_image_common(dri_screen, width, height, format, use, + modifiers, count, loaderPrivate); +} + static GLboolean brw_query_image(__DRIimage *image, int attrib, int *value) { @@ -1511,7 +1517,7 @@ brw_from_planar(__DRIimage *parent, int plane, void *loaderPrivate) } static const __DRIimageExtension brwImageExtension = { - .base = { __DRI_IMAGE, 16 }, + .base = { __DRI_IMAGE, 19 }, .createImageFromName = brw_create_image_from_name, .createImageFromRenderbuffer = brw_create_image_from_renderbuffer, @@ -1534,6 +1540,7 @@ static const __DRIimageExtension brwImageExtension = { .queryDmaBufFormats = brw_query_dma_buf_formats, .queryDmaBufModifiers = brw_query_dma_buf_modifiers, .queryDmaBufFormatModifierAttribs = brw_query_format_modifier_attribs, + .createImageWithModifiers2 = brw_create_image_with_modifiers2, }; static int -- 2.7.4