dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 1/7] drm/kmb: Work around for higher system clock
@ 2021-10-13 23:36 Anitha Chrisanthus
  2021-10-13 23:36 ` [PATCH v3 2/7] drm/kmb: Limit supported mode to 1080p Anitha Chrisanthus
                   ` (6 more replies)
  0 siblings, 7 replies; 17+ messages in thread
From: Anitha Chrisanthus @ 2021-10-13 23:36 UTC (permalink / raw)
  To: dri-devel, anitha.chrisanthus; +Cc: sam, edmund.j.dea

Use a different value for system clock offset in the
ppl/llp ratio calculations for clocks higher than 500 Mhz.

Fixes: 98521f4d4b4c ("drm/kmb: Mipi DSI part of the display driver")
Signed-off-by: Anitha Chrisanthus <anitha.chrisanthus@intel.com>
---
 drivers/gpu/drm/kmb/kmb_dsi.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/kmb/kmb_dsi.c b/drivers/gpu/drm/kmb/kmb_dsi.c
index 1793cd31b117..86e8e7943e89 100644
--- a/drivers/gpu/drm/kmb/kmb_dsi.c
+++ b/drivers/gpu/drm/kmb/kmb_dsi.c
@@ -482,6 +482,10 @@ static u32 mipi_tx_fg_section_cfg(struct kmb_dsi *kmb_dsi,
 	return 0;
 }
 
+#define CLK_DIFF_LOW 50
+#define CLK_DIFF_HI 60
+#define SYSCLK_500  500
+
 static void mipi_tx_fg_cfg_regs(struct kmb_dsi *kmb_dsi, u8 frame_gen,
 				struct mipi_tx_frame_timing_cfg *fg_cfg)
 {
@@ -492,7 +496,12 @@ static void mipi_tx_fg_cfg_regs(struct kmb_dsi *kmb_dsi, u8 frame_gen,
 	/* 500 Mhz system clock minus 50 to account for the difference in
 	 * MIPI clock speed in RTL tests
 	 */
-	sysclk = kmb_dsi->sys_clk_mhz - 50;
+	if (kmb_dsi->sys_clk_mhz == SYSCLK_500) {
+		sysclk = kmb_dsi->sys_clk_mhz - CLK_DIFF_LOW;
+	} else {
+		/* 700 Mhz clk*/
+		sysclk = kmb_dsi->sys_clk_mhz - CLK_DIFF_HI;
+	}
 
 	/* PPL-Pixel Packing Layer, LLP-Low Level Protocol
 	 * Frame genartor timing parameters are clocked on the system clock,
-- 
2.25.1


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

end of thread, other threads:[~2021-10-15 17:17 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-13 23:36 [PATCH v3 1/7] drm/kmb: Work around for higher system clock Anitha Chrisanthus
2021-10-13 23:36 ` [PATCH v3 2/7] drm/kmb: Limit supported mode to 1080p Anitha Chrisanthus
2021-10-14 18:36   ` Sam Ravnborg
2021-10-13 23:36 ` [PATCH v3 3/7] drm/kmb: Remove clearing DPHY regs Anitha Chrisanthus
2021-10-14 18:37   ` Sam Ravnborg
2021-10-13 23:36 ` [PATCH v3 4/7] drm/kmb: Disable change of plane parameters Anitha Chrisanthus
2021-10-14 18:39   ` Sam Ravnborg
2021-10-13 23:36 ` [PATCH v3 5/7] drm/kmb: Corrected typo in handle_lcd_irq Anitha Chrisanthus
2021-10-14 18:40   ` Sam Ravnborg
2021-10-13 23:36 ` [PATCH v3 6/7] drm/kmb: Enable ADV bridge after modeset Anitha Chrisanthus
2021-10-14 18:44   ` Sam Ravnborg
2021-10-13 23:36 ` [PATCH v3 7/7] drm/kmb: Enable support for framebuffer console Anitha Chrisanthus
2021-10-14 12:50   ` Thomas Zimmermann
2021-10-15 17:17     ` Chrisanthus, Anitha
2021-10-14 13:08   ` Thomas Zimmermann
2021-10-15 17:16     ` Chrisanthus, Anitha
2021-10-14 18:33 ` [PATCH v3 1/7] drm/kmb: Work around for higher system clock Sam Ravnborg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox