On 5/13/26 15:10, Tomi Valkeinen wrote:
The powertip,ph800480t013-idf02 panel was added to panel-simple, and
with the tc358762 driver, enabled the use of RaspberryPi 7" DSI display.

I have been testing the RaspberryPi 7" DSI display module with TI's
BeagleY-AI, and I can't get a good image with the current panel timings.

It's been quite difficult to figure out exactly what are the issues.
Possibly RPi DSI TX and TI DSI TX have their own quirks which affect
this also. However, now that the tc358762 driver has been fixed wrt. the
signal timings it sends, this patch makes the panel work fine on
BeagleY-AI.

Fix the timings according to the datasheet:

- hsw + hbp must equal to 46. This was correct in the timings, but the
   hsw was very tight, and at least Cadence DSI has trouble with such
   short hsync. Increase hsw to the middle of the hsw range from the
   datasheet, and decrease hbp accordingly.
- vsw + vbp must equal to 23. This was 24, resulting in slight shift in
   the image.
- The upstream timings seemed to aim for 50 fps, but this is a normal 60
   fps panel, so adjust the timings to get 60 fps. As there's no strict
   rule what numbers to pick here, I used the "typical" values from panel
   datasheet for pclk, hfp and vfp. However, vfp of 23 instead of the
   datasheet's 22 give us a closer match to 60 fps, so I used that.

Signed-off-by: Tomi Valkeinen <[email protected]>
---
  drivers/gpu/drm/panel/panel-simple.c | 14 +++++++-------
  1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-simple.c 
b/drivers/gpu/drm/panel/panel-simple.c
index 91ab280869ba..16aeafd2b02e 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -4041,15 +4041,15 @@ static const struct panel_desc 
powertip_ph128800t006_zhc01 = {
  };
static const struct drm_display_mode powertip_ph800480t013_idf02_mode = {
-       .clock = 24750,
+       .clock = 33333,
        .hdisplay = 800,
-       .hsync_start = 800 + 54,
-       .hsync_end = 800 + 54 + 2,
-       .htotal = 800 + 54 + 2 + 44,
+       .hsync_start = 800 + 210,
+       .hsync_end = 800 + 210 + 20,
+       .htotal = 800 + 210 + 20 + 26,
        .vdisplay = 480,
-       .vsync_start = 480 + 49,
-       .vsync_end = 480 + 49 + 2,
-       .vtotal = 480 + 49 + 2 + 22,
+       .vsync_start = 480 + 23,
+       .vsync_end = 480 + 23 + 2,
+       .vtotal = 480 + 23 + 2 + 21,
        .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
  };

Reviewed-by: Neil Armstrong <[email protected]>

Thanks,
Neil

Reply via email to