summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2017-10-25 12:41:52 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-10-27 17:45:58 -0400
commit3fdb6d2e31389db65a71cad25ba907a1306e052b (patch)
treefdca69b5b2254a9183081a707a42105115a298b4
parent7974ad17bb7f389e5634bde58a91304918097495 (diff)
gpu: nvgpu: Remove Linux headers from mm_gk20a.h
Delte the Linux headers and make some modifications to get rid of the minor compilation issues that resulted. - Add <linux/iommu.h> to os_linux.h - Delete #if 0 code that "flushed" a buffer in gr_gk20a.c - Delete FLUSH_CPU_DCACHE() macro - Move the cache flush definitions to <nvgpu/linux/vm.h> and include this header in sim_gk20a.c. This file will not be used by QNX so this should be fine. - Add <linux/pci_ids.h> to gp106/bios_gp106.c and gp106/mclk_gp106.c. - Move function to common/linux/dmabuf.h since it is a dmabuf related function and uses a struct device pointer as an argument. JIRA NVGPU-30 Change-Id: I11f56b98524c7fac3efa91b4686592130e5f8a46 Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1585510 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
-rw-r--r--drivers/gpu/nvgpu/common/linux/dmabuf.h3
-rw-r--r--drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c1
-rw-r--r--drivers/gpu/nvgpu/common/linux/os_linux.h2
-rw-r--r--drivers/gpu/nvgpu/gk20a/gr_gk20a.c8
-rw-r--r--drivers/gpu/nvgpu/gk20a/mm_gk20a.h20
-rw-r--r--drivers/gpu/nvgpu/gk20a/sim_gk20a.c5
-rw-r--r--drivers/gpu/nvgpu/gp106/bios_gp106.c3
-rw-r--r--drivers/gpu/nvgpu/gp106/mclk_gp106.c1
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/linux/vm.h12
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);
70int gk20a_dmabuf_get_state(struct dma_buf *dmabuf, struct gk20a *g, 70int 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
73int 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
50struct gpfifo_desc { 35struct 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,
198extern const struct gk20a_mmu_level gk20a_mm_levels_64k[]; 183extern const struct gk20a_mmu_level gk20a_mm_levels_64k[];
199extern const struct gk20a_mmu_level gk20a_mm_levels_128k[]; 184extern const struct gk20a_mmu_level gk20a_mm_levels_128k[];
200 185
201int 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
34static inline void sim_writel(struct gk20a *g, u32 r, u32 v) 35static 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
22struct sg_table; 34struct sg_table;
23struct dma_buf; 35struct dma_buf;
24 36