Skip to content

Commit c8a5704

Browse files
committed
drm/mcde: Fix off by 10^3 in calculation
The calclulation of how many bytes we stuff into the DSI pipeline for video mode panels is off by three orders of magnitude because we did not account for the fact that the DRM mode clock is in kilohertz rather than hertz. This used to be: drm_mode_vrefresh(mode) * mode->htotal * mode->vtotal which would become for example for s6e63m0: 60 x 514 x 831 = 25628040 Hz, but mode->clock is 25628 as it is in kHz. This affects only the Samsung GT-I8190 "Golden" phone right now since it is the only MCDE device with a video mode display. Curiously some specimen work with this code and wild settings in the EOL and empty packets at the end of the display, but I have noticed an eeire flicker until now. Others were not so lucky and got black screens. Cc: Ville Syrjälä <[email protected]> Reported-by: Stephan Gerhold <[email protected]> Fixes: 920dd1b ("drm/mcde: Use mode->clock instead of reverse calculating it from the vrefresh") Signed-off-by: Linus Walleij <[email protected]> Tested-by: Stephan Gerhold <[email protected]> Reviewed-by: Stephan Gerhold <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent b436acd commit c8a5704

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/mcde/mcde_dsi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ static void mcde_dsi_setup_video_mode(struct mcde_dsi *d,
577577
* porches and sync.
578578
*/
579579
/* (ps/s) / (pixels/s) = ps/pixels */
580-
pclk = DIV_ROUND_UP_ULL(1000000000000, mode->clock);
580+
pclk = DIV_ROUND_UP_ULL(1000000000000, (mode->clock * 1000));
581581
dev_dbg(d->dev, "picoseconds between two pixels: %llu\n",
582582
pclk);
583583

0 commit comments

Comments
 (0)