Leonard Lausen reported an issue with suspend/resume of the sc7180 devices. Fix the WB atomic check, which caused the issue. Also make sure that DPU debugging logs are always directed to the drm_debug / DRIVER so that usual drm.debug masks work in an expected way.
Signed-off-by: Dmitry Baryshkov dmitry.baryshkov@linaro.org --- Dmitry Baryshkov (2): drm/msm/dpu1: don't choke on disabling the writeback connector drm/msm/dpu: don't play tricks with debug macros
drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h | 14 ++------------ drivers/gpu/drm/msm/disp/dpu1/dpu_writeback.c | 14 +++++++------- 2 files changed, 9 insertions(+), 19 deletions(-) --- base-commit: 0b58e108042b0ed28a71cd7edf5175999955b233 change-id: 20240709-dpu-fix-wb-6cd57e3eb182
Best regards,
In order to prevent any errors on connector being disabled, move the state->crtc check upfront. This should fix the issues during suspend when the writeback connector gets forcebly disabled.
Fixes: 71174f362d67 ("drm/msm/dpu: move writeback's atomic_check to dpu_writeback.c") Cc: stable@vger.kernel.org Reported-by: Leonard Lausen leonard@lausen.nl Closes: https://gitlab.freedesktop.org/drm/msm/-/issues/57 Signed-off-by: Dmitry Baryshkov dmitry.baryshkov@linaro.org --- drivers/gpu/drm/msm/disp/dpu1/dpu_writeback.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_writeback.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_writeback.c index 16f144cbc0c9..5c172bcf3419 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_writeback.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_writeback.c @@ -39,6 +39,13 @@ static int dpu_wb_conn_atomic_check(struct drm_connector *connector,
DPU_DEBUG("[atomic_check:%d]\n", connector->base.id);
+ crtc = conn_state->crtc; + if (!crtc) + return 0; + + if (!conn_state->writeback_job || !conn_state->writeback_job->fb) + return 0; + if (!conn_state || !conn_state->connector) { DPU_ERROR("invalid connector state\n"); return -EINVAL; @@ -47,13 +54,6 @@ static int dpu_wb_conn_atomic_check(struct drm_connector *connector, return -EINVAL; }
- crtc = conn_state->crtc; - if (!crtc) - return 0; - - if (!conn_state->writeback_job || !conn_state->writeback_job->fb) - return 0; - crtc_state = drm_atomic_get_crtc_state(state, crtc); if (IS_ERR(crtc_state)) return PTR_ERR(crtc_state);
On 7/9/2024 6:48 AM, Dmitry Baryshkov wrote:
In order to prevent any errors on connector being disabled, move the state->crtc check upfront. This should fix the issues during suspend when the writeback connector gets forcebly disabled.
Fixes: 71174f362d67 ("drm/msm/dpu: move writeback's atomic_check to dpu_writeback.c") Cc: stable@vger.kernel.org Reported-by: Leonard Lausen leonard@lausen.nl Closes: https://gitlab.freedesktop.org/drm/msm/-/issues/57 Signed-off-by: Dmitry Baryshkov dmitry.baryshkov@linaro.org
drivers/gpu/drm/msm/disp/dpu1/dpu_writeback.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_writeback.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_writeback.c index 16f144cbc0c9..5c172bcf3419 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_writeback.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_writeback.c @@ -39,6 +39,13 @@ static int dpu_wb_conn_atomic_check(struct drm_connector *connector, DPU_DEBUG("[atomic_check:%d]\n", connector->base.id);
- crtc = conn_state->crtc;
We are checking for !conn_state a few lines below but we are dereferencing conn_state here.
This is bound to hit a smatch error and also does not look right.
If conn_state will always be valid, we should drop that check too rather than checking it later.
Coming to the issue itself, I tried checking the logs but it was not clear.
During force disable, were we hitting below check and hence the connector was not getting disabled?
else if (conn_state->connector->status != connector_status_connected) { DPU_ERROR("connector not connected %d\n", conn_state->connector->status); return -EINVAL; }
I did not see this error log there, so can you pls explain where we were bailing out? The check seems valid to me.
- if (!crtc)
return 0;
- if (!conn_state->writeback_job || !conn_state->writeback_job->fb)
return 0;
- if (!conn_state || !conn_state->connector) { DPU_ERROR("invalid connector state\n"); return -EINVAL;
@@ -47,13 +54,6 @@ static int dpu_wb_conn_atomic_check(struct drm_connector *connector, return -EINVAL; }
- crtc = conn_state->crtc;
- if (!crtc)
return 0;
- if (!conn_state->writeback_job || !conn_state->writeback_job->fb)
return 0;
- crtc_state = drm_atomic_get_crtc_state(state, crtc); if (IS_ERR(crtc_state)) return PTR_ERR(crtc_state);
linux-stable-mirror@lists.linaro.org