]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/msm/dpu: dont use encoder->crtc in atomic path
authorJeykumar Sankaran <jsanka@codeaurora.org>
Thu, 14 Feb 2019 01:19:13 +0000 (17:19 -0800)
committerRob Clark <robdclark@chromium.org>
Thu, 18 Apr 2019 17:04:10 +0000 (10:04 -0700)
encoder->crtc is not really meaningful for atomic path. Use
crtc->encoder_mask to identify the crtc attached with
an encoder.

Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/1550107156-17625-5-git-send-email-jsanka@codeaurora.org
Signed-off-by: Rob Clark <robdclark@chromium.org>
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c

index 7d7779d7014578cb67f908321d64c8fc4ab2978a..99cbf35243486030e3280a3cd482e9931cb01d47 100644 (file)
@@ -962,6 +962,7 @@ static void dpu_encoder_virt_mode_set(struct drm_encoder *drm_enc,
        struct dpu_kms *dpu_kms;
        struct list_head *connector_list;
        struct drm_connector *conn = NULL, *conn_iter;
+       struct drm_crtc *drm_crtc;
        struct dpu_rm_hw_iter pp_iter, ctl_iter;
        struct msm_display_topology topology;
        struct dpu_hw_ctl *hw_ctl[MAX_CHANNELS_PER_ENC] = { NULL };
@@ -993,10 +994,14 @@ static void dpu_encoder_virt_mode_set(struct drm_encoder *drm_enc,
                return;
        }
 
+       drm_for_each_crtc(drm_crtc, drm_enc->dev)
+               if (drm_crtc->state->encoder_mask & drm_encoder_mask(drm_enc))
+                       break;
+
        topology = dpu_encoder_get_topology(dpu_enc, dpu_kms, adj_mode);
 
        /* Reserve dynamic resources now. Indicating non-AtomicTest phase */
-       ret = dpu_rm_reserve(&dpu_kms->rm, drm_enc, drm_enc->crtc->state,
+       ret = dpu_rm_reserve(&dpu_kms->rm, drm_enc, drm_crtc->state,
                             topology, false);
        if (ret) {
                DPU_ERROR_ENC(dpu_enc,