2020-05-08 14:52:40 +00:00
|
|
|
From 0000000000000000000000000000000000000000 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
|
2020-09-14 17:24:57 +00:00
|
|
|
index de8a11abd66a..7e8c1a3c9b8f 100644
|
2020-04-23 20:47:21 +00:00
|
|
|
--- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c
|
|
|
|
+++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c
|
2020-06-03 18:47:28 +00:00
|
|
|
@@ -556,7 +556,7 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi,
|
2020-04-23 20:47:21 +00:00
|
|
|
*/
|
|
|
|
#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-06-30 14:24:22 +00:00
|
|
|
|
2020-04-23 20:47:21 +00:00
|
|
|
/*
|
|
|
|
* The backporch is set using a blanking packet (4
|
2020-06-03 18:47:28 +00:00
|
|
|
@@ -565,7 +565,7 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi,
|
2020-04-23 20:47:21 +00:00
|
|
|
*/
|
|
|
|
#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-06-30 14:24:22 +00:00
|
|
|
|
2020-04-23 20:47:21 +00:00
|
|
|
/*
|
|
|
|
* The frontporch is set using a sync event (4 bytes)
|
2020-06-03 18:47:28 +00:00
|
|
|
@@ -575,7 +575,7 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi,
|
2020-04-23 20:47:21 +00:00
|
|
|
*/
|
|
|
|
#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-06-30 14:24:22 +00:00
|
|
|
|
2020-04-23 20:47:21 +00:00
|
|
|
/*
|
|
|
|
* The blanking is set using a sync event (4 bytes)
|
2020-06-03 18:47:28 +00:00
|
|
|
@@ -584,8 +584,8 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi,
|
2020-04-23 20:47:21 +00:00
|
|
|
*/
|
|
|
|
#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-06-30 14:24:22 +00:00
|
|
|
|
2020-04-23 20:47:21 +00:00
|
|
|
/*
|
|
|
|
* And I'm not entirely sure what vblk is about. The driver in
|
|
|
|
--
|
2020-09-09 17:27:11 +00:00
|
|
|
2.28.0
|
2020-04-23 20:47:21 +00:00
|
|
|
|