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

Author: Karmjit Mahil <[email protected]>
Date:   Fri Apr 21 16:13:24 2023 +0100

pvr: Fix unaligned VDMCTRL_PDS_STATE1 data address

For indirect draw commands the data segment's address was being
calculated with an unaligned code size which could potentially
send an unaligned address to the hw causing problems.

Reported-by: James Glanville <[email protected]>
Signed-off-by: Karmjit Mahil <[email protected]>
Reviewed-by: Frank Binns <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22746>

---

 src/imagination/vulkan/pvr_cmd_buffer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/imagination/vulkan/pvr_cmd_buffer.c 
b/src/imagination/vulkan/pvr_cmd_buffer.c
index 87d293c3d36..d8d085b5fce 100644
--- a/src/imagination/vulkan/pvr_cmd_buffer.c
+++ b/src/imagination/vulkan/pvr_cmd_buffer.c
@@ -6202,7 +6202,7 @@ pvr_write_draw_indirect_vdm_stream(struct pvr_cmd_buffer 
*cmd_buffer,
       pvr_csb_emit (csb, VDMCTRL_PDS_STATE1, state1) {
          const uint32_t data_offset =
             pds_bo->vma->dev_addr.addr +
-            PVR_DW_TO_BYTES(pds_prog.program.code_size) -
+            PVR_DW_TO_BYTES(pds_prog.program.code_size_aligned) -
             cmd_buffer->device->heaps.pds_heap->base_addr.addr;
 
          state1.pds_data_addr = PVR_DEV_ADDR(data_offset);

Reply via email to