Skip to content

Commit 6764eb6

Browse files
committed
drm/vc4: crtc: Fix runtime_pm reference counting
At boot on the BCM2711, if the HDMI controllers are running, the CRTC driver will disable itself and its associated HDMI controller to work around a hardware bug that would leave some pixels stuck in a FIFO. In order to avoid that issue, we need to run some operations in lockstep between the CRTC and HDMI controller, and we need to make sure the HDMI controller will be powered properly. However, since we haven't enabled it through KMS, the runtime_pm state is off at this point so we need to make sure the device is powered through pm_runtime_resume_and_get, and once the operations are complete, we call pm_runtime_put. However, the HDMI controller will do that itself in its post_crtc_powerdown, which means we'll end up calling pm_runtime_put for a single pm_runtime_get, throwing the reference counting off. Let's remove the pm_runtime_put call in the CRTC code in order to have the proper counting. Fixes: bca10db ("drm/vc4: crtc: Make sure the HDMI controller is powered when disabling") Signed-off-by: Maxime Ripard <maxime@cerno.tech> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20220203102003.1114673-1-maxime@cerno.tech
1 parent e40945a commit 6764eb6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

drivers/gpu/drm/vc4/vc4_crtc.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -525,9 +525,11 @@ int vc4_crtc_disable_at_boot(struct drm_crtc *crtc)
525525
if (ret)
526526
return ret;
527527

528-
ret = pm_runtime_put(&vc4_hdmi->pdev->dev);
529-
if (ret)
530-
return ret;
528+
/*
529+
* post_crtc_powerdown will have called pm_runtime_put, so we
530+
* don't need it here otherwise we'll get the reference counting
531+
* wrong.
532+
*/
531533

532534
return 0;
533535
}

0 commit comments

Comments
 (0)