+ _mesa_set_add(batch->bos, bo);
+}
+
+/* Returns the polygon list's GPU address if available, or otherwise allocates
+ * the polygon list. It's perfectly fast to use allocate/free BO directly,
+ * since we'll hit the BO cache and this is one-per-batch anyway. */
+
+mali_ptr
+panfrost_batch_get_polygon_list(struct panfrost_batch *batch, unsigned size)
+{
+ if (batch->polygon_list) {
+ assert(batch->polygon_list->size >= size);
+ } else {
+ struct panfrost_screen *screen = pan_screen(batch->ctx->base.screen);
+
+ /* Create the BO as invisible, as there's no reason to map */
+
+ batch->polygon_list = panfrost_drm_create_bo(screen,
+ size, PAN_ALLOCATE_INVISIBLE);
+ }
+
+ return batch->polygon_list->gpu;