Mesa (main): asahi: Correctly set IOGPU_ATTACHMENT::size

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sun Feb 6 15:01:48 UTC 2022


Module: Mesa
Branch: main
Commit: 93f2ae12052450ae4fa26f87bcc3fa0a08c0aa6e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=93f2ae12052450ae4fa26f87bcc3fa0a08c0aa6e

Author: Alyssa Rosenzweig <alyssa at rosenzweig.io>
Date:   Tue Jan 18 20:07:12 2022 -0500

asahi: Correctly set IOGPU_ATTACHMENT::size

Not sure what this is used for, but let's not lie to the kernel.

Signed-off-by: Alyssa Rosenzweig <alyssa at rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14898>

---

 src/gallium/drivers/asahi/agx_pipe.c | 1 +
 src/gallium/drivers/asahi/magic.c    | 4 ++--
 src/gallium/drivers/asahi/magic.h    | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/asahi/agx_pipe.c b/src/gallium/drivers/asahi/agx_pipe.c
index 02b16f46ec0..ad9330404fa 100644
--- a/src/gallium/drivers/asahi/agx_pipe.c
+++ b/src/gallium/drivers/asahi/agx_pipe.c
@@ -553,6 +553,7 @@ agx_flush(struct pipe_context *pctx,
                ctx->batch->scissor.bo->ptr.gpu,
                ctx->batch->width,
                ctx->batch->height,
+               util_format_get_blocksize(rt0->base.format),
                pipeline_null.gpu,
                pipeline_clear,
                pipeline_store,
diff --git a/src/gallium/drivers/asahi/magic.c b/src/gallium/drivers/asahi/magic.c
index 7117f4a3e55..2c48bcaafe5 100644
--- a/src/gallium/drivers/asahi/magic.c
+++ b/src/gallium/drivers/asahi/magic.c
@@ -56,7 +56,7 @@ demo_cmdbuf(uint64_t *buf, size_t size,
             uint64_t encoder_ptr,
             uint64_t encoder_id,
             uint64_t scissor_ptr,
-            unsigned width, unsigned height,
+            unsigned width, unsigned height, unsigned bpp,
             uint32_t pipeline_null,
             uint32_t pipeline_clear,
             uint32_t pipeline_store,
@@ -141,7 +141,7 @@ demo_cmdbuf(uint64_t *buf, size_t size,
    agx_pack((map + (offset_attachments / 4) + 4), IOGPU_ATTACHMENT, cfg) {
       cfg.address = rt0;
       cfg.type = AGX_IOGPU_ATTACHMENT_TYPE_COLOUR;
-      cfg.size = 800*600*4;
+      cfg.size = width * height * 4;
       cfg.percent = 100;
    }
 
diff --git a/src/gallium/drivers/asahi/magic.h b/src/gallium/drivers/asahi/magic.h
index 98215d367c9..aa3aad6a666 100644
--- a/src/gallium/drivers/asahi/magic.h
+++ b/src/gallium/drivers/asahi/magic.h
@@ -30,7 +30,7 @@ demo_cmdbuf(uint64_t *buf, size_t size,
             uint64_t encoder_ptr,
             uint64_t encoder_id,
             uint64_t scissor_ptr,
-            unsigned width, unsigned height,
+            unsigned width, unsigned height, unsigned bpp,
             uint32_t pipeline_null,
             uint32_t pipeline_clear,
             uint32_t pipeline_store,



More information about the mesa-commit mailing list