From 660c9a95104b37c947e0c2f6aeda4c92698b40f4 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Thu, 23 Mar 2017 12:49:58 -0700 Subject: [PATCH] gpu: nvgpu: Move ctrl IOCTL creation to Linux module Move all code related to ctrl devnode to under Linux module. JIRA NVGPU-16 Change-Id: I834b46ec4172076d7bde459168f1e6bc8c5d6c0c Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/1330802 Reviewed-by: svccoveritychecker GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/Makefile.nvgpu | 2 +- drivers/gpu/nvgpu/common/linux/ioctl.c | 2 +- .../{gk20a/ctrl_gk20a.c => common/linux/ioctl_ctrl.c} | 9 ++++----- .../{gk20a/ctrl_gk20a.h => common/linux/ioctl_ctrl.h} | 8 ++++---- 4 files changed, 10 insertions(+), 11 deletions(-) rename drivers/gpu/nvgpu/{gk20a/ctrl_gk20a.c => common/linux/ioctl_ctrl.c} (99%) rename drivers/gpu/nvgpu/{gk20a/ctrl_gk20a.h => common/linux/ioctl_ctrl.h} (86%) diff --git a/drivers/gpu/nvgpu/Makefile.nvgpu b/drivers/gpu/nvgpu/Makefile.nvgpu index d0eb1085e..9186bcc73 100644 --- a/drivers/gpu/nvgpu/Makefile.nvgpu +++ b/drivers/gpu/nvgpu/Makefile.nvgpu @@ -26,6 +26,7 @@ nvgpu-y := \ common/linux/kmem.o \ common/linux/timers.o \ common/linux/ioctl.o \ + common/linux/ioctl_ctrl.o \ common/mm/nvgpu_allocator.o \ common/mm/bitmap_allocator.o \ common/mm/buddy_allocator.o \ @@ -40,7 +41,6 @@ nvgpu-y := \ gk20a/pramin_gk20a.o \ gk20a/sched_gk20a.o \ gk20a/as_gk20a.o \ - gk20a/ctrl_gk20a.o \ gk20a/ce2_gk20a.o \ gk20a/fifo_gk20a.o \ gk20a/channel_gk20a.o \ diff --git a/drivers/gpu/nvgpu/common/linux/ioctl.c b/drivers/gpu/nvgpu/common/linux/ioctl.c index 083d61026..202ea0efb 100644 --- a/drivers/gpu/nvgpu/common/linux/ioctl.c +++ b/drivers/gpu/nvgpu/common/linux/ioctl.c @@ -24,9 +24,9 @@ #include "gk20a/dbg_gpu_gk20a.h" #include "gk20a/ctxsw_trace_gk20a.h" #include "gk20a/channel_gk20a.h" -#include "gk20a/ctrl_gk20a.h" #include "gk20a/as_gk20a.h" #include "gk20a/tsg_gk20a.h" +#include "ioctl_ctrl.h" #define GK20A_NUM_CDEVS 7 diff --git a/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c b/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c similarity index 99% rename from drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c rename to drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c index fba39a50d..fa05deb92 100644 --- a/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c +++ b/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c @@ -14,19 +14,18 @@ * along with this program. If not, see . */ -#include +#include #include #include #include -#include #include #include -#include #include -#include "gk20a.h" -#include "fence_gk20a.h" +#include "ioctl_ctrl.h" +#include "gk20a/gk20a.h" +#include "gk20a/fence_gk20a.h" #define HZ_TO_MHZ(a) ((a > 0xF414F9CD7) ? 0xffff : (a >> 32) ? \ (u32) ((a * 0x10C8ULL) >> 32) : (u16) ((u32) a/MHZ)) diff --git a/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.h b/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.h similarity index 86% rename from drivers/gpu/nvgpu/gk20a/ctrl_gk20a.h rename to drivers/gpu/nvgpu/common/linux/ioctl_ctrl.h index 26ca4e202..8b4a5e59f 100644 --- a/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.h +++ b/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2012, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2011-2017, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -13,11 +13,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#ifndef CTRL_GK20A_H -#define CTRL_GK20A_H +#ifndef __NVGPU_IOCTL_CTRL_H__ +#define __NVGPU_IOCTL_CTRL_H__ int gk20a_ctrl_dev_open(struct inode *inode, struct file *filp); int gk20a_ctrl_dev_release(struct inode *inode, struct file *filp); long gk20a_ctrl_dev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg); -#endif /* CTRL_GK20A_H */ +#endif