freedreno/drm/sp: Implement deferred submit merging
authorRob Clark <robdclark@chromium.org>
Sat, 17 Apr 2021 19:51:02 +0000 (12:51 -0700)
committerMarge Bot <eric+marge@anholt.net>
Wed, 28 Apr 2021 15:36:42 +0000 (15:36 +0000)
commitcccdc513e3ee58b4119e9686c3086b606500d6a9
tree8ed1dda03f5a811396a838847f54a75743f9b633
parentc7dc5cf3cb3b9f4c73d51f234e3c09dc4eca22a5
freedreno/drm/sp: Implement deferred submit merging

For submits flushed with (a) no required fence, and (b) no externally
visible effects (ie. imported/exported bo), we can defer flushing the
submit and merge it into a later submit.

This is a bit more work in userspace, but it cuts down the number of
submit ioctls.  And a common case is that later submits overlap in the
bo's used (for example, blit upload to a buffer, which is then used in
the following draw pass), so it reduces the net amount of work needed
to be done in the kernel to handle the submit ioctl.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/19
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10444>
src/freedreno/drm/msm_pipe.c
src/freedreno/drm/msm_priv.h
src/freedreno/drm/msm_ringbuffer_sp.c