diff options
author | Deepak Nibade <dnibade@nvidia.com> | 2016-11-16 04:49:12 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2016-11-30 05:18:17 -0500 |
commit | af5d2d208ada4d84c7a7bd0e4e0c288d1276225f (patch) | |
tree | a822054d7a576fc5f6e839d7ffebd91147061540 /include/uapi/linux | |
parent | 5f6a2aa02b6927432c9f37e29c592e7efc4cb656 (diff) |
gpu: nvgpu: API to access fb memory
Add IOCTL API NVGPU_DBG_GPU_IOCTL_ACCESS_FB_MEMORY
to read/write fb/vidmem memory
Interface will accept dmabuf_fd of the buffer in vidmem,
offset into the buffer to access, temporary buffer
to copy data across API, size of read/write and
command indicating either read or write operation
API will first parse all the inputs, and then call
gk20a_vidbuf_access_memory() to complete fb access
gk20a_vidbuf_access_memory() will then just use
gk20a_mem_rd_n() or gk20a_mem_wr_n() depending
on the command issued
Bug 1804714
Jira DNVGPU-192
Change-Id: Iba3c42410abe12c2884d3b603fa33d27782e4c56
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1255556
(cherry picked from commit 2c49a8a79d93fc526adbf6f808484fa9a3fa2498)
Reviewed-on: http://git-master/r/1260471
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'include/uapi/linux')
-rw-r--r-- | include/uapi/linux/nvgpu.h | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/include/uapi/linux/nvgpu.h b/include/uapi/linux/nvgpu.h index b1c602db..b4c7e829 100644 --- a/include/uapi/linux/nvgpu.h +++ b/include/uapi/linux/nvgpu.h | |||
@@ -917,11 +917,28 @@ struct nvgpu_dbg_gpu_suspend_resume_contexts_args { | |||
917 | _IOWR(NVGPU_DBG_GPU_IOCTL_MAGIC, 18, struct nvgpu_dbg_gpu_suspend_resume_contexts_args) | 917 | _IOWR(NVGPU_DBG_GPU_IOCTL_MAGIC, 18, struct nvgpu_dbg_gpu_suspend_resume_contexts_args) |
918 | 918 | ||
919 | 919 | ||
920 | #define NVGPU_DBG_GPU_IOCTL_ACCESS_FB_MEMORY_CMD_READ 1 | ||
921 | #define NVGPU_DBG_GPU_IOCTL_ACCESS_FB_MEMORY_CMD_WRITE 2 | ||
922 | |||
923 | struct nvgpu_dbg_gpu_access_fb_memory_args { | ||
924 | __u32 cmd; /* in: either read or write */ | ||
925 | |||
926 | __s32 dmabuf_fd; /* in: dmabuf fd of the buffer in FB */ | ||
927 | __u64 offset; /* in: offset within buffer in FB, should be 4B aligned */ | ||
928 | |||
929 | __u64 buffer; /* in/out: temp buffer to read/write from */ | ||
930 | __u64 size; /* in: size of the buffer i.e. size of read/write in bytes, should be 4B aligned */ | ||
931 | }; | ||
932 | |||
933 | #define NVGPU_DBG_GPU_IOCTL_ACCESS_FB_MEMORY \ | ||
934 | _IOWR(NVGPU_DBG_GPU_IOCTL_MAGIC, 19, struct nvgpu_dbg_gpu_access_fb_memory_args) | ||
935 | |||
936 | |||
920 | #define NVGPU_DBG_GPU_IOCTL_LAST \ | 937 | #define NVGPU_DBG_GPU_IOCTL_LAST \ |
921 | _IOC_NR(NVGPU_DBG_GPU_IOCTL_SUSPEND_RESUME_CONTEXTS) | 938 | _IOC_NR(NVGPU_DBG_GPU_IOCTL_ACCESS_FB_MEMORY) |
922 | 939 | ||
923 | #define NVGPU_DBG_GPU_IOCTL_MAX_ARG_SIZE \ | 940 | #define NVGPU_DBG_GPU_IOCTL_MAX_ARG_SIZE \ |
924 | sizeof(struct nvgpu_dbg_gpu_perfbuf_map_args) | 941 | sizeof(struct nvgpu_dbg_gpu_access_fb_memory_args) |
925 | 942 | ||
926 | /* | 943 | /* |
927 | * /dev/nvhost-gpu device | 944 | * /dev/nvhost-gpu device |