drm/msm: fix handling of cmdstream offset
PATCH 1/1 drm/msm: fix handling of cmdstream offset
Userspace hasn't used submit cmds with submit_offset != 0 for a while, but this starts cropping up again with cmdstream sub-buffer-allocation in libdrm_freedreno.
Doesn't do much good to increment the buf ptr before assigning it.
--- drivers/gpu/drm/msm/msm_rd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/msm/msm_rd.c +4 -1
@@ -316,10 +316,11 @@ static void snapshot_buf(struct msm_rd_state *rd, uint64_t iova, uint32_t size) {struct msm_gem_object *obj = submit->bos[idx].obj; +unsigned offset =0 ;const char *buf;if (iova) { - buf += iova - submit->bos[idx].iova; + offset = iova - submit->bos[idx].iova; }else { iova = submit->bos[idx].iova; size = obj->base.size;
@@ -340,6 +341,8 @@ static void snapshot_buf(struct msm_rd_state *rd,if (IS_ERR (buf))return ; + buf += offset; +rd_write_section (rd,RD_BUFFER_CONTENTS , buf, size);msm_gem_put_vaddr (&obj->base);
Signature · 6 lines
2.17.2 _______________________________________________ Freedreno mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/freedreno
Quoted 6 lines · Rob Clark
Userspace hasn't used submit cmds with
submit_offset!= 0 for a while, but this starts cropping up again with cmdstream sub-buffer-allocation inlibdrm_freedreno.Doesn't do much good to increment the buf ptr before assigning it.
Quoted 35 lines
Fixes 78b8e5b847b4 drm/msm: dump a rd GPUADDR header for all buffers in the commandSigned-off-by Rob Clark <[email protected]>--- drivers/gpu/drm/msm/msm_rd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)drivers/gpu/drm/msm/msm_rd.c +4
-2@@ -316,10 +316,11 @@ static void snapshot_buf(struct msm_rd_state *rd, uint64_t iova, uint32_t size) {struct msm_gem_object *obj = submit->bos[idx].obj; +unsigned offset =0 ;const char *buf;if (iova) { - buf += iova - submit->bos[idx].iova; + offset = iova - submit->bos[idx].iova; }else { iova = submit->bos[idx].iova; size = obj->base.size;@@ -340,6 +341,8 @@ static void snapshot_buf(struct msm_rd_state *rd,if (IS_ERR (buf))return ; + buf += offset; +rd_write_section (rd,RD_BUFFER_CONTENTS , buf, size);msm_gem_put_vaddr (&obj->base); --2.17.2
Quoted 4 lines
_______________________________________________
Freedreno mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/freedreno
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel