2020-04-27 02:15:20 +00:00
|
|
|
From ea32428508d21519cbca1020710ccf7c7d1b488c Mon Sep 17 00:00:00 2001
|
2020-04-23 20:47:21 +00:00
|
|
|
From: Icenowy Zheng <icenowy@aosc.io>
|
|
|
|
Date: Mon, 16 Mar 2020 21:35:02 +0800
|
|
|
|
Subject: [PATCH] drm/sun4i: sun6i_mipi_dsi: fix horizontal timing calculation
|
|
|
|
|
|
|
|
The max() function call in horizontal timing calculation shouldn't pad a
|
|
|
|
length already subtracted with overhead to overhead, instead it should
|
|
|
|
only prevent the set timing to underflow.
|
|
|
|
|
|
|
|
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
|
|
|
|
---
|
|
|
|
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 10 +++++-----
|
|
|
|
1 file changed, 5 insertions(+), 5 deletions(-)
|
|
|
|
|
|
|
|
diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c
|
|
|
|
index 059939789730..5f2313c40328 100644
|
|
|
|
--- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c
|
|
|
|
+++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c
|
|
|
|
@@ -555,7 +555,7 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi,
|
|
|
|
*/
|
|
|
|
#define HSA_PACKET_OVERHEAD 10
|
|
|
|
hsa = max((unsigned int)HSA_PACKET_OVERHEAD,
|
|
|
|
- (mode->hsync_end - mode->hsync_start) * Bpp - HSA_PACKET_OVERHEAD);
|
|
|
|
+ (mode->hsync_end - mode->hsync_start) * Bpp) - HSA_PACKET_OVERHEAD;
|
2020-04-27 02:15:20 +00:00
|
|
|
|
2020-04-23 20:47:21 +00:00
|
|
|
/*
|
|
|
|
* The backporch is set using a blanking packet (4
|
|
|
|
@@ -564,7 +564,7 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi,
|
|
|
|
*/
|
|
|
|
#define HBP_PACKET_OVERHEAD 6
|
|
|
|
hbp = max((unsigned int)HBP_PACKET_OVERHEAD,
|
|
|
|
- (mode->htotal - mode->hsync_end) * Bpp - HBP_PACKET_OVERHEAD);
|
|
|
|
+ (mode->htotal - mode->hsync_end) * Bpp) - HBP_PACKET_OVERHEAD;
|
2020-04-27 02:15:20 +00:00
|
|
|
|
2020-04-23 20:47:21 +00:00
|
|
|
/*
|
|
|
|
* The frontporch is set using a sync event (4 bytes)
|
|
|
|
@@ -574,7 +574,7 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi,
|
|
|
|
*/
|
|
|
|
#define HFP_PACKET_OVERHEAD 16
|
|
|
|
hfp = max((unsigned int)HFP_PACKET_OVERHEAD,
|
|
|
|
- (mode->hsync_start - mode->hdisplay) * Bpp - HFP_PACKET_OVERHEAD);
|
|
|
|
+ (mode->hsync_start - mode->hdisplay) * Bpp) - HFP_PACKET_OVERHEAD;
|
2020-04-27 02:15:20 +00:00
|
|
|
|
2020-04-23 20:47:21 +00:00
|
|
|
/*
|
|
|
|
* The blanking is set using a sync event (4 bytes)
|
|
|
|
@@ -583,8 +583,8 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi,
|
|
|
|
*/
|
|
|
|
#define HBLK_PACKET_OVERHEAD 10
|
|
|
|
hblk = max((unsigned int)HBLK_PACKET_OVERHEAD,
|
|
|
|
- (mode->htotal - (mode->hsync_end - mode->hsync_start)) * Bpp -
|
|
|
|
- HBLK_PACKET_OVERHEAD);
|
|
|
|
+ (mode->htotal - (mode->hsync_end - mode->hsync_start)) * Bpp) -
|
|
|
|
+ HBLK_PACKET_OVERHEAD;
|
2020-04-27 02:15:20 +00:00
|
|
|
|
2020-04-23 20:47:21 +00:00
|
|
|
/*
|
|
|
|
* And I'm not entirely sure what vblk is about. The driver in
|
|
|
|
--
|
2020-04-27 02:15:20 +00:00
|
|
|
2.26.2
|
2020-04-23 20:47:21 +00:00
|
|
|
|