From 26783b85bfee4c2ef4f2ccc2d16ebc783dd0aa7d Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Mon, 2 Jul 2018 10:44:05 -0700 Subject: [PATCH] gpu: nvpgu: Rename Linux specific vidmem code Rename os/linux/vidmem.c to os/linux/dmabuf_vidmem.c. The code is mainly dealing with interfacing with Linux dmabuf framework and its responsibilities got confused with common/mm/vidmem.c. Also move the header include/nvgpu/linux/vidmem.h to os/linux/dmabuf_vidmem.h. It does not expose any interface to outside Linux code. Change-Id: I2cb1057a8934d5cb5c5860023aa12f8f048a6684 Signed-off-by: Terje Bergstrom Reviewed-on: https://git-master.nvidia.com/r/1768261 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/Makefile | 2 +- drivers/gpu/nvgpu/os/linux/dma.c | 2 +- drivers/gpu/nvgpu/os/linux/dmabuf.c | 2 +- drivers/gpu/nvgpu/os/linux/{vidmem.c => dmabuf_vidmem.c} | 2 +- .../nvgpu/linux/vidmem.h => os/linux/dmabuf_vidmem.h} | 7 ++++--- drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c | 3 +-- drivers/gpu/nvgpu/os/linux/ioctl_dbg.c | 2 +- drivers/gpu/nvgpu/os/linux/nvgpu_mem.c | 2 +- drivers/gpu/nvgpu/os/linux/vm.c | 2 +- 9 files changed, 12 insertions(+), 12 deletions(-) rename drivers/gpu/nvgpu/os/linux/{vidmem.c => dmabuf_vidmem.c} (99%) rename drivers/gpu/nvgpu/{include/nvgpu/linux/vidmem.h => os/linux/dmabuf_vidmem.h} (91%) diff --git a/drivers/gpu/nvgpu/Makefile b/drivers/gpu/nvgpu/Makefile index 61636ff53..b21d3279f 100644 --- a/drivers/gpu/nvgpu/Makefile +++ b/drivers/gpu/nvgpu/Makefile @@ -66,7 +66,7 @@ nvgpu-y += \ os/linux/dt.o nvgpu-$(CONFIG_GK20A_VIDMEM) += \ - os/linux/vidmem.o + os/linux/dmabuf_vidmem.o nvgpu-$(CONFIG_DEBUG_FS) += \ os/linux/debug.o \ diff --git a/drivers/gpu/nvgpu/os/linux/dma.c b/drivers/gpu/nvgpu/os/linux/dma.c index 6f17e284f..86a17a7e7 100644 --- a/drivers/gpu/nvgpu/os/linux/dma.c +++ b/drivers/gpu/nvgpu/os/linux/dma.c @@ -27,12 +27,12 @@ #include #include -#include #include "gk20a/gk20a.h" #include "platform_gk20a.h" #include "os_linux.h" +#include "dmabuf_vidmem.h" #ifdef __DMA_ATTRS_LONGS #define NVGPU_DEFINE_DMA_ATTRS(x) \ diff --git a/drivers/gpu/nvgpu/os/linux/dmabuf.c b/drivers/gpu/nvgpu/os/linux/dmabuf.c index 129739f07..6f07e88ae 100644 --- a/drivers/gpu/nvgpu/os/linux/dmabuf.c +++ b/drivers/gpu/nvgpu/os/linux/dmabuf.c @@ -22,13 +22,13 @@ #include #include -#include #include "gk20a/gk20a.h" #include "platform_gk20a.h" #include "dmabuf.h" #include "os_linux.h" +#include "dmabuf_vidmem.h" static void gk20a_mm_delete_priv(void *_priv) { diff --git a/drivers/gpu/nvgpu/os/linux/vidmem.c b/drivers/gpu/nvgpu/os/linux/dmabuf_vidmem.c similarity index 99% rename from drivers/gpu/nvgpu/os/linux/vidmem.c rename to drivers/gpu/nvgpu/os/linux/dmabuf_vidmem.c index df1a905d9..572c2b0fa 100644 --- a/drivers/gpu/nvgpu/os/linux/vidmem.c +++ b/drivers/gpu/nvgpu/os/linux/dmabuf_vidmem.c @@ -30,10 +30,10 @@ #include #include -#include #include "gk20a/gk20a.h" #include "gk20a/mm_gk20a.h" +#include "dmabuf_vidmem.h" bool nvgpu_addr_is_vidmem_page_alloc(u64 addr) { diff --git a/drivers/gpu/nvgpu/include/nvgpu/linux/vidmem.h b/drivers/gpu/nvgpu/os/linux/dmabuf_vidmem.h similarity index 91% rename from drivers/gpu/nvgpu/include/nvgpu/linux/vidmem.h rename to drivers/gpu/nvgpu/os/linux/dmabuf_vidmem.h index ec02faec8..977fd78b0 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/linux/vidmem.h +++ b/drivers/gpu/nvgpu/os/linux/dmabuf_vidmem.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2017-2018, 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, @@ -14,14 +14,15 @@ * along with this program. If not, see . */ -#ifndef __NVGPU_LINUX_VIDMEM_H__ -#define __NVGPU_LINUX_VIDMEM_H__ +#ifndef __NVGPU_LINUX_DMABUF_VIDMEM_H__ +#define __NVGPU_LINUX_DMABUF_VIDMEM_H__ #include struct dma_buf; struct gk20a; +struct scatterlist; #ifdef CONFIG_GK20A_VIDMEM diff --git a/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c b/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c index f9ad8082a..17f1e923d 100644 --- a/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c +++ b/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c @@ -30,8 +30,6 @@ #include #include -#include - #include "ioctl_ctrl.h" #include "ioctl_dbg.h" #include "ioctl_as.h" @@ -44,6 +42,7 @@ #include "os_linux.h" #include "dmabuf.h" #include "channel.h" +#include "dmabuf_vidmem.h" #define HZ_TO_MHZ(a) ((a > 0xF414F9CD7ULL) ? 0xffff : (a >> 32) ? \ (u32) ((a * 0x10C8ULL) >> 32) : (u16) ((u32) a/MHZ)) diff --git a/drivers/gpu/nvgpu/os/linux/ioctl_dbg.c b/drivers/gpu/nvgpu/os/linux/ioctl_dbg.c index 3156837bf..9c7608e97 100644 --- a/drivers/gpu/nvgpu/os/linux/ioctl_dbg.c +++ b/drivers/gpu/nvgpu/os/linux/ioctl_dbg.c @@ -30,7 +30,6 @@ #include #include -#include #include #include "gk20a/gk20a.h" @@ -40,6 +39,7 @@ #include "os_linux.h" #include "platform_gk20a.h" #include "ioctl_dbg.h" +#include "dmabuf_vidmem.h" struct dbg_session_gk20a_linux { struct device *dev; diff --git a/drivers/gpu/nvgpu/os/linux/nvgpu_mem.c b/drivers/gpu/nvgpu/os/linux/nvgpu_mem.c index aa8fcd84e..4fc95db94 100644 --- a/drivers/gpu/nvgpu/os/linux/nvgpu_mem.c +++ b/drivers/gpu/nvgpu/os/linux/nvgpu_mem.c @@ -25,12 +25,12 @@ #include #include -#include #include #include #include "os_linux.h" +#include "dmabuf_vidmem.h" #include "gk20a/gk20a.h" #include "gk20a/mm_gk20a.h" diff --git a/drivers/gpu/nvgpu/os/linux/vm.c b/drivers/gpu/nvgpu/os/linux/vm.c index eb9ca8fda..2b5ed103a 100644 --- a/drivers/gpu/nvgpu/os/linux/vm.c +++ b/drivers/gpu/nvgpu/os/linux/vm.c @@ -27,7 +27,6 @@ #include #include -#include #include #include "gk20a/gk20a.h" @@ -36,6 +35,7 @@ #include "platform_gk20a.h" #include "os_linux.h" #include "dmabuf.h" +#include "dmabuf_vidmem.h" static u32 nvgpu_vm_translate_linux_flags(struct gk20a *g, u32 flags) {