diff options
Diffstat (limited to 'drivers/gpu/nvgpu/common/mm/vm.c')
-rw-r--r-- | drivers/gpu/nvgpu/common/mm/vm.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/drivers/gpu/nvgpu/common/mm/vm.c b/drivers/gpu/nvgpu/common/mm/vm.c index 7a451956..c3f6b79d 100644 --- a/drivers/gpu/nvgpu/common/mm/vm.c +++ b/drivers/gpu/nvgpu/common/mm/vm.c | |||
@@ -774,7 +774,8 @@ struct nvgpu_mapped_buf *nvgpu_vm_map(struct vm_gk20a *vm, | |||
774 | 774 | ||
775 | binfo.flags = flags; | 775 | binfo.flags = flags; |
776 | binfo.size = nvgpu_os_buf_get_size(os_buf); | 776 | binfo.size = nvgpu_os_buf_get_size(os_buf); |
777 | binfo.compr_kind = compr_kind; | 777 | binfo.compr_kind = (vm->enable_ctag && compr_kind != NV_KIND_INVALID ? |
778 | compr_kind : NV_KIND_INVALID); | ||
778 | binfo.incompr_kind = incompr_kind; | 779 | binfo.incompr_kind = incompr_kind; |
779 | 780 | ||
780 | if (compr_kind != NV_KIND_INVALID) | 781 | if (compr_kind != NV_KIND_INVALID) |
@@ -847,13 +848,7 @@ struct nvgpu_mapped_buf *nvgpu_vm_map(struct vm_gk20a *vm, | |||
847 | goto clean_up; | 848 | goto clean_up; |
848 | } | 849 | } |
849 | 850 | ||
850 | /* | 851 | if (binfo.compr_kind != NV_KIND_INVALID) { |
851 | * bar1 and pmu VMs don't need ctags. | ||
852 | */ | ||
853 | if (!vm->enable_ctag) | ||
854 | binfo.ctag_lines = 0; | ||
855 | |||
856 | if (binfo.ctag_lines) { | ||
857 | struct gk20a_comptags comptags = { 0 }; | 852 | struct gk20a_comptags comptags = { 0 }; |
858 | 853 | ||
859 | /* | 854 | /* |
@@ -861,7 +856,7 @@ struct nvgpu_mapped_buf *nvgpu_vm_map(struct vm_gk20a *vm, | |||
861 | */ | 856 | */ |
862 | err = gk20a_alloc_or_get_comptags(g, os_buf, | 857 | err = gk20a_alloc_or_get_comptags(g, os_buf, |
863 | &g->gr.comp_tags, | 858 | &g->gr.comp_tags, |
864 | binfo.ctag_lines, &comptags); | 859 | &comptags); |
865 | if (err) { | 860 | if (err) { |
866 | /* | 861 | /* |
867 | * This is an irrecoverable failure and we need to | 862 | * This is an irrecoverable failure and we need to |
@@ -1116,7 +1111,6 @@ static int nvgpu_vm_compute_compression(struct vm_gk20a *vm, | |||
1116 | { | 1111 | { |
1117 | bool kind_compressible = (binfo->compr_kind != NV_KIND_INVALID); | 1112 | bool kind_compressible = (binfo->compr_kind != NV_KIND_INVALID); |
1118 | struct gk20a *g = gk20a_from_vm(vm); | 1113 | struct gk20a *g = gk20a_from_vm(vm); |
1119 | int ctag_granularity = g->ops.fb.compression_page_size(g); | ||
1120 | 1114 | ||
1121 | if (kind_compressible && | 1115 | if (kind_compressible && |
1122 | vm->gmmu_page_sizes[binfo->pgsz_idx] < | 1116 | vm->gmmu_page_sizes[binfo->pgsz_idx] < |
@@ -1138,9 +1132,5 @@ static int nvgpu_vm_compute_compression(struct vm_gk20a *vm, | |||
1138 | } | 1132 | } |
1139 | } | 1133 | } |
1140 | 1134 | ||
1141 | if (kind_compressible) | ||
1142 | binfo->ctag_lines = DIV_ROUND_UP_ULL(binfo->size, | ||
1143 | ctag_granularity); | ||
1144 | |||
1145 | return 0; | 1135 | return 0; |
1146 | } | 1136 | } |