panfrost: Introduce create_with_modifier helper
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 20 Jul 2020 21:23:55 +0000 (17:23 -0400)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 12 Aug 2020 13:59:20 +0000 (09:59 -0400)
As a stepping stone to full modifier support.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Icecream95 <ixn@keemail.me>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6159>

src/gallium/drivers/panfrost/pan_resource.c

index 0897e7ca7e76d944bb2ec8a8e61034e0be88869d..5dd6d36b9f23a2516d29f5eca9eefce71725927c 100644 (file)
@@ -472,8 +472,9 @@ panfrost_resource_set_damage_region(struct pipe_screen *screen,
 }
 
 static struct pipe_resource *
-panfrost_resource_create(struct pipe_screen *screen,
-                         const struct pipe_resource *template)
+panfrost_resource_create_with_modifier(struct pipe_screen *screen,
+                         const struct pipe_resource *template,
+                         uint64_t modifier)
 {
         struct panfrost_device *dev = pan_device(screen);
 
@@ -514,6 +515,16 @@ panfrost_resource_create(struct pipe_screen *screen,
         return (struct pipe_resource *)so;
 }
 
+/* Default is to create a resource as don't care */
+
+static struct pipe_resource *
+panfrost_resource_create(struct pipe_screen *screen,
+                         const struct pipe_resource *template)
+{
+        return panfrost_resource_create_with_modifier(screen, template,
+                        DRM_FORMAT_MOD_INVALID);
+}
+
 static void
 panfrost_resource_destroy(struct pipe_screen *screen,
                           struct pipe_resource *pt)