From a9b9597a108f8dacb01696c5e0f1c7a2e9f52def Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Thu, 18 Feb 2016 11:23:44 -0800 Subject: 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 Reviewed-on: http://git-master/r/1013517 (cherry picked from commit 544446aacdc695dc2e27c42a0086292cd69c2eee) Reviewed-on: http://git-master/r/1031009 GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/gk20a/mm_gk20a.c | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) (limited to 'drivers/gpu') 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 @@ /* * GK20A memory management * - * Copyright (c) 2011-2017, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2011-2016, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -1290,12 +1290,6 @@ u64 gk20a_locked_gmmu_map(struct vm_gk20a *vm, int ctag_granularity = g->ops.fb.compression_page_size(g); u32 ctag_lines = DIV_ROUND_UP_ULL(size, ctag_granularity); - if (clear_ctags && ctag_offset) { - /* init/clear the ctag buffer */ - g->ops.ltc.cbc_ctrl(g, gk20a_cbc_op_clear, - ctag_offset, ctag_offset + ctag_lines - 1); - } - /* Allocate (or validate when map_offset != 0) the virtual address. */ if (!map_offset) { map_offset = gk20a_vm_alloc_va(vm, size, @@ -1651,17 +1645,14 @@ u64 gk20a_vm_map(struct vm_gk20a *vm, bfr.kind_v = bfr.uc_kind_v; } else { gk20a_get_comptags(d, dmabuf, &comptags); - clear_ctags = true; - - if (comptags.lines < comptags.allocated_lines) { - /* clear tail-padding comptags */ - u32 ctagmin = comptags.offset + comptags.lines; - u32 ctagmax = comptags.offset + - comptags.allocated_lines - 1; + if (g->ops.ltc.cbc_ctrl) g->ops.ltc.cbc_ctrl(g, gk20a_cbc_op_clear, - ctagmin, ctagmax); - } + comptags.offset, + comptags.offset + + comptags.allocated_lines - 1); + else + clear_ctags = true; } } -- cgit v1.2.2