panfrost: Print the correct UBO size when dumping UBO information
authorBoris Brezillon <boris.brezillon@collabora.com>
Fri, 5 Mar 2021 12:21:19 +0000 (13:21 +0100)
committerMarge Bot <eric+marge@anholt.net>
Thu, 11 Mar 2021 15:10:58 +0000 (15:10 +0000)
There's a minus(1) modifier on the entries field. Take it into account.

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

src/panfrost/lib/decode.c

index f14ae2f..3dcdb16 100644 (file)
@@ -476,8 +476,8 @@ pandecode_uniform_buffers(mali_ptr pubufs, int ubufs_count, int job_no)
         uint64_t *PANDECODE_PTR_VAR(ubufs, umem, pubufs);
 
         for (int i = 0; i < ubufs_count; i++) {
-                unsigned size = (ubufs[i] & ((1 << 10) - 1)) * 16;
                 mali_ptr addr = (ubufs[i] >> 10) << 2;
+                unsigned size = addr ? (((ubufs[i] & ((1 << 10) - 1)) + 1) * 16) : 0;
 
                 pandecode_validate_buffer(addr, size);