From 8d1ab756ed8a7f4d3138dc5da9d2de9f52915261 Mon Sep 17 00:00:00 2001 From: sujeet baranwal Date: Thu, 19 Feb 2015 10:34:51 -0800 Subject: gpu: nvgpu: ioctl for flushing GPU L2 CUDA devtools need to be able to flush the GPU's cache in a sideband fashion and so cannot use methods. This change implements an nvgpu_gpu_ioctl to flush and optionally invalidate the GPU's L2 cache and flush fb. Change-Id: Ib06a0bc8d8880ffbfe4b056518cc3c3df0cc4988 Signed-off-by: sujeet baranwal Signed-off-by: Mayank Kaushik Reviewed-on: http://git-master/r/671809 Reviewed-by: Terje Bergstrom Tested-by: Terje Bergstrom --- include/uapi/linux/nvgpu.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'include/uapi') diff --git a/include/uapi/linux/nvgpu.h b/include/uapi/linux/nvgpu.h index ebeacf9b..3c53ba94 100644 --- a/include/uapi/linux/nvgpu.h +++ b/include/uapi/linux/nvgpu.h @@ -242,6 +242,14 @@ struct nvgpu_gpu_open_channel_args { __s32 channel_fd; }; +/* L2 cache writeback, optionally invalidate clean lines and flush fb */ +struct nvgpu_gpu_l2_fb_args { + __u32 l2_flush:1; + __u32 l2_invalidate:1; + __u32 fb_flush:1; + __u32 reserved; +} __packed; + #define NVGPU_GPU_IOCTL_ZCULL_GET_CTX_SIZE \ _IOR(NVGPU_GPU_IOCTL_MAGIC, 1, struct nvgpu_gpu_zcull_get_ctx_size_args) #define NVGPU_GPU_IOCTL_ZCULL_GET_INFO \ @@ -264,13 +272,14 @@ struct nvgpu_gpu_open_channel_args { _IOWR(NVGPU_GPU_IOCTL_MAGIC, 10, struct nvgpu_gpu_get_tpc_masks_args) #define NVGPU_GPU_IOCTL_OPEN_CHANNEL \ _IOWR(NVGPU_GPU_IOCTL_MAGIC, 11, struct nvgpu_gpu_open_channel_args) +#define NVGPU_GPU_IOCTL_FLUSH_L2 \ + _IOWR(NVGPU_DBG_GPU_IOCTL_MAGIC, 12, struct nvgpu_gpu_l2_fb_args) #define NVGPU_GPU_IOCTL_LAST \ - _IOC_NR(NVGPU_GPU_IOCTL_OPEN_CHANNEL) + _IOC_NR(NVGPU_GPU_IOCTL_FLUSH_L2) #define NVGPU_GPU_IOCTL_MAX_ARG_SIZE \ sizeof(struct nvgpu_gpu_prepare_compressible_read_args) - /* * /dev/nvhost-tsg-gpu device * -- cgit v1.2.2