Hi Am 26.07.26 um 21:42 schrieb Ze Huang:
The simple-KMS helper calls the pipe update after enabling the CRTC. On an enable commit, imx_lcdc_pipe_enable() already programs the mode and enables clk_per. The following pipe update sees the plane move from no CRTC to the active CRTC, treats it as a mode update, and calls imx_lcdc_update_hw_registers() again.That second call has no old CRTC state to disable clk_per first, but it enables clk_per again at the end. The disable path only drops one reference, leaving clk_per enabled after each on/off cycle. Skip the register update from the pipe update path when the CRTC already needs a modeset. The enable path has already programmed the hardware for that commit; keep the event handling in pipe update unchanged.
That seems reasonable. Once the driver uses regular DRM helpers instead of simple_kms, it can all be untangled and this test won't be necessary any longer.
Fixes: c87e859cdeb5 ("drm/imx/lcdc: Implement DRM driver for imx25")
Signed-off-by: Ze Huang <[email protected]>
Acked-by: Thomas Zimmermann <[email protected]>
--- drivers/gpu/drm/imx/lcdc/imx-lcdc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/imx/lcdc/imx-lcdc.c b/drivers/gpu/drm/imx/lcdc/imx-lcdc.c index f52832b43aca..81024f7d9e96 100644 --- a/drivers/gpu/drm/imx/lcdc/imx-lcdc.c +++ b/drivers/gpu/drm/imx/lcdc/imx-lcdc.c @@ -311,7 +311,8 @@ static void imx_lcdc_pipe_update(struct drm_simple_display_pipe *pipe, else if (old_crtc != crtc) mode_changed = true;- imx_lcdc_update_hw_registers(pipe, old_state, mode_changed);+ if (!drm_atomic_crtc_needs_modeset(crtc->state)) + imx_lcdc_update_hw_registers(pipe, old_state, mode_changed);if (event) {crtc->state->event = NULL;
-- -- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com GF: Jochen Jaser, Andrew McDonald, (HRB 36809, AG Nürnberg)
