Mesa (master): pan/bi: Store the architecture in the compiler context

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Nov 13 13:48:19 UTC 2020


Module: Mesa
Branch: master
Commit: 9f640c0f3dc4ef670f9a63cb30e5b5766ad3be6b
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9f640c0f3dc4ef670f9a63cb30e5b5766ad3be6b

Author: Boris Brezillon <boris.brezillon at collabora.com>
Date:   Thu Nov 12 16:13:08 2020 +0100

pan/bi: Store the architecture in the compiler context

Some instructions differ between v6 and v7 and we'll need to know which
architecture we're compiling for if we want to generate the right
instructions.

Signed-off-by: Boris Brezillon <boris.brezillon at collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7530>

---

 src/panfrost/bifrost/bifrost_compile.c | 1 +
 src/panfrost/bifrost/compiler.h        | 1 +
 2 files changed, 2 insertions(+)

diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c
index b7573115cc9..989f038bcaf 100644
--- a/src/panfrost/bifrost/bifrost_compile.c
+++ b/src/panfrost/bifrost/bifrost_compile.c
@@ -2359,6 +2359,7 @@ bifrost_compile_shader_nir(void *mem_ctx, nir_shader *nir,
         ctx->nir = nir;
         ctx->stage = nir->info.stage;
         ctx->quirks = bifrost_get_quirks(inputs->gpu_id);
+        ctx->arch = inputs->gpu_id >> 12;
         ctx->is_blend = inputs->is_blend;
         ctx->blend_desc = inputs->blend.bifrost_blend_desc;
         memcpy(ctx->blend_constants, inputs->blend.constants, sizeof(ctx->blend_constants));
diff --git a/src/panfrost/bifrost/compiler.h b/src/panfrost/bifrost/compiler.h
index 7a581c4802f..ff2486a2964 100644
--- a/src/panfrost/bifrost/compiler.h
+++ b/src/panfrost/bifrost/compiler.h
@@ -459,6 +459,7 @@ typedef struct {
        struct list_head blocks; /* list of bi_block */
        struct panfrost_sysvals sysvals;
        uint32_t quirks;
+       unsigned arch;
        unsigned tls_size;
 
        /* Is internally a blend shader? Depends on stage == FRAGMENT */



More information about the mesa-commit mailing list