2
0
mirror of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-09-04 20:19:47 +08:00
linux/drivers/gpu/drm/meson
Martin Blumenstingl 0cee6c4d35 drm/meson: fix more rounding issues with 59.94Hz modes
Commit 1017560164 ("drm/meson: use unsigned long long / Hz for
frequency types") attempts to resolve video playback using 59.94Hz.
 using YUV420 by changing the clock calculation to use
Hz instead of kHz (thus yielding more precision).

The basic calculation itself is correct, however the comparisions in
meson_vclk_vic_supported_freq() and meson_vclk_setup() don't work
anymore for 59.94Hz modes (using the freq * 1000 / 1001 logic). For
example, drm/edid specifies a 593407kHz clock for 3840x2160@59.94Hz.
With the mentioend commit we convert this to Hz. Then meson_vclk
tries to find a matchig "params" entry (as the clock setup code
currently only supports specific frequencies) by taking the venc_freq
from the params and calculating the "alt frequency" (used for the
59.94Hz modes) from it, which is:
  (594000000Hz * 1000) / 1001 = 593406593Hz

Similar calculation is applied to the phy_freq (TMDS clock), which is 10
times the pixel clock.

Implement a new meson_vclk_freqs_are_matching_param() function whose
purpose is to compare if the requested and calculated frequencies. They
may not match exactly (for the reasons mentioned above). Allow the
clocks to deviate slightly to make the 59.94Hz modes again.

Fixes: 1017560164 ("drm/meson: use unsigned long long / Hz for frequency types")
Reported-by: Christian Hewitt <christianshewitt@gmail.com>
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20250609202751.962208-1-martin.blumenstingl@googlemail.com
2025-06-10 14:15:42 +02:00
..
Kconfig drm/meson: Allow build with COMPILE_TEST=y 2024-10-25 10:25:10 +03:00
Makefile drm/meson: add support for MIPI-DSI transceiver 2023-06-01 16:10:24 +02:00
meson_crtc.c
meson_crtc.h
meson_drv.c drm/meson: use unsigned long long / Hz for frequency types 2025-04-22 09:23:58 +02:00
meson_drv.h drm/meson: use unsigned long long / Hz for frequency types 2025-04-22 09:23:58 +02:00
meson_dw_hdmi.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
meson_dw_hdmi.h
meson_dw_mipi_dsi.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
meson_dw_mipi_dsi.h drm/meson: add support for MIPI-DSI transceiver 2023-06-01 16:10:24 +02:00
meson_encoder_cvbs.c drm/bridge: Add encoder parameter to drm_bridge_funcs.attach 2025-03-20 14:45:38 +01:00
meson_encoder_cvbs.h drm/meson: improve encoder probe / initialization error handling 2024-02-19 09:48:41 +01:00
meson_encoder_dsi.c drm/bridge: Add encoder parameter to drm_bridge_funcs.attach 2025-03-20 14:45:38 +01:00
meson_encoder_dsi.h drm/meson: improve encoder probe / initialization error handling 2024-02-19 09:48:41 +01:00
meson_encoder_hdmi.c drm/meson: fix debug log statement when setting the HDMI clocks 2025-06-10 14:14:36 +02:00
meson_encoder_hdmi.h drm/meson: improve encoder probe / initialization error handling 2024-02-19 09:48:41 +01:00
meson_osd_afbcd.c
meson_osd_afbcd.h
meson_overlay.c
meson_overlay.h
meson_plane.c drm/meson: plane: Add error handling 2024-06-06 10:27:44 +02:00
meson_plane.h
meson_rdma.c
meson_rdma.h
meson_registers.h drm/meson: venc: add ENCL encoder setup for MIPI-DSI output 2023-06-01 16:10:22 +02:00
meson_vclk.c drm/meson: fix more rounding issues with 59.94Hz modes 2025-06-10 14:15:42 +02:00
meson_vclk.h drm/meson: use unsigned long long / Hz for frequency types 2025-04-22 09:23:58 +02:00
meson_venc.c drm/meson: venc: include linux/bitfield.h 2023-06-02 15:47:52 +02:00
meson_venc.h drm/meson: venc: add ENCL encoder setup for MIPI-DSI output 2023-06-01 16:10:22 +02:00
meson_viu.c
meson_viu.h
meson_vpp.c drm/meson: fix 1px pink line on GXM when scaling video overlay 2023-03-06 09:42:01 +01:00
meson_vpp.h drm/meson: venc: add ENCL encoder setup for MIPI-DSI output 2023-06-01 16:10:22 +02:00