diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/mm_gk20a.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c index 08dd41c5..c37f790e 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c | |||
@@ -1685,7 +1685,7 @@ static int update_gmmu_ptes_locked(struct vm_gk20a *vm, | |||
1685 | struct scatterlist *cur_chunk; | 1685 | struct scatterlist *cur_chunk; |
1686 | unsigned int cur_offset; | 1686 | unsigned int cur_offset; |
1687 | u32 pte_w[2] = {0, 0}; /* invalid pte */ | 1687 | u32 pte_w[2] = {0, 0}; /* invalid pte */ |
1688 | u32 ctag = ctag_offset; | 1688 | u32 ctag = ctag_offset * SZ_128K; |
1689 | u32 ctag_incr; | 1689 | u32 ctag_incr; |
1690 | u32 page_size = vm->gmmu_page_sizes[pgsz_idx]; | 1690 | u32 page_size = vm->gmmu_page_sizes[pgsz_idx]; |
1691 | u64 addr = 0; | 1691 | u64 addr = 0; |
@@ -1700,7 +1700,7 @@ static int update_gmmu_ptes_locked(struct vm_gk20a *vm, | |||
1700 | /* If ctag_offset !=0 add 1 else add 0. The idea is to avoid a branch | 1700 | /* If ctag_offset !=0 add 1 else add 0. The idea is to avoid a branch |
1701 | * below (per-pte). Note: this doesn't work unless page size (when | 1701 | * below (per-pte). Note: this doesn't work unless page size (when |
1702 | * comptags are active) is 128KB. We have checks elsewhere for that. */ | 1702 | * comptags are active) is 128KB. We have checks elsewhere for that. */ |
1703 | ctag_incr = !!ctag_offset; | 1703 | ctag_incr = ctag_offset ? page_size : 0; |
1704 | 1704 | ||
1705 | cur_offset = 0; | 1705 | cur_offset = 0; |
1706 | if (sgt) { | 1706 | if (sgt) { |
@@ -1769,7 +1769,7 @@ static int update_gmmu_ptes_locked(struct vm_gk20a *vm, | |||
1769 | >> gmmu_pte_address_shift_v()); | 1769 | >> gmmu_pte_address_shift_v()); |
1770 | pte_w[1] = gmmu_pte_aperture_video_memory_f() | | 1770 | pte_w[1] = gmmu_pte_aperture_video_memory_f() | |
1771 | gmmu_pte_kind_f(kind_v) | | 1771 | gmmu_pte_kind_f(kind_v) | |
1772 | gmmu_pte_comptagline_f(ctag); | 1772 | gmmu_pte_comptagline_f(ctag / SZ_128K); |
1773 | 1773 | ||
1774 | if (rw_flag == gk20a_mem_flag_read_only) { | 1774 | if (rw_flag == gk20a_mem_flag_read_only) { |
1775 | pte_w[0] |= gmmu_pte_read_only_true_f(); | 1775 | pte_w[0] |= gmmu_pte_read_only_true_f(); |