提交 d60ec2e7 编写于 作者: R Rob Clark 提交者: Greg Kroah-Hartman

drm/msm: fix handling of cmdstream offset

[ Upstream commit 47e7f506ee6590ceb2efa1f08aca7f9f2ee5c1d3 ]

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.

Fixes: 78b8e5b8 drm/msm: dump a rd GPUADDR header for all buffers in the command
Reviewed-by: NKristian H. Kristensen <hoegsberg@google.com>
Signed-off-by: NRob Clark <robdclark@gmail.com>
Signed-off-by: NSean Paul <seanpaul@chromium.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
上级 7de82186
...@@ -316,10 +316,11 @@ static void snapshot_buf(struct msm_rd_state *rd, ...@@ -316,10 +316,11 @@ static void snapshot_buf(struct msm_rd_state *rd,
uint64_t iova, uint32_t size) uint64_t iova, uint32_t size)
{ {
struct msm_gem_object *obj = submit->bos[idx].obj; struct msm_gem_object *obj = submit->bos[idx].obj;
unsigned offset = 0;
const char *buf; const char *buf;
if (iova) { if (iova) {
buf += iova - submit->bos[idx].iova; offset = iova - submit->bos[idx].iova;
} else { } else {
iova = submit->bos[idx].iova; iova = submit->bos[idx].iova;
size = obj->base.size; size = obj->base.size;
...@@ -340,6 +341,8 @@ static void snapshot_buf(struct msm_rd_state *rd, ...@@ -340,6 +341,8 @@ static void snapshot_buf(struct msm_rd_state *rd,
if (IS_ERR(buf)) if (IS_ERR(buf))
return; return;
buf += offset;
rd_write_section(rd, RD_BUFFER_CONTENTS, buf, size); rd_write_section(rd, RD_BUFFER_CONTENTS, buf, size);
msm_gem_put_vaddr(&obj->base); msm_gem_put_vaddr(&obj->base);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册