On Thu, Jun 11, 2026 at 08:07:46AM +0200, Alexandre MINETTE via B4 Relay wrote:
> From: Alexandre MINETTE <[email protected]>
> 
> MDP4 scanout continues to fetch framebuffer data while the CRTC is
> active. Keep the AXI/bus clock enabled for the lifetime of each active
> CRTC so that temporary MDP4 disable paths do not gate the bus clock
> while scanout is still running.
> 
> This avoids display corruption seen on the Samsung Galaxy S4 when the
> display pipeline is active.

Please describe, when do you observe a corruption?

> 
> Signed-off-by: Alexandre MINETTE <[email protected]>
> ---
>  drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c |  2 ++
>  drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c  | 42 
> +++++++++++++++++++++++++++++++
>  drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.h  |  6 +++++
>  3 files changed, 50 insertions(+)
> 
> diff --git a/drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c 
> b/drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c
> index e8066f9fd534..9e53c9d956ca 100644
> --- a/drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c
> +++ b/drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c
> @@ -271,6 +271,7 @@ static void mdp4_crtc_atomic_disable(struct drm_crtc 
> *crtc,
>  
>       mdp_irq_unregister(&mdp4_kms->base, &mdp4_crtc->err);
>       mdp4_disable(mdp4_kms);
> +     mdp4_crtc_bus_put(mdp4_kms);
>  
>       if (crtc->state->event && !crtc->state->active) {
>               WARN_ON(mdp4_crtc->event);
> @@ -295,6 +296,7 @@ static void mdp4_crtc_atomic_enable(struct drm_crtc *crtc,
>               return;
>  
>       mdp4_enable(mdp4_kms);
> +     mdp4_crtc_bus_get(mdp4_kms);

This is a bit suspicious. mdp4_enable() already votes on the AXI clock.
As the CCF has enable count for each clock, it should be enough to keep
the vote for as long as the CRTC is active.

My only assumption would be that the CRTC scanout happens for some time
even after the atomic_disable(), but without a description of the issue
it's hard to determine the cause.

>  
>       /* Restore vblank irq handling after power is enabled */
>       drm_crtc_vblank_on(crtc);
> @@ -137,6 +170,13 @@ static void mdp4_destroy(struct msm_kms *kms)
>       if (mdp4_kms->rpm_enabled)
>               pm_runtime_disable(dev);
>  
> +     mutex_lock(&mdp4_kms->clock_lock);
> +     if (mdp4_kms->crtc_bus_count) {
> +             clk_disable_unprepare(mdp4_kms->axi_clk);
> +             mdp4_kms->crtc_bus_count = 0;
> +     }

Is it not taken care by drm_atomic_helper_shutdown()?

> +     mutex_unlock(&mdp4_kms->clock_lock);
> +
>       mdp_kms_destroy(&mdp4_kms->base);
>  }
>  

-- 
With best wishes
Dmitry

Reply via email to