From 4fc90f7c3c5ad80360c87c6e0ca66d5b20e612d6 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Thu, 13 Aug 2020 16:06:12 -0400 Subject: [PATCH] panfrost: Use better packs for blits Signed-off-by: Alyssa Rosenzweig Reviewed-by: Tomeu Vizoso Part-of: --- src/panfrost/lib/pan_blit.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/panfrost/lib/pan_blit.c b/src/panfrost/lib/pan_blit.c index 271d159..6002278 100644 --- a/src/panfrost/lib/pan_blit.c +++ b/src/panfrost/lib/pan_blit.c @@ -188,20 +188,21 @@ panfrost_load_midg( struct panfrost_transfer viewport = panfrost_pool_alloc(pool, MALI_VIEWPORT_LENGTH); struct panfrost_transfer sampler = panfrost_pool_alloc(pool, MALI_MIDGARD_SAMPLER_LENGTH); - struct panfrost_transfer varying_buf = panfrost_pool_alloc(pool, MALI_ATTRIBUTE_LENGTH); + struct panfrost_transfer varying = panfrost_pool_alloc(pool, MALI_ATTRIBUTE_LENGTH); + struct panfrost_transfer varying_buffer = panfrost_pool_alloc(pool, MALI_ATTRIBUTE_BUFFER_LENGTH); pan_pack(viewport.cpu, VIEWPORT, cfg) { cfg.scissor_maximum_x = width - 1; /* Inclusive */ cfg.scissor_maximum_y = height - 1; } - union mali_attr varying = { - .elements = coordinates | MALI_ATTR_LINEAR, - .stride = 4 * sizeof(float), - .size = 4 * sizeof(float) * vertex_count, - }; + pan_pack(varying_buffer.cpu, ATTRIBUTE_BUFFER, cfg) { + cfg.pointer = coordinates; + cfg.stride = 4 * sizeof(float); + cfg.size = cfg.stride * vertex_count; + } - pan_pack(varying_buf.cpu, ATTRIBUTE, cfg) { + pan_pack(varying.cpu, ATTRIBUTE, cfg) { cfg.buffer_index = 0; cfg.format = (MALI_CHANNEL_R << 0) | (MALI_CHANNEL_G << 3) | (MALI_RGBA32F << 12); } @@ -347,8 +348,8 @@ panfrost_load_midg( .textures = panfrost_pool_upload(pool, &texture_t.gpu, sizeof(texture_t.gpu)), .sampler_descriptor = sampler.gpu, .shader = shader_meta_t.gpu, - .varyings = panfrost_pool_upload(pool, &varying, sizeof(varying)), - .varying_meta = varying_buf.gpu, + .varyings = varying_buffer.gpu, + .varying_meta = varying.gpu, .viewport = viewport.gpu, .shared_memory = fbd } -- 2.7.4