summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/v3d/v3d_drv.c
diff options
context:
space:
mode:
authorIago Toral Quiroga <itoral@igalia.com>2019-09-19 10:10:16 +0300
committerEric Anholt <eric@anholt.net>2019-09-19 22:57:44 +0300
commit455d56ce809fcc540dc029a05db074855269dc33 (patch)
treeffe45207b55ea1b78303e052a73bde3b35a3fb87 /drivers/gpu/drm/v3d/v3d_drv.c
parent978f6b0693c79a3d2b97f14696ca0ee2c0d1b4da (diff)
downloadlinux-455d56ce809fcc540dc029a05db074855269dc33.tar.xz
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> Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Eric Anholt <eric@anholt.net> Link: https://patchwork.freedesktop.org/patch/msgid/20190919071016.4578-1-itoral@igalia.com
Diffstat (limited to 'drivers/gpu/drm/v3d/v3d_drv.c')
-rw-r--r--drivers/gpu/drm/v3d/v3d_drv.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/v3d/v3d_drv.c b/drivers/gpu/drm/v3d/v3d_drv.c
index 3506ae2723ae..e94bf75368be 100644
--- a/drivers/gpu/drm/v3d/v3d_drv.c
+++ b/drivers/gpu/drm/v3d/v3d_drv.c
@@ -126,6 +126,9 @@ static int v3d_get_param_ioctl(struct drm_device *dev, void *data,
case DRM_V3D_PARAM_SUPPORTS_CSD:
args->value = v3d_has_csd(v3d);
return 0;
+ case DRM_V3D_PARAM_SUPPORTS_CACHE_FLUSH:
+ args->value = 1;
+ return 0;
default:
DRM_DEBUG("Unknown parameter %d\n", args->param);
return -EINVAL;