Mesa (master): broadcom/genxml: Support address fields with <32 bits

Eric Anholt anholt at kemper.freedesktop.org
Tue Jul 25 21:56:02 UTC 2017


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

Author: Eric Anholt <eric at anholt.net>
Date:   Thu Jul 13 12:40:58 2017 -0700

broadcom/genxml: Support address fields with <32 bits

I was writing the XML such that the address field overlapped various flags
in the alignment bits, which caused pain when trying to unpack for decode.
Instead, keep the XML matching the docs (address fields don't overlap),
and just infer the appropriate shift value during decode.

During pack, the address is just applied to the appropriate bits
already, ignoring the sub-byte start/end fields.

---

 src/broadcom/cle/v3d_decoder.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/broadcom/cle/v3d_decoder.c b/src/broadcom/cle/v3d_decoder.c
index 66f74af306..ac33d87191 100644
--- a/src/broadcom/cle/v3d_decoder.c
+++ b/src/broadcom/cle/v3d_decoder.c
@@ -792,7 +792,7 @@ v3d_field_iterator_next(struct v3d_field_iterator *iter)
         case V3D_TYPE_ADDRESS:
         case V3D_TYPE_OFFSET:
                 snprintf(iter->value, sizeof(iter->value), "0x%08"PRIx64,
-                         __gen_unpack_uint(iter->p, s, e));
+                         __gen_unpack_uint(iter->p, s, e) << (31 - (e - s)));
                 break;
         case V3D_TYPE_STRUCT:
                 snprintf(iter->value, sizeof(iter->value), "<struct %s>",




More information about the mesa-commit mailing list