diff options
author | Alex Waterman <alexw@nvidia.com> | 2017-08-17 19:16:49 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-10-13 18:19:28 -0400 |
commit | 59e4089278bd052b440293356605ce524e4944db (patch) | |
tree | e9c48f09561f913db919bf8bbd4b39205c7bf606 /drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c | |
parent | 88d5f6b4154d6803ecf3b0dee7208f9f1f10a793 (diff) |
gpu: nvgpu: Separate vidmem alloc from Linux code
Split the core vidmem allocation from the Linux component of vidmem
allocation. The core vidmem allocation allocates the nvgpu_mem struct
that defines the vidmem buffer in the core MM code. The Linux code
now allocates some Linux specific stuff (dma_buf, etc) and also
allocates the core vidmem buf.
JIRA NVGPU-30
JIRA NVGPU-138
Change-Id: I88e87e0abd5ec714610eacc6eac17e148bcee3ce
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1540708
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c b/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c index 7180256a..30988462 100644 --- a/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c +++ b/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c | |||
@@ -26,6 +26,9 @@ | |||
26 | #include <nvgpu/bug.h> | 26 | #include <nvgpu/bug.h> |
27 | #include <nvgpu/bus.h> | 27 | #include <nvgpu/bus.h> |
28 | #include <nvgpu/vidmem.h> | 28 | #include <nvgpu/vidmem.h> |
29 | #include <nvgpu/log.h> | ||
30 | |||
31 | #include <nvgpu/linux/vidmem.h> | ||
29 | 32 | ||
30 | #include "ioctl_ctrl.h" | 33 | #include "ioctl_ctrl.h" |
31 | #include "ioctl_tsg.h" | 34 | #include "ioctl_tsg.h" |
@@ -33,9 +36,8 @@ | |||
33 | #include "gk20a/gk20a.h" | 36 | #include "gk20a/gk20a.h" |
34 | #include "gk20a/platform_gk20a.h" | 37 | #include "gk20a/platform_gk20a.h" |
35 | #include "gk20a/fence_gk20a.h" | 38 | #include "gk20a/fence_gk20a.h" |
36 | #include "os_linux.h" | ||
37 | 39 | ||
38 | #include <nvgpu/log.h> | 40 | #include "os_linux.h" |
39 | 41 | ||
40 | #define HZ_TO_MHZ(a) ((a > 0xF414F9CD7ULL) ? 0xffff : (a >> 32) ? \ | 42 | #define HZ_TO_MHZ(a) ((a > 0xF414F9CD7ULL) ? 0xffff : (a >> 32) ? \ |
41 | (u32) ((a * 0x10C8ULL) >> 32) : (u16) ((u32) a/MHZ)) | 43 | (u32) ((a * 0x10C8ULL) >> 32) : (u16) ((u32) a/MHZ)) |
@@ -693,7 +695,7 @@ static int nvgpu_gpu_alloc_vidmem(struct gk20a *g, | |||
693 | return -EINVAL; | 695 | return -EINVAL; |
694 | } | 696 | } |
695 | 697 | ||
696 | fd = nvgpu_vidmem_buf_alloc(g, args->in.size); | 698 | fd = nvgpu_vidmem_export_linux(g, args->in.size); |
697 | if (fd < 0) | 699 | if (fd < 0) |
698 | return fd; | 700 | return fd; |
699 | 701 | ||