[PATCH v2] drm/v3d: clean caches at the end of render jobs on request from user space

Eric Anholt eric at anholt.net
Wed Sep 18 17:28:40 UTC 2019


Iago Toral Quiroga <itoral at igalia.com> writes:

> 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).
>
> Signed-off-by: Iago Toral Quiroga <itoral at igalia.com>
> Reviewed-by: Eric Anholt <eric at anholt.net>
> Link: https://patchwork.freedesktop.org/patch/msgid/20190912083516.13797-1-itoral@igalia.com

> diff --git a/include/uapi/drm/v3d_drm.h b/include/uapi/drm/v3d_drm.h
> index 58fbe48c91e9..58d2040ea48c 100644
> --- a/include/uapi/drm/v3d_drm.h
> +++ b/include/uapi/drm/v3d_drm.h
> @@ -48,6 +48,8 @@ extern "C" {
>  #define DRM_IOCTL_V3D_SUBMIT_TFU          DRM_IOW(DRM_COMMAND_BASE + DRM_V3D_SUBMIT_TFU, struct drm_v3d_submit_tfu)
>  #define DRM_IOCTL_V3D_SUBMIT_CSD          DRM_IOW(DRM_COMMAND_BASE + DRM_V3D_SUBMIT_CSD, struct drm_v3d_submit_csd)
>  
> +#define DRM_V3D_SUBMIT_CL_FLUSH_CACHE_FLAG        0x01
> +

Hmm.  vc4, msm, panfrost, etnaviv, i915 all name their submit flags
without "_FLAG" in the name, can we drop that?

Also, I just noticed: You don't have a new param to indicate the
availability of the new flag.  You're going to need that (unless you've
got some other clever plan?) so that new Mesa can detect an old kernel
and not expose the GLES 3.1 features that require it.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20190918/9b6c0179/attachment-0001.sig>


More information about the dri-devel mailing list