Module: Mesa Branch: main Commit: 8eba1ac32907545526b235bcbe2d7d147cf6e8c3 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=8eba1ac32907545526b235bcbe2d7d147cf6e8c3
Author: Simon Ser <[email protected]> Date: Sun Dec 22 21:49:10 2019 +0100 i965: implement createImageWithModifiers2 This implements __DRIimageExtension version 19. Signed-off-by: Simon Ser <[email protected]> Signed-off-by: Lucas Stach <[email protected]> Reviewed-by: Daniel Stone <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8106> --- 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 b158e1f133d..835b711729f 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 _______________________________________________ mesa-commit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-commit
