From 18268185ec12f27cc1da76edb54ac133dab06aef Mon Sep 17 00:00:00 2001 From: Sami Kiminki Date: Thu, 30 Nov 2017 21:42:22 +0200 Subject: gpu: nvgpu: Increase programmed ctagline at compr page boundaries Increase the ctagline that is programmed in the page tables when the buffer offset crosses the compression page boundaries. This fixes compressible-kind fixed-address mapping with 4k pages when the GPU VA is not aligned by the compression page size. Bug 1995897 Bug 2011640 Bug 2011668 Change-Id: I1f1f9750635a20a916527c9d18fda7f8aa6b1b1f Signed-off-by: Sami Kiminki Reviewed-on: https://git-master.nvidia.com/r/1608465 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/mm/gmmu.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'drivers/gpu/nvgpu/common/mm/gmmu.c') diff --git a/drivers/gpu/nvgpu/common/mm/gmmu.c b/drivers/gpu/nvgpu/common/mm/gmmu.c index 8d78212b..62c84e96 100644 --- a/drivers/gpu/nvgpu/common/mm/gmmu.c +++ b/drivers/gpu/nvgpu/common/mm/gmmu.c @@ -691,6 +691,14 @@ u64 gk20a_locked_gmmu_map(struct vm_gk20a *vm, .aperture = aperture }; + /* + * We need to add the buffer_offset within compression_page_size so that + * the programmed ctagline gets increased at compression_page_size + * boundaries. + */ + if (attrs.ctag) + attrs.ctag += buffer_offset & (ctag_granularity - 1U); + #ifdef CONFIG_TEGRA_19x_GPU nvgpu_gmmu_add_t19x_attrs(&attrs, flags); #endif -- cgit v1.2.2