Skip to content

drm/msm: Smooth out ringbuffer-full handling

Rob Clark dri-devel linux-arm-msm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2drm/msm: Handle ringbuffer overflowdrivers/gpu/drm/msm/adreno/a5xx_gpu.c drivers/gpu/drm/msm/adreno/a6xx_gpu.c drivers/gpu/drm/msm/adreno/adreno_gpu.c +4 more+72 -52 replies
2/2drm/msm: Periodically update RPTR shadowdrivers/gpu/drm/msm/adreno/a5xx_gpu.c drivers/gpu/drm/msm/adreno/a6xx_gpu.c+45 -111 reply

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchJordan Crouse
1/2
2/2A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] drm/msm: Smooth out ringbuffer-full handling

From: Rob Clark <[email protected]>

With some recent userspace work to allow more rendering to be merged into a single SUBMIT ioctl, I realized we have some sharp edges around running out of free ringbuffer space.

1) Currently we only flush once all the cmds (or rather IBs to the cmd buffer) are written into the ringbuffer. Which places a restriction that the submit must fit in the rb. Which means slightly less than 2k cmds per submit, after accounting for some of the other packets needed.
2) Currently, for devices that use RPTR shadow, we only write the CP_WHERE_AM_I packet at the end of the submit, so we aren't seeing partial progress that the GPU is making chewing through previous large submits
3) We spin for up to 1sec waiting for rb space, and then give up and proceed to overwrite the packets that that CP is currently chewing on.. which goes badly. If userspace is submitting >1sec of work per submit ioctl, this means we spin for a long time, and then corrupt the rb anyways.

This patchset doesn't completely address #1. And in general we don't want to be uninteruptably blocking for so much time.. but this will require some more extensive changes.

What it does do is address #2 by periodically emitting a CP_WHERE_AM_I, and #3 by adding detection and error handling for rb overflow, returning -ENOSPC when that happens.

Rob Clark (2):
drm/msm: Handle ringbuffer overflow
drm/msm: Periodically update RPTR shadow

 drivers/gpu/drm/msm/adreno/a5xx_gpu.c   | 32 ++++++++++++++++++++----
 drivers/gpu/drm/msm/adreno/a6xx_gpu.c   | 30 +++++++++++++++++-----
 drivers/gpu/drm/msm/adreno/adreno_gpu.c | 24 +++++++++++++++++-
 drivers/gpu/drm/msm/msm_gem_submit.c    |  7 +++++-
 drivers/gpu/drm/msm/msm_gpu.c           | 33 +++++++++++++++++++++++--
 drivers/gpu/drm/msm/msm_gpu.h           |  2 +-
 drivers/gpu/drm/msm/msm_ringbuffer.h    |  5 ++++
 7 files changed, 117 insertions(+), 16 deletions(-)
Signature · 6 lines
2.30.2

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel