]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
gpu: nvgpu: Align VA of compressible buffer
authorTerje Bergstrom <tbergstrom@nvidia.com>
Tue, 31 Mar 2015 20:20:51 +0000 (13:20 -0700)
committerTerje Bergstrom <tbergstrom@nvidia.com>
Wed, 8 Apr 2015 19:05:16 +0000 (12:05 -0700)
Ensure that the GPU VA for a buffer is aligned correctly if
compression is enabled.

Bug 1605769

Change-Id: I12566ddd554da7cc9fb41dd553576c534ac96ba8
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/725767

drivers/gpu/nvgpu/gk20a/mm_gk20a.c

index e7d06587a18e9ac66c6e7a5adb51caa509a7d547..c816836e3c8c51dd6c4d4ba43129020233e455c4 100644 (file)
@@ -1378,6 +1378,11 @@ u64 gk20a_vm_map(struct vm_gk20a *vm,
 
        gk20a_get_comptags(d, dmabuf, &comptags);
 
+       /* ensure alignment to compression page size if compression enabled */
+       if (bfr.ctag_offset)
+               mapping_size = ALIGN(mapping_size,
+                                    g->ops.fb.compression_page_size(g));
+
        if (bfr.ctag_lines && !comptags.lines) {
                /* allocate compression resources if needed */
                err = gk20a_alloc_comptags(d, dmabuf, ctag_allocator,