Mesa (staging/21.2): panfrost: Add explicit padding to pan_blend_shader_key

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Aug 25 18:25:58 UTC 2021


Module: Mesa
Branch: staging/21.2
Commit: fd432106c9541eaa4bab3821419b1c3212166be6
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=fd432106c9541eaa4bab3821419b1c3212166be6

Author: Boris Brezillon <boris.brezillon at collabora.com>
Date:   Fri Jun  4 14:41:06 2021 +0200

panfrost: Add explicit padding to pan_blend_shader_key

So the hash function doesn't end up hashing uninitialized values.

Signed-off-by: Boris Brezillon <boris.brezillon at collabora.com>
Reported-by: Tomeu Vizoso <tomeu.vizoso at collabora.com>
Fixes: bbff09b9521f ("panfrost: Move the blend shader cache at the device level")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11383>
(cherry picked from commit 6b7b8eb0468353ce09a3e305abdc26723d79d3f3)

---

 .pick_status.json            |  2 +-
 src/panfrost/lib/pan_blend.h | 11 ++++++-----
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 2693b9778f6..83d91d12a1c 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -391,7 +391,7 @@
         "description": "panfrost: Add explicit padding to pan_blend_shader_key",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "bbff09b9521f17b40441885d06e089abf6c2e0b1"
     },
diff --git a/src/panfrost/lib/pan_blend.h b/src/panfrost/lib/pan_blend.h
index 080130202c4..6a6233f4484 100644
--- a/src/panfrost/lib/pan_blend.h
+++ b/src/panfrost/lib/pan_blend.h
@@ -71,11 +71,12 @@ struct pan_blend_state {
 struct pan_blend_shader_key {
         enum pipe_format format;
         nir_alu_type src0_type, src1_type;
-        unsigned rt : 3;
-        unsigned has_constants : 1;
-        unsigned logicop_enable : 1;
-        unsigned logicop_func:4;
-        unsigned nr_samples : 5;
+        uint32_t rt : 3;
+        uint32_t has_constants : 1;
+        uint32_t logicop_enable : 1;
+        uint32_t logicop_func:4;
+        uint32_t nr_samples : 5;
+        uint32_t padding : 18;
         struct pan_blend_equation equation;
 };
 



More information about the mesa-commit mailing list