summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2018-07-02 13:44:05 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-07-06 00:48:56 -0400
commit26783b85bfee4c2ef4f2ccc2d16ebc783dd0aa7d (patch)
tree3fbfb7dbbc39d95af270740fe642652f0b3e264e /drivers/gpu
parent3e12cea363c8a09038e870d7df9c047294a0a6a1 (diff)
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 <tbergstrom@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1768261 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/nvgpu/Makefile2
-rw-r--r--drivers/gpu/nvgpu/os/linux/dma.c2
-rw-r--r--drivers/gpu/nvgpu/os/linux/dmabuf.c2
-rw-r--r--drivers/gpu/nvgpu/os/linux/dmabuf_vidmem.c (renamed from drivers/gpu/nvgpu/os/linux/vidmem.c)2
-rw-r--r--drivers/gpu/nvgpu/os/linux/dmabuf_vidmem.h (renamed from drivers/gpu/nvgpu/include/nvgpu/linux/vidmem.h)7
-rw-r--r--drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c3
-rw-r--r--drivers/gpu/nvgpu/os/linux/ioctl_dbg.c2
-rw-r--r--drivers/gpu/nvgpu/os/linux/nvgpu_mem.c2
-rw-r--r--drivers/gpu/nvgpu/os/linux/vm.c2
9 files changed, 12 insertions, 12 deletions
diff --git a/drivers/gpu/nvgpu/Makefile b/drivers/gpu/nvgpu/Makefile
index 61636ff5..b21d3279 100644
--- a/drivers/gpu/nvgpu/Makefile
+++ b/drivers/gpu/nvgpu/Makefile
@@ -66,7 +66,7 @@ nvgpu-y += \
66 os/linux/dt.o 66 os/linux/dt.o
67 67
68nvgpu-$(CONFIG_GK20A_VIDMEM) += \ 68nvgpu-$(CONFIG_GK20A_VIDMEM) += \
69 os/linux/vidmem.o 69 os/linux/dmabuf_vidmem.o
70 70
71nvgpu-$(CONFIG_DEBUG_FS) += \ 71nvgpu-$(CONFIG_DEBUG_FS) += \
72 os/linux/debug.o \ 72 os/linux/debug.o \
diff --git a/drivers/gpu/nvgpu/os/linux/dma.c b/drivers/gpu/nvgpu/os/linux/dma.c
index 6f17e284..86a17a7e 100644
--- a/drivers/gpu/nvgpu/os/linux/dma.c
+++ b/drivers/gpu/nvgpu/os/linux/dma.c
@@ -27,12 +27,12 @@
27#include <nvgpu/vidmem.h> 27#include <nvgpu/vidmem.h>
28 28
29#include <nvgpu/linux/dma.h> 29#include <nvgpu/linux/dma.h>
30#include <nvgpu/linux/vidmem.h>
31 30
32#include "gk20a/gk20a.h" 31#include "gk20a/gk20a.h"
33 32
34#include "platform_gk20a.h" 33#include "platform_gk20a.h"
35#include "os_linux.h" 34#include "os_linux.h"
35#include "dmabuf_vidmem.h"
36 36
37#ifdef __DMA_ATTRS_LONGS 37#ifdef __DMA_ATTRS_LONGS
38#define NVGPU_DEFINE_DMA_ATTRS(x) \ 38#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 129739f0..6f07e88a 100644
--- a/drivers/gpu/nvgpu/os/linux/dmabuf.c
+++ b/drivers/gpu/nvgpu/os/linux/dmabuf.c
@@ -22,13 +22,13 @@
22#include <nvgpu/enabled.h> 22#include <nvgpu/enabled.h>
23 23
24#include <nvgpu/linux/vm.h> 24#include <nvgpu/linux/vm.h>
25#include <nvgpu/linux/vidmem.h>
26 25
27#include "gk20a/gk20a.h" 26#include "gk20a/gk20a.h"
28 27
29#include "platform_gk20a.h" 28#include "platform_gk20a.h"
30#include "dmabuf.h" 29#include "dmabuf.h"
31#include "os_linux.h" 30#include "os_linux.h"
31#include "dmabuf_vidmem.h"
32 32
33static void gk20a_mm_delete_priv(void *_priv) 33static void gk20a_mm_delete_priv(void *_priv)
34{ 34{
diff --git a/drivers/gpu/nvgpu/os/linux/vidmem.c b/drivers/gpu/nvgpu/os/linux/dmabuf_vidmem.c
index df1a905d..572c2b0f 100644
--- a/drivers/gpu/nvgpu/os/linux/vidmem.c
+++ b/drivers/gpu/nvgpu/os/linux/dmabuf_vidmem.c
@@ -30,10 +30,10 @@
30 30
31#include <nvgpu/linux/vm.h> 31#include <nvgpu/linux/vm.h>
32#include <nvgpu/linux/dma.h> 32#include <nvgpu/linux/dma.h>
33#include <nvgpu/linux/vidmem.h>
34 33
35#include "gk20a/gk20a.h" 34#include "gk20a/gk20a.h"
36#include "gk20a/mm_gk20a.h" 35#include "gk20a/mm_gk20a.h"
36#include "dmabuf_vidmem.h"
37 37
38bool nvgpu_addr_is_vidmem_page_alloc(u64 addr) 38bool nvgpu_addr_is_vidmem_page_alloc(u64 addr)
39{ 39{
diff --git a/drivers/gpu/nvgpu/include/nvgpu/linux/vidmem.h b/drivers/gpu/nvgpu/os/linux/dmabuf_vidmem.h
index ec02faec..977fd78b 100644
--- a/drivers/gpu/nvgpu/include/nvgpu/linux/vidmem.h
+++ b/drivers/gpu/nvgpu/os/linux/dmabuf_vidmem.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify it 4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License, 5 * under the terms and conditions of the GNU General Public License,
@@ -14,14 +14,15 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>. 14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */ 15 */
16 16
17#ifndef __NVGPU_LINUX_VIDMEM_H__ 17#ifndef __NVGPU_LINUX_DMABUF_VIDMEM_H__
18#define __NVGPU_LINUX_VIDMEM_H__ 18#define __NVGPU_LINUX_DMABUF_VIDMEM_H__
19 19
20#include <nvgpu/types.h> 20#include <nvgpu/types.h>
21 21
22struct dma_buf; 22struct dma_buf;
23 23
24struct gk20a; 24struct gk20a;
25struct scatterlist;
25 26
26#ifdef CONFIG_GK20A_VIDMEM 27#ifdef CONFIG_GK20A_VIDMEM
27 28
diff --git a/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c b/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c
index f9ad8082..17f1e923 100644
--- a/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c
+++ b/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c
@@ -30,8 +30,6 @@
30#include <nvgpu/enabled.h> 30#include <nvgpu/enabled.h>
31#include <nvgpu/sizes.h> 31#include <nvgpu/sizes.h>
32 32
33#include <nvgpu/linux/vidmem.h>
34
35#include "ioctl_ctrl.h" 33#include "ioctl_ctrl.h"
36#include "ioctl_dbg.h" 34#include "ioctl_dbg.h"
37#include "ioctl_as.h" 35#include "ioctl_as.h"
@@ -44,6 +42,7 @@
44#include "os_linux.h" 42#include "os_linux.h"
45#include "dmabuf.h" 43#include "dmabuf.h"
46#include "channel.h" 44#include "channel.h"
45#include "dmabuf_vidmem.h"
47 46
48#define HZ_TO_MHZ(a) ((a > 0xF414F9CD7ULL) ? 0xffff : (a >> 32) ? \ 47#define HZ_TO_MHZ(a) ((a > 0xF414F9CD7ULL) ? 0xffff : (a >> 32) ? \
49 (u32) ((a * 0x10C8ULL) >> 32) : (u16) ((u32) a/MHZ)) 48 (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 3156837b..9c7608e9 100644
--- a/drivers/gpu/nvgpu/os/linux/ioctl_dbg.c
+++ b/drivers/gpu/nvgpu/os/linux/ioctl_dbg.c
@@ -30,7 +30,6 @@
30#include <nvgpu/atomic.h> 30#include <nvgpu/atomic.h>
31#include <nvgpu/cond.h> 31#include <nvgpu/cond.h>
32 32
33#include <nvgpu/linux/vidmem.h>
34#include <nvgpu/linux/vm.h> 33#include <nvgpu/linux/vm.h>
35 34
36#include "gk20a/gk20a.h" 35#include "gk20a/gk20a.h"
@@ -40,6 +39,7 @@
40#include "os_linux.h" 39#include "os_linux.h"
41#include "platform_gk20a.h" 40#include "platform_gk20a.h"
42#include "ioctl_dbg.h" 41#include "ioctl_dbg.h"
42#include "dmabuf_vidmem.h"
43 43
44struct dbg_session_gk20a_linux { 44struct dbg_session_gk20a_linux {
45 struct device *dev; 45 struct device *dev;
diff --git a/drivers/gpu/nvgpu/os/linux/nvgpu_mem.c b/drivers/gpu/nvgpu/os/linux/nvgpu_mem.c
index aa8fcd84..4fc95db9 100644
--- a/drivers/gpu/nvgpu/os/linux/nvgpu_mem.c
+++ b/drivers/gpu/nvgpu/os/linux/nvgpu_mem.c
@@ -25,12 +25,12 @@
25#include <nvgpu/vidmem.h> 25#include <nvgpu/vidmem.h>
26 26
27#include <nvgpu/linux/dma.h> 27#include <nvgpu/linux/dma.h>
28#include <nvgpu/linux/vidmem.h>
29 28
30#include <linux/vmalloc.h> 29#include <linux/vmalloc.h>
31#include <linux/dma-mapping.h> 30#include <linux/dma-mapping.h>
32 31
33#include "os_linux.h" 32#include "os_linux.h"
33#include "dmabuf_vidmem.h"
34 34
35#include "gk20a/gk20a.h" 35#include "gk20a/gk20a.h"
36#include "gk20a/mm_gk20a.h" 36#include "gk20a/mm_gk20a.h"
diff --git a/drivers/gpu/nvgpu/os/linux/vm.c b/drivers/gpu/nvgpu/os/linux/vm.c
index eb9ca8fd..2b5ed103 100644
--- a/drivers/gpu/nvgpu/os/linux/vm.c
+++ b/drivers/gpu/nvgpu/os/linux/vm.c
@@ -27,7 +27,6 @@
27#include <nvgpu/vidmem.h> 27#include <nvgpu/vidmem.h>
28 28
29#include <nvgpu/linux/vm.h> 29#include <nvgpu/linux/vm.h>
30#include <nvgpu/linux/vidmem.h>
31#include <nvgpu/linux/nvgpu_mem.h> 30#include <nvgpu/linux/nvgpu_mem.h>
32 31
33#include "gk20a/gk20a.h" 32#include "gk20a/gk20a.h"
@@ -36,6 +35,7 @@
36#include "platform_gk20a.h" 35#include "platform_gk20a.h"
37#include "os_linux.h" 36#include "os_linux.h"
38#include "dmabuf.h" 37#include "dmabuf.h"
38#include "dmabuf_vidmem.h"
39 39
40static u32 nvgpu_vm_translate_linux_flags(struct gk20a *g, u32 flags) 40static u32 nvgpu_vm_translate_linux_flags(struct gk20a *g, u32 flags)
41{ 41{