From 819f32bdf119ebf4d758a901c9a22c2c4a7d167a Mon Sep 17 00:00:00 2001 From: Konsta Holtta Date: Fri, 18 May 2018 11:35:29 +0300 Subject: gpu: nvgpu: abstract away ioctl gpfifo read The biggest remaining Linuxism in the submit path is the copy_from_user() calls for reading the gpfifo entries to the HW-visible buffer. Abstract away the copy of one such segment starting at some offset and keep the wraparound logic and vidmem proxy in the core submit path. Jira NVGPU-705 Change-Id: I0c6438045c695e5e3f5da4fbc0c92d2c6e7f32cb Signed-off-by: Konsta Holtta Reviewed-on: https://git-master.nvidia.com/r/1730480 Reviewed-by: svc-mobile-coverity GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/gk20a.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.h') diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 3b8c5cd2..9061236e 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h @@ -148,6 +148,14 @@ enum gk20a_cbc_op { enum nvgpu_unit; enum nvgpu_flush_op; + +struct _resmgr_context; + +struct nvgpu_gpfifo_userdata { + struct nvgpu_gpfifo_entry __user *entries; + struct _resmgr_context *context; +}; + /* * gpu_ops should only contain function pointers! Non-function pointer members * should go in struct gk20a or be implemented with the boolean flag API defined @@ -1488,6 +1496,9 @@ struct gk20a { struct channel_gk20a *ch, const char *fmt, ...); void (*signal_os_fence_framework)(struct channel_gk20a *ch); void (*destroy_os_fence_framework)(struct channel_gk20a *ch); + int (*copy_user_gpfifo)(struct nvgpu_gpfifo_entry *dest, + struct nvgpu_gpfifo_userdata userdata, + u32 start, u32 length); } os_channel; struct gk20a_scale_profile *scale_profile; -- cgit v1.2.2