From 4d2d890c01b94d10ad55643a4c2c159a98419efe Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Wed, 25 Oct 2017 09:56:09 -0700 Subject: gpu: nvgpu: Move ctxsw_trace_gk20a.c to common/linux Migrate ctxsw_trace_gk20a.c to common/linux/ctxsw_trace.c. This has been done becasue the ctxsw tracing code is currently too tightly tied to the Linux OS due to usage of a couple system calls: - poll() - mmap() And general Linux driver framework code. As a result pulling the logic out of the FECS tracing code is simply too large a scope for time time being. Instead the code was just copied as much as possible. The HAL ops for the FECS code was hidden behind the FECS tracing config so that the vm_area_struct is not used when QNX does not define said config. All other non-HAL functions called by the FECS ctxsw tracing code ha now also been hidden by this config. This is not pretty but for the time being it seems like the way to go. JIRA NVGPU-287 Change-Id: Ib880ab237f4abd330dc66998692c86c4507149c2 Signed-off-by: Alex Waterman Reviewed-on: https://git-master.nvidia.com/r/1586547 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.h | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.h') diff --git a/drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.h b/drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.h index b270581b..dddb8603 100644 --- a/drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.h @@ -23,6 +23,8 @@ #ifndef __CTXSW_TRACE_GK20A_H #define __CTXSW_TRACE_GK20A_H +#include + #define GK20A_CTXSW_TRACE_NUM_DEVS 1 struct file; @@ -41,20 +43,22 @@ int gk20a_ctxsw_dev_release(struct inode *inode, struct file *filp); int gk20a_ctxsw_dev_open(struct inode *inode, struct file *filp); long gk20a_ctxsw_dev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg); -ssize_t gk20a_ctxsw_dev_read(struct file *, char __user *, size_t, loff_t *); -unsigned int gk20a_ctxsw_dev_poll(struct file *, struct poll_table_struct *); -int gk20a_ctxsw_dev_mmap(struct file *, struct vm_area_struct *); +ssize_t gk20a_ctxsw_dev_read(struct file *filp, char __user *buf, + size_t size, loff_t *offs); +unsigned int gk20a_ctxsw_dev_poll(struct file *filp, + struct poll_table_struct *pts); +int gk20a_ctxsw_dev_mmap(struct file *filp, struct vm_area_struct *vma); int gk20a_ctxsw_dev_ring_alloc(struct gk20a *g, void **buf, size_t *size); int gk20a_ctxsw_dev_ring_free(struct gk20a *g); int gk20a_ctxsw_dev_mmap_buffer(struct gk20a *g, struct vm_area_struct *vma); -int gk20a_ctxsw_trace_init(struct gk20a *); -void gk20a_ctxsw_trace_cleanup(struct gk20a *); -int gk20a_ctxsw_trace_write(struct gk20a *, struct nvgpu_ctxsw_trace_entry *); +int gk20a_ctxsw_trace_init(struct gk20a *g); +void gk20a_ctxsw_trace_cleanup(struct gk20a *g); +int gk20a_ctxsw_trace_write(struct gk20a *g, + struct nvgpu_ctxsw_trace_entry *entry); void gk20a_ctxsw_trace_wake_up(struct gk20a *g, int vmid); void gk20a_ctxsw_trace_channel_reset(struct gk20a *g, struct channel_gk20a *ch); void gk20a_ctxsw_trace_tsg_reset(struct gk20a *g, struct tsg_gk20a *tsg); - #endif /* __CTXSW_TRACE_GK20A_H */ -- cgit v1.2.2