panfrost: Add pan_bo_for_screen helper
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 12 Jul 2019 20:55:45 +0000 (13:55 -0700)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 12 Jul 2019 22:31:48 +0000 (15:31 -0700)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/gallium/drivers/panfrost/pan_screen.h

index ab39da6d2a181c6a4d55fa773254da099b1d284b..71536798663d95f64aa10727d757ce83bc28b9b4 100644 (file)
@@ -96,6 +96,16 @@ pan_screen(struct pipe_screen *p)
         return (struct panfrost_screen *)p;
 }
 
+/* Get a transient BO off the screen given a
+ * particular index */
+
+static inline struct panfrost_bo *
+pan_bo_for_index(struct panfrost_screen *screen, unsigned index)
+{
+        return *(util_dynarray_element(&screen->transient_bo,
+                                struct panfrost_bo *, index));
+}
+
 void
 panfrost_drm_allocate_slab(struct panfrost_screen *screen,
                            struct panfrost_memory *mem,