From 477ca4b64888b02c211d0e0ea9d67544a88bd4b5 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Thu, 4 Jun 2015 12:15:36 -0700 Subject: gpu: nvgpu: gp10b: Fix clipping of alpha/beta size Alpha and beta sizes need to be clipped to a maximum value. For alpha CB we were using beta size in clipping, and for both we were not using number of TPCs to determine the max value. Change-Id: I0c925464ba4c9f575e6e59dd5ba7759aa1cb6381 Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/752667 Reviewed-by: Automatic_Commit_Validation_User --- drivers/gpu/nvgpu/gp10b/gr_gp10b.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/gpu/nvgpu/gp10b/gr_gp10b.c') diff --git a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c index c6f5022b..045847b2 100644 --- a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c @@ -267,9 +267,9 @@ static int gr_gp10b_calc_global_ctx_buffer_size(struct gk20a *g) + (gr->alpha_cb_default_size >> 1); gr->attrib_cb_size = min(gr->attrib_cb_size, - gr_gpc0_ppc0_cbm_beta_cb_size_v_f(0xffffffff)); - gr->alpha_cb_size = min(gr->attrib_cb_size, - gr_gpc0_ppc0_cbm_alpha_cb_size_v_f(0xffffffff)); + gr_gpc0_ppc0_cbm_beta_cb_size_v_f(~0) / g->gr.tpc_count); + gr->alpha_cb_size = min(gr->alpha_cb_size, + gr_gpc0_ppc0_cbm_alpha_cb_size_v_f(~0) / g->gr.tpc_count); size = gr->attrib_cb_size * gr_gpc0_ppc0_cbm_beta_cb_size_v_granularity_v() * -- cgit v1.2.2