drm/msm: dpu: Don't reset dpu_enc->cur_master on .disable()
PATCH 1/1 drm/msm: dpu: Don't reset dpu_enc->cur_master on .disable()
From: Sean Paul <[email protected]>
cur_master in dpu_encoder is assigned at modeset and cleared on .disable(). Unfortunately dpms (or enable/disable) does not guarantee a modeset, so cur_master is NULL when we try to re-enable it.
This patch moves the NULL assignment to setup_display where it will be re-assigned later in the function.
--- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +2 -2
@@ -1230,8 +1230,6 @@ static void dpu_encoder_virt_disable(struct drm_encoder *drm_enc) dpu_enc->phys_encs[i]->connector =NULL ; } - dpu_enc->cur_master =NULL ; -DPU_DEBUG_ENC (dpu_enc,"encoder disabled\n" );dpu_rm_release (&dpu_kms->rm, drm_enc);
@@ -2072,6 +2070,8 @@ static int dpu_encoder_setup_display(struct dpu_encoder_virt *dpu_enc,return -EINVAL ; } + dpu_enc->cur_master =NULL ; +memset (&phys_params,0 ,sizeof (phys_params)); phys_params.dpu_kms = dpu_kms; phys_params.parent = &dpu_enc->base;
Signature · 6 lines
Sean Paul, Software Engineer, Google / Chromium OS _______________________________________________ Freedreno mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/freedreno
A message that is not in the archive (sent off-list or not yet received): 20180917204959.205802-1-sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org
Bruce Wang
Tested-byQuoted 11 lines · Sean Paul
From: Sean Paul <[email protected]>
cur_masterindpu_encoderis assigned at modeset and cleared on .disable(). Unfortunately dpms (or enable/disable) does not guarantee a modeset, socur_masteris NULL when we try to re-enable it.This patch moves the NULL assignment to
setup_displaywhere it will be re-assigned later in the function.Signed-off-by Sean Paul <[email protected]>
Quoted 27 lines
--- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +2
-3@@ -1230,8 +1230,6 @@ static void dpu_encoder_virt_disable(struct drm_encoder *drm_enc) dpu_enc->phys_encs[i]->connector =NULL ; } - dpu_enc->cur_master =NULL ; -DPU_DEBUG_ENC (dpu_enc,"encoder disabled\n" );dpu_rm_release (&dpu_kms->rm, drm_enc);@@ -2072,6 +2070,8 @@ static int dpu_encoder_setup_display(struct dpu_encoder_virt *dpu_enc,return -EINVAL ; } + dpu_enc->cur_master =NULL ; +memset (&phys_params,0 ,sizeof (phys_params)); phys_params.dpu_kms = dpu_kms; phys_params.parent = &dpu_enc->base; --
Quoted 2 lines
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
Freedreno mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/freedreno
Quoted 9 lines · Sean Paul
From: Sean Paul <[email protected]>
cur_masterindpu_encoderis assigned at modeset and cleared on .disable(). Unfortunately dpms (or enable/disable) does not guarantee a modeset, socur_masteris NULL when we try to re-enable it.This patch moves the NULL assignment to
setup_displaywhere it will be re-assigned later in the function.
The patch looks harmless to me. But the encoder->disable also calls .disable() on the physical encoders. If the DPMS is not invoking an enable, why does it need to access cur_master when all the physical encoders are in the disabled state? Can we clean up the usage of cur_master if possible in the dpms path?
Thanks,
Jeykumar S.
Quoted 30 lines
Signed-off-by Sean Paul <[email protected]>--- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +0
-2@@ -1230,8 +1230,6 @@ static void dpu_encoder_virt_disable(struct drm_encoder *drm_enc) dpu_enc->phys_encs[i]->connector = NULL; } - dpu_enc->cur_master =NULL ; -DPU_DEBUG_ENC (dpu_enc,"encoder disabled\n" );drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +2
-0dpu_rm_release (&dpu_kms->rm, drm_enc);@@ -2072,6 +2070,8 @@ static int dpu_encoder_setup_display(struct dpu_encoder_virt *dpu_enc, return -EINVAL ; } + dpu_enc->cur_master =NULL ; +memset (&phys_params,0 ,sizeof (phys_params)); phys_params.dpu_kms = dpu_kms;phys_params.parent =
&dpu_enc->base;
Signature · 5 lines
Jeykumar S _______________________________________________ Freedreno mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/freedreno
A message that is not in the archive (sent off-list or not yet received): 0238e2d56bb56f92a1a4ec9d861496bd-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org
Quoted 7 lines · Jeykumar Sankaran
Quoted 6 lines · Sean Paul
From: Sean Paul <[email protected]>
cur_masterindpu_encoderis assigned at modeset and cleared on .disable(). Unfortunately dpms (or enable/disable) does not guarantee a modeset, socur_masteris NULL when we try to re-enable it.
Quoted 8 lines
Quoted 3 lines
This patch moves the NULL assignment to
setup_displaywhere it will be re-assigned later in the function.The patch looks harmless to me. But the
encoder->disablealso calls .disable() on
the physical encoders. If the DPMS is not invoking an enable, why does it need to accesscur_masterwhen all the physical encoders are in the disabled state?
DPMS is invoking enable, but cur_master is currently only set on modeset which isn't invoked on DPMS.
Sean
Quoted 39 lines
Can we clean up the usage of
cur_masterif possible in the dpms path?Thanks,
Jeykumar S.Quoted 30 lines
Signed-off-by Sean Paul <[email protected]>--- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +0
-2@@ -1230,8 +1230,6 @@ static void dpu_encoder_virt_disable(struct drm_encoder *drm_enc) dpu_enc->phys_encs[i]->connector = NULL; } - dpu_enc->cur_master =NULL ; -DPU_DEBUG_ENC (dpu_enc,"encoder disabled\n" );drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +2
-0dpu_rm_release (&dpu_kms->rm, drm_enc);@@ -2072,6 +2070,8 @@ static int dpu_encoder_setup_display(struct dpu_encoder_virt *dpu_enc, return -EINVAL ; } + dpu_enc->cur_master =NULL ; +memset (&phys_params,0 ,sizeof (phys_params)); phys_params.dpu_kms = dpu_kms;phys_params.parent =
&dpu_enc->base;Signature · 1 line
Jeykumar S
Signature · 5 lines
Sean Paul, Software Engineer, Google / Chromium OS _______________________________________________ Freedreno mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/freedreno
Jeykumar Sankaran
Reviewed-byQuoted 18 lines · Sean Paul
Quoted 5 lines · Jeykumar Sankaran
Quoted 4 lines · Sean Paul
From: Sean Paul <[email protected]>
cur_masterindpu_encoderis assigned at modeset and cleared on .disable(). Unfortunately dpms (or enable/disable) does not guaranteea
Quoted 10 lines
Quoted 5 lines
modeset, so
cur_masteris NULL when we try to re-enable it.This patch moves the NULL assignment to
setup_displaywhere it will be re-assigned later in the function.The patch looks harmless to me. But the
encoder->disablealso calls .disable() on
the physical encoders. If the DPMS is not invoking an enable, why does it need to accesscur_masterwhen all the physical encoders are in the disabled state?
Quoted 6 lines
DPMS is invoking enable, but
cur_masteris currently only set on modeset which
isn't invoked on DPMS.Sean
Got it! Misread the commit text.
Quoted 39 lines
Quoted 39 lines
Can we clean up the usage of
cur_masterif possible in the dpms path?Thanks,
Jeykumar S.Quoted 29 lines
Signed-off-by Sean Paul <[email protected]>--- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +0
-2@@ -1230,8 +1230,6 @@ static void dpu_encoder_virt_disable(struct drm_encoder *drm_enc) dpu_enc->phys_encs[i]->connector = NULL; } - dpu_enc->cur_master =NULL ; -DPU_DEBUG_ENC (dpu_enc,"encoder disabled\n" );drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +2
-0dpu_rm_release (&dpu_kms->rm, drm_enc);@@ -2072,6 +2070,8 @@ static int dpu_encoder_setup_display(struct dpu_encoder_virt *dpu_enc, return -EINVAL ; } + dpu_enc->cur_master =NULL ; +memset (&phys_params,0 ,sizeof (phys_params)); phys_params.dpu_kms = dpu_kms;Quoted 1 line
phys_params.parent =
&dpu_enc->base;--
Jeykumar S
Signature · 5 lines
Jeykumar S _______________________________________________ Freedreno mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/freedreno
A message that is not in the archive (sent off-list or not yet received): 9a68ad97a1db25d7a7e37df0e43ad5f0-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org
Quoted 23 lines · Jeykumar Sankaran
Quoted 22 lines · Sean Paul
Quoted 5 lines · Jeykumar Sankaran
Quoted 4 lines · Sean Paul
From: Sean Paul <[email protected]>
cur_masterindpu_encoderis assigned at modeset and cleared on .disable(). Unfortunately dpms (or enable/disable) does not guaranteea
Quoted 10 lines
Quoted 5 lines
modeset, so
cur_masteris NULL when we try to re-enable it.This patch moves the NULL assignment to
setup_displaywhere it will be re-assigned later in the function.The patch looks harmless to me. But the
encoder->disablealso calls .disable() on
the physical encoders. If the DPMS is not invoking an enable, why does it need to accesscur_masterwhen all the physical encoders are in the disabled state?DPMS is invoking enable, but
cur_masteris currently only set on modeset which
isn't invoked on DPMS.
Quoted 5 lines
Quoted 2 lines
Sean
Got it! Misread the commit text.
Reviewed-by Jeykumar Sankaran <[email protected]>
Awesome, thanks for your review. I've pushed to dpu-staging.
Sean
Quoted 43 lines
Quoted 40 lines
Quoted 40 lines
Can we clean up the usage of
cur_masterif possible in the dpms path?Thanks,
Jeykumar S.Quoted 29 lines
Signed-off-by Sean Paul <[email protected]>--- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +0
-2@@ -1230,8 +1230,6 @@ static void dpu_encoder_virt_disable(struct drm_encoder *drm_enc) dpu_enc->phys_encs[i]->connector = NULL; } - dpu_enc->cur_master =NULL ; -DPU_DEBUG_ENC (dpu_enc,"encoder disabled\n" );drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +2
-0dpu_rm_release (&dpu_kms->rm, drm_enc);@@ -2072,6 +2070,8 @@ static int dpu_encoder_setup_display(struct dpu_encoder_virt *dpu_enc, return -EINVAL ; } + dpu_enc->cur_master =NULL ; +memset (&phys_params,0 ,sizeof (phys_params)); phys_params.dpu_kms = dpu_kms;Quoted 1 line
phys_params.parent =
&dpu_enc->base;--
Jeykumar SSignature · 1 line
Jeykumar S
Signature · 5 lines
Sean Paul, Software Engineer, Google / Chromium OS _______________________________________________ Freedreno mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/freedreno