devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] drm/mediatek: fix up 1440x900 dp display black screen issue
@ 2019-11-26  6:47 yongqiang.niu
  2019-11-27  1:31 ` CK Hu
  0 siblings, 1 reply; 2+ messages in thread
From: yongqiang.niu @ 2019-11-26  6:47 UTC (permalink / raw)
  To: CK Hu, Philipp Zabel, Rob Herring, Matthias Brugger
  Cc: David Airlie, Daniel Vetter, Mark Rutland, dri-devel, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek, Yongqiang Niu

From: Yongqiang Niu <yongqiang.niu@mediatek.com>

This patch fix up 1440x900 dp display black screen issue
the computed result will overflow rdma1 fifo max size
when external display pixel clock bigger than 74MHZ

Signed-off-by: Yongqiang Niu <yongqiang.niu@mediatek.com>
---
 drivers/gpu/drm/mediatek/mtk_disp_rdma.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/mediatek/mtk_disp_rdma.c b/drivers/gpu/drm/mediatek/mtk_disp_rdma.c
index c1abde3..41143f5 100644
--- a/drivers/gpu/drm/mediatek/mtk_disp_rdma.c
+++ b/drivers/gpu/drm/mediatek/mtk_disp_rdma.c
@@ -152,6 +152,10 @@ static void mtk_rdma_config(struct mtk_ddp_comp *comp, unsigned int width,
 	 * account for blanking, and with a pixel depth of 4 bytes:
 	 */
 	threshold = width * height * vrefresh * 4 * 7 / 1000000;
+
+	if (threshold > rdma_fifo_size)
+		threshold = rdma_fifo_size;
+
 	reg = RDMA_FIFO_UNDERFLOW_EN |
 	      RDMA_FIFO_PSEUDO_SIZE(rdma_fifo_size) |
 	      RDMA_OUTPUT_VALID_FIFO_THRESHOLD(threshold);
-- 
1.8.1.1.dirty

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-11-27  1:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-26  6:47 [PATCH v1] drm/mediatek: fix up 1440x900 dp display black screen issue yongqiang.niu
2019-11-27  1:31 ` CK Hu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).