Mesa (master): panfrost: Add preliminary support for Mali G72

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Sep 29 08:56:12 UTC 2020


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

Author: Boris Brezillon <boris.brezillon at collabora.com>
Date:   Wed Sep 23 11:08:02 2020 +0200

panfrost: Add preliminary support for Mali G72

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

---

 src/gallium/drivers/panfrost/pan_cmdstream.c | 2 ++
 src/gallium/drivers/panfrost/pan_context.c   | 1 +
 src/gallium/drivers/panfrost/pan_screen.c    | 1 +
 src/panfrost/include/panfrost-quirks.h       | 1 +
 src/panfrost/lib/pan_props.c                 | 1 +
 src/panfrost/lib/pan_texture.c               | 5 +++++
 src/panfrost/lib/pan_texture.h               | 1 +
 7 files changed, 12 insertions(+)

diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c
index fd901073910..f9dbb3df6df 100644
--- a/src/gallium/drivers/panfrost/pan_cmdstream.c
+++ b/src/gallium/drivers/panfrost/pan_cmdstream.c
@@ -326,6 +326,8 @@ panfrost_emit_blend(struct panfrost_batch *batch, void *rts,
                                 brts[i].constant = blend[i].equation.constant;
 
                                 brts[i].format = panfrost_format_to_bifrost_blend(format_desc);
+                                if (dev->quirks & HAS_SWIZZLES)
+                                        brts[i].swizzle = panfrost_get_default_swizzle(4);
 
                                 /* 0x19 disables blending and forces REPLACE
                                  * mode (equivalent to rgb_mode = alpha_mode =
diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index 92181874d1e..07c54d4e04a 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -1021,6 +1021,7 @@ panfrost_create_sampler_view_bo(struct panfrost_sampler_view *so,
                 so->bo = panfrost_bo_create(device, size, 0);
 
                 panfrost_new_texture_bifrost(
+                                device,
                                 &so->bifrost_descriptor,
                                 texture->width0, texture->height0,
                                 depth, array_size,
diff --git a/src/gallium/drivers/panfrost/pan_screen.c b/src/gallium/drivers/panfrost/pan_screen.c
index bd71b23d775..e8092afd147 100644
--- a/src/gallium/drivers/panfrost/pan_screen.c
+++ b/src/gallium/drivers/panfrost/pan_screen.c
@@ -714,6 +714,7 @@ panfrost_create_screen(int fd, struct renderonly *ro)
         case 0x820: /* T820 */
         case 0x860: /* T860 */
                 break;
+        case 0x6221: /* G72 */
         case 0x7093: /* G31 */
         case 0x7212: /* G52 */
                 if (dev->debug & PAN_DBG_BIFROST)
diff --git a/src/panfrost/include/panfrost-quirks.h b/src/panfrost/include/panfrost-quirks.h
index 22a79c91f01..e3aae4f5b40 100644
--- a/src/panfrost/include/panfrost-quirks.h
+++ b/src/panfrost/include/panfrost-quirks.h
@@ -105,6 +105,7 @@ panfrost_get_quirks(unsigned gpu_id)
                 return MIDGARD_QUIRKS;
 
         case 0x6000: /* G71 */
+        case 0x6221: /* G72 */
                 return BIFROST_QUIRKS | HAS_SWIZZLES;
 
         case 0x7093: /* G31 */
diff --git a/src/panfrost/lib/pan_props.c b/src/panfrost/lib/pan_props.c
index 7176f9ba115..831b203bd04 100644
--- a/src/panfrost/lib/pan_props.c
+++ b/src/panfrost/lib/pan_props.c
@@ -146,6 +146,7 @@ panfrost_model_name(unsigned gpu_id)
         case 0x750: return "Mali T760 (Panfrost)";
         case 0x860: return "Mali T860 (Panfrost)";
         case 0x880: return "Mali T880 (Panfrost)";
+        case 0x6221: return "Mali G72 (Panfrost)";
         case 0x7093: return "Mali G31 (Panfrost)";
         case 0x7212: return "Mali G52 (Panfrost)";
         default:
diff --git a/src/panfrost/lib/pan_texture.c b/src/panfrost/lib/pan_texture.c
index 5a54fd563b2..4ea05e0cc02 100644
--- a/src/panfrost/lib/pan_texture.c
+++ b/src/panfrost/lib/pan_texture.c
@@ -28,6 +28,7 @@
 #include "util/macros.h"
 #include "util/u_math.h"
 #include "pan_texture.h"
+#include "panfrost-quirks.h"
 
 /* Generates a texture descriptor. Ideally, descriptors are immutable after the
  * texture is created, so we can keep these hanging around in GPU memory in a
@@ -352,6 +353,7 @@ panfrost_new_texture(
 
 void
 panfrost_new_texture_bifrost(
+        const struct panfrost_device *dev,
         struct mali_bifrost_texture_packed *out,
         uint16_t width, uint16_t height,
         uint16_t depth, uint16_t array_size,
@@ -393,6 +395,9 @@ panfrost_new_texture_bifrost(
         pan_pack(out, BIFROST_TEXTURE, cfg) {
                 cfg.dimension = dim;
                 cfg.format = (mali_format << 12) | (srgb << 20);
+                if (dev->quirks & HAS_SWIZZLES)
+	                cfg.format |= panfrost_get_default_swizzle(desc->nr_channels);
+
                 cfg.width = u_minify(width, first_level);
                 cfg.height = u_minify(height, first_level);
                 cfg.swizzle = swizzle;
diff --git a/src/panfrost/lib/pan_texture.h b/src/panfrost/lib/pan_texture.h
index 852c103cabf..fe25f9658ab 100644
--- a/src/panfrost/lib/pan_texture.h
+++ b/src/panfrost/lib/pan_texture.h
@@ -113,6 +113,7 @@ panfrost_new_texture(
 
 void
 panfrost_new_texture_bifrost(
+        const struct panfrost_device *dev,
         struct mali_bifrost_texture_packed *out,
         uint16_t width, uint16_t height,
         uint16_t depth, uint16_t array_size,



More information about the mesa-commit mailing list