Commit ef668f27 authored by Yongqiang Niu's avatar Yongqiang Niu Committed by Chun-Kuang Hu
Browse files

drm/mediatek: Adjust rdma fifo threshold calculate formula



The orginal formula will caused rdma fifo threshold config overflow
and no one could come out a solution for all SoC,
set threshold to 70% of max fifo size to make sure it will
not overflow, and 70% is a empirical vlaue.

Signed-off-by: default avatarYongqiang Niu <yongqiang.niu@mediatek.com>
Signed-off-by: default avatarChun-Kuang Hu <chunkuang.hu@kernel.org>
parent e73f0f0e
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -162,10 +162,10 @@ void mtk_rdma_config(struct device *dev, unsigned int width,
	/*
	 * Enable FIFO underflow since DSI and DPI can't be blocked.
	 * Keep the FIFO pseudo size reset default of 8 KiB. Set the
	 * output threshold to 6 microseconds with 7/6 overhead to
	 * account for blanking, and with a pixel depth of 4 bytes:
	 * output threshold to 70% of max fifo size to make sure the
	 * threhold will not overflow
	 */
	threshold = width * height * vrefresh * 4 * 7 / 1000000;
	threshold = rdma_fifo_size * 7 / 10;
	reg = RDMA_FIFO_UNDERFLOW_EN |
	      RDMA_FIFO_PSEUDO_SIZE(rdma_fifo_size) |
	      RDMA_OUTPUT_VALID_FIFO_THRESHOLD(threshold);