panfrost: Use draw pack for blit
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 24 Aug 2020 17:46:34 +0000 (13:46 -0400)
committerMarge Bot <eric+marge@anholt.net>
Fri, 28 Aug 2020 14:53:53 +0000 (14:53 +0000)
Something easy to start us off for the series.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6476>

src/panfrost/lib/pan_blit.c

index 802ca40ac2b9882771918f801c91007dae60d21e..c1b704bff8f79a2406a74708de7f98b780aa90cc 100644 (file)
@@ -349,19 +349,24 @@ panfrost_load_midg(
                         .unknown_draw = 0x3000,
                         .index_count = MALI_POSITIVE(vertex_count)
                 },
-                .postfix = {
-                        .gl_enables = 0x7,
-                        .position_varying = coordinates,
-                        .textures = panfrost_pool_upload(pool, &texture_t.gpu, sizeof(texture_t.gpu)),
-                        .sampler_descriptor = sampler.gpu,
-                        .shader = shader_meta_t.gpu,
-                        .varyings = varying_buffer.gpu,
-                        .varying_meta = varying.gpu,
-                        .viewport = viewport.gpu,
-                        .shared_memory = fbd
-                }
         };
 
+        struct mali_draw_packed draw;
+
+        pan_pack(&draw, DRAW, cfg) {
+                cfg.unknown_1 = 0x7;
+                cfg.position = coordinates;
+                cfg.textures = panfrost_pool_upload(pool, &texture_t.gpu, sizeof(texture_t.gpu));
+                cfg.samplers = sampler.gpu;
+                cfg.state = shader_meta_t.gpu;
+                cfg.varying_buffers = varying_buffer.gpu;
+                cfg.varyings = varying.gpu;
+                cfg.viewport = viewport.gpu;
+                cfg.shared = fbd;
+        }
+
+        memcpy(&payload.postfix, &draw, MALI_DRAW_LENGTH);
+
         panfrost_pack_work_groups_compute(&payload.prefix, 1, vertex_count, 1, 1, 1, 1, true);
         payload.prefix.workgroups_x_shift_3 = 6;