diff options
author | Amulya <Amurthyreddy@nvidia.com> | 2018-08-09 01:10:08 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-08-22 20:31:33 -0400 |
commit | 1c13da1d29c344cb60953eabeca56b601446c64a (patch) | |
tree | 145a1a133b2d85592e0ddd1a25b12fc48e879829 /drivers/gpu/nvgpu/vgpu/gv11b | |
parent | f3c3e4dece89c5e2f77fbfaf3cacd877ba62406c (diff) |
gpu: nvgpu: Changed enum gmmu_pgsz_gk20a into macros
Changed the enum gmmu_pgsz_gk20a into macros and changed all the
instances of it.
The enum gmmu_pgsz_gk20a was being used in for loops, where it was
compared with an integer. This violates MISRA rule 10.4, which only
allows arithmetic operations on operands of the same essential type
category. Changing this enum into macro will fix this violation.
JIRA NVGPU-993
Change-Id: I6f18b08bc7548093d99e8229378415bcdec749e3
Signed-off-by: Amulya <Amurthyreddy@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1795593
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/vgpu/gv11b')
-rw-r--r-- | drivers/gpu/nvgpu/vgpu/gv11b/vgpu_fifo_gv11b.c | 10 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/vgpu/gv11b/vgpu_subctx_gv11b.c | 6 |
2 files changed, 8 insertions, 8 deletions
diff --git a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_fifo_gv11b.c b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_fifo_gv11b.c index e718a30d..43cff1c0 100644 --- a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_fifo_gv11b.c +++ b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_fifo_gv11b.c | |||
@@ -43,7 +43,7 @@ static int set_syncpt_ro_map_gpu_va_locked(struct vm_gk20a *vm) | |||
43 | 43 | ||
44 | vm->syncpt_ro_map_gpu_va = __nvgpu_vm_alloc_va(vm, | 44 | vm->syncpt_ro_map_gpu_va = __nvgpu_vm_alloc_va(vm, |
45 | g->syncpt_unit_size, | 45 | g->syncpt_unit_size, |
46 | gmmu_page_size_kernel); | 46 | GMMU_PAGE_SIZE_KERNEL); |
47 | if (!vm->syncpt_ro_map_gpu_va) { | 47 | if (!vm->syncpt_ro_map_gpu_va) { |
48 | nvgpu_err(g, "allocating read-only va space failed"); | 48 | nvgpu_err(g, "allocating read-only va space failed"); |
49 | return -ENOMEM; | 49 | return -ENOMEM; |
@@ -63,7 +63,7 @@ static int set_syncpt_ro_map_gpu_va_locked(struct vm_gk20a *vm) | |||
63 | "mapping read-only va space failed err %d", | 63 | "mapping read-only va space failed err %d", |
64 | err); | 64 | err); |
65 | __nvgpu_vm_free_va(vm, vm->syncpt_ro_map_gpu_va, | 65 | __nvgpu_vm_free_va(vm, vm->syncpt_ro_map_gpu_va, |
66 | gmmu_page_size_kernel); | 66 | GMMU_PAGE_SIZE_KERNEL); |
67 | vm->syncpt_ro_map_gpu_va = 0; | 67 | vm->syncpt_ro_map_gpu_va = 0; |
68 | return err; | 68 | return err; |
69 | } | 69 | } |
@@ -91,7 +91,7 @@ int vgpu_gv11b_fifo_alloc_syncpt_buf(struct channel_gk20a *c, | |||
91 | return err; | 91 | return err; |
92 | 92 | ||
93 | syncpt_buf->gpu_va = __nvgpu_vm_alloc_va(c->vm, g->syncpt_size, | 93 | syncpt_buf->gpu_va = __nvgpu_vm_alloc_va(c->vm, g->syncpt_size, |
94 | gmmu_page_size_kernel); | 94 | GMMU_PAGE_SIZE_KERNEL); |
95 | if (!syncpt_buf->gpu_va) { | 95 | if (!syncpt_buf->gpu_va) { |
96 | nvgpu_err(g, "allocating syncpt va space failed"); | 96 | nvgpu_err(g, "allocating syncpt va space failed"); |
97 | return -ENOMEM; | 97 | return -ENOMEM; |
@@ -110,7 +110,7 @@ int vgpu_gv11b_fifo_alloc_syncpt_buf(struct channel_gk20a *c, | |||
110 | if (err) { | 110 | if (err) { |
111 | nvgpu_err(g, "mapping syncpt va space failed err %d", err); | 111 | nvgpu_err(g, "mapping syncpt va space failed err %d", err); |
112 | __nvgpu_vm_free_va(c->vm, syncpt_buf->gpu_va, | 112 | __nvgpu_vm_free_va(c->vm, syncpt_buf->gpu_va, |
113 | gmmu_page_size_kernel); | 113 | GMMU_PAGE_SIZE_KERNEL); |
114 | return err; | 114 | return err; |
115 | } | 115 | } |
116 | 116 | ||
@@ -121,7 +121,7 @@ void vgpu_gv11b_fifo_free_syncpt_buf(struct channel_gk20a *c, | |||
121 | struct nvgpu_mem *syncpt_buf) | 121 | struct nvgpu_mem *syncpt_buf) |
122 | { | 122 | { |
123 | nvgpu_gmmu_unmap(c->vm, syncpt_buf, syncpt_buf->gpu_va); | 123 | nvgpu_gmmu_unmap(c->vm, syncpt_buf, syncpt_buf->gpu_va); |
124 | __nvgpu_vm_free_va(c->vm, syncpt_buf->gpu_va, gmmu_page_size_kernel); | 124 | __nvgpu_vm_free_va(c->vm, syncpt_buf->gpu_va, GMMU_PAGE_SIZE_KERNEL); |
125 | nvgpu_dma_free(c->g, syncpt_buf); | 125 | nvgpu_dma_free(c->g, syncpt_buf); |
126 | } | 126 | } |
127 | 127 | ||
diff --git a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_subctx_gv11b.c b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_subctx_gv11b.c index 2372b9c4..b536d15e 100644 --- a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_subctx_gv11b.c +++ b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_subctx_gv11b.c | |||
@@ -40,7 +40,7 @@ int vgpu_gv11b_alloc_subctx_header(struct channel_gk20a *c) | |||
40 | p->ch_handle = c->virt_ctx; | 40 | p->ch_handle = c->virt_ctx; |
41 | p->ctx_header_va = __nvgpu_vm_alloc_va(c->vm, | 41 | p->ctx_header_va = __nvgpu_vm_alloc_va(c->vm, |
42 | ctxsw_prog_fecs_header_v(), | 42 | ctxsw_prog_fecs_header_v(), |
43 | gmmu_page_size_kernel); | 43 | GMMU_PAGE_SIZE_KERNEL); |
44 | if (!p->ctx_header_va) { | 44 | if (!p->ctx_header_va) { |
45 | nvgpu_err(c->g, "alloc va failed for ctx_header"); | 45 | nvgpu_err(c->g, "alloc va failed for ctx_header"); |
46 | return -ENOMEM; | 46 | return -ENOMEM; |
@@ -50,7 +50,7 @@ int vgpu_gv11b_alloc_subctx_header(struct channel_gk20a *c) | |||
50 | if (unlikely(err)) { | 50 | if (unlikely(err)) { |
51 | nvgpu_err(c->g, "alloc ctx_header failed err %d", err); | 51 | nvgpu_err(c->g, "alloc ctx_header failed err %d", err); |
52 | __nvgpu_vm_free_va(c->vm, p->ctx_header_va, | 52 | __nvgpu_vm_free_va(c->vm, p->ctx_header_va, |
53 | gmmu_page_size_kernel); | 53 | GMMU_PAGE_SIZE_KERNEL); |
54 | return err; | 54 | return err; |
55 | } | 55 | } |
56 | ctx->mem.gpu_va = p->ctx_header_va; | 56 | ctx->mem.gpu_va = p->ctx_header_va; |
@@ -75,7 +75,7 @@ void vgpu_gv11b_free_subctx_header(struct channel_gk20a *c) | |||
75 | if (unlikely(err)) | 75 | if (unlikely(err)) |
76 | nvgpu_err(c->g, "free ctx_header failed err %d", err); | 76 | nvgpu_err(c->g, "free ctx_header failed err %d", err); |
77 | __nvgpu_vm_free_va(c->vm, ctx->mem.gpu_va, | 77 | __nvgpu_vm_free_va(c->vm, ctx->mem.gpu_va, |
78 | gmmu_page_size_kernel); | 78 | GMMU_PAGE_SIZE_KERNEL); |
79 | ctx->mem.gpu_va = 0; | 79 | ctx->mem.gpu_va = 0; |
80 | } | 80 | } |
81 | } | 81 | } |