From 31e594befefe63d430885e340175b3f9549b8cc4 Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Tue, 31 Oct 2017 12:21:07 -0700 Subject: gpu: nvgpu: Split ctxsw_trace API into non-Linux component Split the ctxsw trace "core" API code into . This is not perect though since there's some Linuxisms present in the HAL and as such that code has to be hidden by the ctxsw tracing CONFIG. But this patch should work for QNX such that it will allow the code to build as long as CONFIG_GK20A_CTXSW_TRACE is not set. Also fix the copywrite notice in the ctxsw code present under common/linux to be GPL. JIRA NVGPU-287 Change-Id: I94715864caf335b7220185492e4629d713b025e0 Signed-off-by: Alex Waterman Reviewed-on: https://git-master.nvidia.com/r/1589429 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 2 +- drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.h | 64 ----------------------------- drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c | 2 +- drivers/gpu/nvgpu/gk20a/fifo_gk20a.c | 2 +- drivers/gpu/nvgpu/gk20a/gk20a.c | 2 +- drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 3 +- 6 files changed, 6 insertions(+), 69 deletions(-) delete mode 100644 drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.h (limited to 'drivers/gpu/nvgpu/gk20a') diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index 546f4164..00d20357 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c @@ -42,6 +42,7 @@ #include #include #include +#include /* * This is required for nvgpu_vm_find_buf() which is used in the tracing @@ -51,7 +52,6 @@ #include #include "gk20a.h" -#include "ctxsw_trace_gk20a.h" #include "dbg_gpu_gk20a.h" #include "fence_gk20a.h" diff --git a/drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.h b/drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.h deleted file mode 100644 index dddb8603..00000000 --- a/drivers/gpu/nvgpu/gk20a/ctxsw_trace_gk20a.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -#ifndef __CTXSW_TRACE_GK20A_H -#define __CTXSW_TRACE_GK20A_H - -#include - -#define GK20A_CTXSW_TRACE_NUM_DEVS 1 - -struct file; -struct inode; -struct gk20a; -struct gpu_ops; -struct nvgpu_ctxsw_trace_entry; -struct channel_gk20a; -struct channel_ctx_gk20a; -struct gk20a_ctxsw_dev; -struct gk20a_fecs_trace; -struct tsg_gk20a; -struct poll_table_struct; - -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 *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 *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 */ diff --git a/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c b/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c index 1517d25a..cd206c2a 100644 --- a/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fecs_trace_gk20a.c @@ -34,8 +34,8 @@ #include #include #include +#include -#include "ctxsw_trace_gk20a.h" #include "fecs_trace_gk20a.h" #include "gk20a.h" #include "gr_gk20a.h" diff --git a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c index f3ed2efb..58a4180f 100644 --- a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c @@ -37,9 +37,9 @@ #include #include #include +#include #include "gk20a.h" -#include "ctxsw_trace_gk20a.h" #include "mm_gk20a.h" #include diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index 6ca0362b..f2bb6dcf 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c @@ -35,13 +35,13 @@ #include #include #include +#include #include #include "gk20a.h" #include "channel_sync_gk20a.h" -#include "ctxsw_trace_gk20a.h" #include "dbg_gpu_gk20a.h" #include "mc_gk20a.h" #include "hal.h" diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index ef7136fe..a95368c3 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c @@ -38,6 +38,7 @@ #include #include #include +#include #include "gk20a.h" #include "kind_gk20a.h" @@ -45,7 +46,7 @@ #include "gr_pri_gk20a.h" #include "regops_gk20a.h" #include "dbg_gpu_gk20a.h" -#include "ctxsw_trace_gk20a.h" + #include "common/linux/os_linux.h" #include -- cgit v1.2.2