i965: implement createImageWithModifiers2
authorSimon Ser <contact@emersion.fr>
Sun, 22 Dec 2019 20:49:10 +0000 (21:49 +0100)
committerMarge Bot <eric+marge@anholt.net>
Wed, 19 May 2021 16:54:19 +0000 (16:54 +0000)
This implements __DRIimageExtension version 19.

Signed-off-by: Simon Ser <contact@emersion.fr>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8106>

src/mesa/drivers/dri/i965/brw_screen.c

index b158e1f..835b711 100644 (file)
@@ -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