Skip to content

Commit ef668f2

Browse files
Yongqiang NiuChun-Kuang Hu
authored andcommitted
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: Yongqiang Niu <[email protected]> Signed-off-by: Chun-Kuang Hu <[email protected]>
1 parent e73f0f0 commit ef668f2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/gpu/drm/mediatek/mtk_disp_rdma.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,10 @@ void mtk_rdma_config(struct device *dev, unsigned int width,
162162
/*
163163
* Enable FIFO underflow since DSI and DPI can't be blocked.
164164
* Keep the FIFO pseudo size reset default of 8 KiB. Set the
165-
* output threshold to 6 microseconds with 7/6 overhead to
166-
* account for blanking, and with a pixel depth of 4 bytes:
165+
* output threshold to 70% of max fifo size to make sure the
166+
* threhold will not overflow
167167
*/
168-
threshold = width * height * vrefresh * 4 * 7 / 1000000;
168+
threshold = rdma_fifo_size * 7 / 10;
169169
reg = RDMA_FIFO_UNDERFLOW_EN |
170170
RDMA_FIFO_PSEUDO_SIZE(rdma_fifo_size) |
171171
RDMA_OUTPUT_VALID_FIFO_THRESHOLD(threshold);

0 commit comments

Comments
 (0)