Browse Source

Merge "disp: msm: sde: fix traffic shaper prefill calculations"

qctecmdr 3 years ago
parent
commit
af3b57299d
1 changed files with 3 additions and 6 deletions
  1. 3 6
      msm/sde/sde_hw_sspp.c

+ 3 - 6
msm/sde/sde_hw_sspp.c

@@ -1082,17 +1082,14 @@ static void sde_hw_sspp_setup_ts_prefill(struct sde_hw_pipe *ctx,
 	}
 	}
 
 
 	if (cfg->time) {
 	if (cfg->time) {
-		u64 temp = DIV_ROUND_UP_ULL(TS_CLK * 1000000ULL, cfg->time);
-
-		ts_bytes = temp * cfg->size;
+		ts_count = DIV_ROUND_UP_ULL(TS_CLK * cfg->time, 1000000ULL);
+		ts_bytes = DIV_ROUND_UP_ULL(cfg->size, ts_count);
 		if (ts_bytes > SSPP_TRAFFIC_SHAPER_BPC_MAX)
 		if (ts_bytes > SSPP_TRAFFIC_SHAPER_BPC_MAX)
 			ts_bytes = SSPP_TRAFFIC_SHAPER_BPC_MAX;
 			ts_bytes = SSPP_TRAFFIC_SHAPER_BPC_MAX;
 	}
 	}
 
 
-	if (ts_bytes) {
-		ts_count = DIV_ROUND_UP_ULL(cfg->size, ts_bytes);
+	if (ts_count)
 		ts_bytes |= BIT(31) | BIT(27);
 		ts_bytes |= BIT(31) | BIT(27);
-	}
 
 
 	SDE_REG_WRITE(&ctx->hw, ts_offset, ts_bytes);
 	SDE_REG_WRITE(&ctx->hw, ts_offset, ts_bytes);
 	SDE_REG_WRITE(&ctx->hw, ts_prefill_offset, ts_count);
 	SDE_REG_WRITE(&ctx->hw, ts_prefill_offset, ts_count);