diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/dmabuf.h | 3 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c | 1 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/os_linux.h | 2 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 8 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/mm_gk20a.h | 20 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/sim_gk20a.c | 5 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp106/bios_gp106.c | 3 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp106/mclk_gp106.c | 1 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/include/nvgpu/linux/vm.h | 12 |
9 files changed, 25 insertions, 30 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/dmabuf.h b/drivers/gpu/nvgpu/common/linux/dmabuf.h index 718386c5..b4b61459 100644 --- a/drivers/gpu/nvgpu/common/linux/dmabuf.h +++ b/drivers/gpu/nvgpu/common/linux/dmabuf.h | |||
@@ -70,4 +70,7 @@ int gk20a_dmabuf_alloc_drvdata(struct dma_buf *dmabuf, struct device *dev); | |||
70 | int gk20a_dmabuf_get_state(struct dma_buf *dmabuf, struct gk20a *g, | 70 | int gk20a_dmabuf_get_state(struct dma_buf *dmabuf, struct gk20a *g, |
71 | u64 offset, struct gk20a_buffer_state **state); | 71 | u64 offset, struct gk20a_buffer_state **state); |
72 | 72 | ||
73 | int gk20a_mm_get_buffer_info(struct device *dev, int dmabuf_fd, | ||
74 | u64 *buffer_id, u64 *buffer_len); | ||
75 | |||
73 | #endif | 76 | #endif |
diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c b/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c index 6c9fc26f..1e5a9d59 100644 --- a/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c +++ b/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c | |||
@@ -43,6 +43,7 @@ | |||
43 | #include "gk20a/fence_gk20a.h" | 43 | #include "gk20a/fence_gk20a.h" |
44 | 44 | ||
45 | #include "os_linux.h" | 45 | #include "os_linux.h" |
46 | #include "dmabuf.h" | ||
46 | 47 | ||
47 | #define HZ_TO_MHZ(a) ((a > 0xF414F9CD7ULL) ? 0xffff : (a >> 32) ? \ | 48 | #define HZ_TO_MHZ(a) ((a > 0xF414F9CD7ULL) ? 0xffff : (a >> 32) ? \ |
48 | (u32) ((a * 0x10C8ULL) >> 32) : (u16) ((u32) a/MHZ)) | 49 | (u32) ((a * 0x10C8ULL) >> 32) : (u16) ((u32) a/MHZ)) |
diff --git a/drivers/gpu/nvgpu/common/linux/os_linux.h b/drivers/gpu/nvgpu/common/linux/os_linux.h index 9bb9e9f4..07be7edc 100644 --- a/drivers/gpu/nvgpu/common/linux/os_linux.h +++ b/drivers/gpu/nvgpu/common/linux/os_linux.h | |||
@@ -13,10 +13,12 @@ | |||
13 | * You should have received a copy of the GNU General Public License | 13 | * You should have received a copy of the GNU General Public License |
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 | #ifndef NVGPU_OS_LINUX_H | 17 | #ifndef NVGPU_OS_LINUX_H |
17 | #define NVGPU_OS_LINUX_H | 18 | #define NVGPU_OS_LINUX_H |
18 | 19 | ||
19 | #include <linux/cdev.h> | 20 | #include <linux/cdev.h> |
21 | #include <linux/iommu.h> | ||
20 | 22 | ||
21 | #ifdef CONFIG_TEGRA_19x_GPU | 23 | #ifdef CONFIG_TEGRA_19x_GPU |
22 | #include <nvgpu/linux/os_linux_t19x.h> | 24 | #include <nvgpu/linux/os_linux_t19x.h> |
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index 3c3ddc80..1ea59a9d 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c | |||
@@ -7980,14 +7980,6 @@ int __gr_gk20a_exec_ctx_ops(struct channel_gk20a *ch, | |||
7980 | ctx_op_nr++; | 7980 | ctx_op_nr++; |
7981 | } | 7981 | } |
7982 | } | 7982 | } |
7983 | #if 0 | ||
7984 | /* flush cpu caches for the ctx buffer? only if cpu cached, of course. | ||
7985 | * they aren't, yet */ | ||
7986 | if (cached) { | ||
7987 | FLUSH_CPU_DCACHE(ctx_ptr, | ||
7988 | sg_phys(ch_ctx->gr_ctx.mem.ref), size); | ||
7989 | } | ||
7990 | #endif | ||
7991 | 7983 | ||
7992 | cleanup: | 7984 | cleanup: |
7993 | if (offsets) | 7985 | if (offsets) |
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h index 434fc422..183d6211 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h | |||
@@ -21,14 +21,10 @@ | |||
21 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 21 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
22 | * DEALINGS IN THE SOFTWARE. | 22 | * DEALINGS IN THE SOFTWARE. |
23 | */ | 23 | */ |
24 | |||
24 | #ifndef MM_GK20A_H | 25 | #ifndef MM_GK20A_H |
25 | #define MM_GK20A_H | 26 | #define MM_GK20A_H |
26 | 27 | ||
27 | #include <linux/scatterlist.h> | ||
28 | #include <linux/iommu.h> | ||
29 | #include <asm/dma-iommu.h> | ||
30 | #include <asm/cacheflush.h> | ||
31 | |||
32 | #include <nvgpu/nvgpu_mem.h> | 28 | #include <nvgpu/nvgpu_mem.h> |
33 | #include <nvgpu/allocator.h> | 29 | #include <nvgpu/allocator.h> |
34 | #include <nvgpu/vm.h> | 30 | #include <nvgpu/vm.h> |
@@ -36,17 +32,6 @@ | |||
36 | #include <nvgpu/rbtree.h> | 32 | #include <nvgpu/rbtree.h> |
37 | #include <nvgpu/kref.h> | 33 | #include <nvgpu/kref.h> |
38 | 34 | ||
39 | #ifdef CONFIG_ARM64 | ||
40 | #define outer_flush_range(a, b) | ||
41 | #define __cpuc_flush_dcache_area __flush_dcache_area | ||
42 | #endif | ||
43 | |||
44 | #define FLUSH_CPU_DCACHE(va, pa, size) \ | ||
45 | do { \ | ||
46 | __cpuc_flush_dcache_area((void *)(va), (size_t)(size)); \ | ||
47 | outer_flush_range(pa, pa + (size_t)(size)); \ | ||
48 | } while (0) | ||
49 | |||
50 | struct gpfifo_desc { | 35 | struct gpfifo_desc { |
51 | struct nvgpu_mem mem; | 36 | struct nvgpu_mem mem; |
52 | u32 entry_num; | 37 | u32 entry_num; |
@@ -198,7 +183,4 @@ void gk20a_mm_init_pdb(struct gk20a *g, struct nvgpu_mem *mem, | |||
198 | extern const struct gk20a_mmu_level gk20a_mm_levels_64k[]; | 183 | extern const struct gk20a_mmu_level gk20a_mm_levels_64k[]; |
199 | extern const struct gk20a_mmu_level gk20a_mm_levels_128k[]; | 184 | extern const struct gk20a_mmu_level gk20a_mm_levels_128k[]; |
200 | 185 | ||
201 | int gk20a_mm_get_buffer_info(struct device *dev, int dmabuf_fd, | ||
202 | u64 *buffer_id, u64 *buffer_len); | ||
203 | |||
204 | #endif /* MM_GK20A_H */ | 186 | #endif /* MM_GK20A_H */ |
diff --git a/drivers/gpu/nvgpu/gk20a/sim_gk20a.c b/drivers/gpu/nvgpu/gk20a/sim_gk20a.c index 7eb0aafe..34ca5add 100644 --- a/drivers/gpu/nvgpu/gk20a/sim_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/sim_gk20a.c | |||
@@ -24,11 +24,12 @@ | |||
24 | #include <linux/highmem.h> | 24 | #include <linux/highmem.h> |
25 | #include <linux/platform_device.h> | 25 | #include <linux/platform_device.h> |
26 | 26 | ||
27 | #include <nvgpu/log.h> | ||
28 | #include <nvgpu/linux/vm.h> | ||
29 | |||
27 | #include "gk20a.h" | 30 | #include "gk20a.h" |
28 | #include "platform_gk20a.h" | 31 | #include "platform_gk20a.h" |
29 | 32 | ||
30 | #include <nvgpu/log.h> | ||
31 | |||
32 | #include <nvgpu/hw/gk20a/hw_sim_gk20a.h> | 33 | #include <nvgpu/hw/gk20a/hw_sim_gk20a.h> |
33 | 34 | ||
34 | static inline void sim_writel(struct gk20a *g, u32 r, u32 v) | 35 | static inline void sim_writel(struct gk20a *g, u32 r, u32 v) |
diff --git a/drivers/gpu/nvgpu/gp106/bios_gp106.c b/drivers/gpu/nvgpu/gp106/bios_gp106.c index a5a244e8..9d75249d 100644 --- a/drivers/gpu/nvgpu/gp106/bios_gp106.c +++ b/drivers/gpu/nvgpu/gp106/bios_gp106.c | |||
@@ -20,6 +20,8 @@ | |||
20 | * DEALINGS IN THE SOFTWARE. | 20 | * DEALINGS IN THE SOFTWARE. |
21 | */ | 21 | */ |
22 | 22 | ||
23 | #include <linux/pci_ids.h> | ||
24 | |||
23 | #include <nvgpu/bios.h> | 25 | #include <nvgpu/bios.h> |
24 | #include <nvgpu/kmem.h> | 26 | #include <nvgpu/kmem.h> |
25 | #include <nvgpu/nvgpu_common.h> | 27 | #include <nvgpu/nvgpu_common.h> |
@@ -248,4 +250,3 @@ free_firmware: | |||
248 | nvgpu_vfree(g, g->bios.data); | 250 | nvgpu_vfree(g, g->bios.data); |
249 | return err; | 251 | return err; |
250 | } | 252 | } |
251 | |||
diff --git a/drivers/gpu/nvgpu/gp106/mclk_gp106.c b/drivers/gpu/nvgpu/gp106/mclk_gp106.c index e058b02f..b7a2c91d 100644 --- a/drivers/gpu/nvgpu/gp106/mclk_gp106.c +++ b/drivers/gpu/nvgpu/gp106/mclk_gp106.c | |||
@@ -21,6 +21,7 @@ | |||
21 | */ | 21 | */ |
22 | 22 | ||
23 | #include <linux/delay.h> | 23 | #include <linux/delay.h> |
24 | #include <linux/pci_ids.h> | ||
24 | 25 | ||
25 | #include <nvgpu/bios.h> | 26 | #include <nvgpu/bios.h> |
26 | #include <nvgpu/kmem.h> | 27 | #include <nvgpu/kmem.h> |
diff --git a/drivers/gpu/nvgpu/include/nvgpu/linux/vm.h b/drivers/gpu/nvgpu/include/nvgpu/linux/vm.h index 91f0cf09..7aacf496 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/linux/vm.h +++ b/drivers/gpu/nvgpu/include/nvgpu/linux/vm.h | |||
@@ -19,6 +19,18 @@ | |||
19 | 19 | ||
20 | #include <nvgpu/types.h> | 20 | #include <nvgpu/types.h> |
21 | 21 | ||
22 | #include <asm/cacheflush.h> | ||
23 | |||
24 | /* | ||
25 | * Couple of places explicitly flush caches still. Any DMA buffer we allocate | ||
26 | * from within the GPU is writecombine and as a result does not need this but | ||
27 | * there seem to be exceptions. | ||
28 | */ | ||
29 | #ifdef CONFIG_ARM64 | ||
30 | #define outer_flush_range(a, b) | ||
31 | #define __cpuc_flush_dcache_area __flush_dcache_area | ||
32 | #endif | ||
33 | |||
22 | struct sg_table; | 34 | struct sg_table; |
23 | struct dma_buf; | 35 | struct dma_buf; |
24 | 36 | ||