OSDN Git Service

drm/msm: dpu: Move crtc runtime resume to encoder
authorSean Paul <seanpaul@chromium.org>
Fri, 16 Nov 2018 18:42:22 +0000 (13:42 -0500)
committerRob Clark <robdclark@gmail.com>
Tue, 11 Dec 2018 18:10:11 +0000 (13:10 -0500)
commit18a63b3c6f0b6247f93f5eb05353b0486512017e
treef1c41e65a3f895437f671f29bb8d5261d8cdc997
parentfba7427eb594964726ab92bde7b9c20c995b4685
drm/msm: dpu: Move crtc runtime resume to encoder

The crtc runtime resume doesn't actually operate on the crtc, but rather
its encoders. The problem with this is that we need to inspect the crtc
state to get the currently connected encoders. Since runtime resume
isn't guaranteed to be called while holding the modeset locks (although
it sometimes is), this presents a race condition.

Now that we have ->enabled on the virtual encoders, and a lock to
protect it, just call resume on each encoder and only restore the ones
that are enabled.

Changes in v2:
- None

Cc: Jeykumar Sankaran <jsanka@codeaurora.org>
Reviewed-by: Jeykumar Sankaran <jsanka@codeaurora.org>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h
drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c