drm/v3d: clean caches at the end of render jobs on request from user space
authorIago Toral Quiroga <itoral@igalia.com>
Tue, 3 Sep 2019 06:45:24 +0000 (08:45 +0200)
committerpopcornmix <popcornmix@gmail.com>
Wed, 1 Jul 2020 15:33:06 +0000 (16:33 +0100)
commit0abc676334ae5058381f86f5f3c0c0de16c2f07a
treedfc81ede69fcb1c4dcc5d124284cc3f9645038e6
parent46d3e35466e1ac9052f2160976ddb4a9d8216980
drm/v3d: clean caches at the end of render jobs on request from user space

Extends the user space ioctl for CL submissions so it can include a request
to flush the cache once the CL execution has completed. Fixes memory
write violation messages reported by the kernel in workloads involving
shader memory writes (SSBOs, shader images, scratch, etc) which sometimes
also lead to GPU resets during Piglit and CTS workloads.

v2: if v3d_job_init() fails we need to kfree() the job instead of
    v3d_job_put() it (Eric Anholt).

v3 (Eric Anholt):
  - Drop _FLAG suffix from the new flag name.
  - Add a new param so userspace can tell whether cache flushing is
    implemented in the kernel.

Signed-off-by: Iago Toral Quiroga <itoral@igalia.com>
drivers/gpu/drm/v3d/v3d_drv.c
drivers/gpu/drm/v3d/v3d_gem.c
include/uapi/drm/v3d_drm.h