From 7d917f43a5a8abc41988e606ef5e7311dcf23ff8 Mon Sep 17 00:00:00 2001 From: Kevin Huang Date: Fri, 23 May 2014 13:45:57 -0700 Subject: gpu: nvgpu: gm20b: fix compression sharing For GM20B alone, the LTC count is already accounted for the HW logic for the CBC base calculation from the postDivide address. So SW doesn't have to explicity divide it by the LTC count in the postDivide address calculation. Bug 1477079 Change-Id: I558bbe66bbcfb7edfa21210d0dc22c6170149260 Signed-off-by: Kevin Huang Reviewed-on: http://git-master/r/414264 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gm20b/ltc_gm20b.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'drivers/gpu/nvgpu/gm20b') diff --git a/drivers/gpu/nvgpu/gm20b/ltc_gm20b.c b/drivers/gpu/nvgpu/gm20b/ltc_gm20b.c index 43c90970..91046d93 100644 --- a/drivers/gpu/nvgpu/gm20b/ltc_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/ltc_gm20b.c @@ -237,6 +237,19 @@ static void gm20b_ltc_g_elpg_flush_locked(struct gk20a *g) "g_elpg_flush too many retries"); } +u32 gm20b_ltc_cbc_fix_config(struct gk20a *g, int base) +{ + u32 val = gk20a_readl(g, ltc_ltcs_ltss_cbc_num_active_ltcs_r()); + if (val == 2) { + return base * 2; + } else if (val != 1) { + gk20a_err(dev_from_gk20a(g), + "Invalid number of active ltcs: %08x\n", val); + } + + return base; +} + void gm20b_init_ltc(struct gpu_ops *gops) { /* Gk20a reused ops. */ @@ -255,4 +268,5 @@ void gm20b_init_ltc(struct gpu_ops *gops) gops->ltc.cbc_ctrl = gm20b_ltc_cbc_ctrl; gops->ltc.elpg_flush = gm20b_ltc_g_elpg_flush_locked; gops->ltc.isr = gm20b_ltc_isr; + gops->ltc.cbc_fix_config = gm20b_ltc_cbc_fix_config; } -- cgit v1.2.2