From 42d17018b442850f246696364d79a2ae11350a12 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Fri, 20 Mar 2015 09:43:26 -0700 Subject: gpu: nvgpu: Use common allocator for compbit store Reduce amount of duplicate code around memory allocation by using common helpers, and common data structure for storing results of allocations. Bug 1605769 Change-Id: I7c1662b669ed8c86465254f6001e536141051ee5 Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/720435 --- drivers/gpu/nvgpu/gk20a/ltc_gk20a.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/ltc_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/ltc_gk20a.c b/drivers/gpu/nvgpu/gk20a/ltc_gk20a.c index 1a780212..c5d0f0c4 100644 --- a/drivers/gpu/nvgpu/gk20a/ltc_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/ltc_gk20a.c @@ -51,10 +51,8 @@ static int gk20a_ltc_init_comptags(struct gk20a *g, struct gr_gk20a *gr) gk20a_dbg_fn(""); - if (max_comptag_lines == 0) { - gr->compbit_store.size = 0; + if (max_comptag_lines == 0) return 0; - } if (max_comptag_lines > hw_max_comptag_lines) max_comptag_lines = hw_max_comptag_lines; @@ -117,7 +115,7 @@ static int gk20a_ltc_cbc_ctrl(struct gk20a *g, enum gk20a_cbc_op op, trace_gk20a_ltc_cbc_ctrl_start(g->dev->name, op, min, max); - if (gr->compbit_store.size == 0) + if (gr->compbit_store.mem.size == 0) return 0; mutex_lock(&g->mm.l2_op_lock); -- cgit v1.2.2