summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2016-02-18 14:23:44 -0500
committerTerje Bergstrom <tbergstrom@nvidia.com>2016-03-22 13:02:10 -0400
commita9b9597a108f8dacb01696c5e0f1c7a2e9f52def (patch)
tree854b87b974cb5b103df1202a3ec0ffe064e1c80a /drivers
parent704f29335f75a4e873f5106ad33fcf94b9fcaf2f (diff)
gpu: nvgpu: Clear comptags for whole buffer
Clear comptags for whole buffer when nvgpu sees the buffer for the first time. Change-Id: I67108ce0f0def46ddda1aa9b9bb5ea22549cce13 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/1013517 (cherry picked from commit 544446aacdc695dc2e27c42a0086292cd69c2eee) Reviewed-on: http://git-master/r/1031009 GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/nvgpu/gk20a/mm_gk20a.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
index 738df2af..660fbb6f 100644
--- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * GK20A memory management 2 * GK20A memory management
3 * 3 *
4 * Copyright (c) 2011-2017, NVIDIA CORPORATION. All rights reserved. 4 * Copyright (c) 2011-2016, NVIDIA CORPORATION. All rights reserved.
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify it 6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License, 7 * under the terms and conditions of the GNU General Public License,
@@ -1290,12 +1290,6 @@ u64 gk20a_locked_gmmu_map(struct vm_gk20a *vm,
1290 int ctag_granularity = g->ops.fb.compression_page_size(g); 1290 int ctag_granularity = g->ops.fb.compression_page_size(g);
1291 u32 ctag_lines = DIV_ROUND_UP_ULL(size, ctag_granularity); 1291 u32 ctag_lines = DIV_ROUND_UP_ULL(size, ctag_granularity);
1292 1292
1293 if (clear_ctags && ctag_offset) {
1294 /* init/clear the ctag buffer */
1295 g->ops.ltc.cbc_ctrl(g, gk20a_cbc_op_clear,
1296 ctag_offset, ctag_offset + ctag_lines - 1);
1297 }
1298
1299 /* Allocate (or validate when map_offset != 0) the virtual address. */ 1293 /* Allocate (or validate when map_offset != 0) the virtual address. */
1300 if (!map_offset) { 1294 if (!map_offset) {
1301 map_offset = gk20a_vm_alloc_va(vm, size, 1295 map_offset = gk20a_vm_alloc_va(vm, size,
@@ -1651,17 +1645,14 @@ u64 gk20a_vm_map(struct vm_gk20a *vm,
1651 bfr.kind_v = bfr.uc_kind_v; 1645 bfr.kind_v = bfr.uc_kind_v;
1652 } else { 1646 } else {
1653 gk20a_get_comptags(d, dmabuf, &comptags); 1647 gk20a_get_comptags(d, dmabuf, &comptags);
1654 clear_ctags = true;
1655
1656 if (comptags.lines < comptags.allocated_lines) {
1657 /* clear tail-padding comptags */
1658 u32 ctagmin = comptags.offset + comptags.lines;
1659 u32 ctagmax = comptags.offset +
1660 comptags.allocated_lines - 1;
1661 1648
1649 if (g->ops.ltc.cbc_ctrl)
1662 g->ops.ltc.cbc_ctrl(g, gk20a_cbc_op_clear, 1650 g->ops.ltc.cbc_ctrl(g, gk20a_cbc_op_clear,
1663 ctagmin, ctagmax); 1651 comptags.offset,
1664 } 1652 comptags.offset +
1653 comptags.allocated_lines - 1);
1654 else
1655 clear_ctags = true;
1665 } 1656 }
1666 } 1657 }
1667 1658