Skip to contentSkip to conversation

drm/msm: dpu: Don't reset dpu_enc->cur_master on .disable()

PATCH In review Sean Paul 3 participants 6 messages Sep 17, 2018 – Oct 2, 2018 3 messages not in the archive

Subsystems (3)
lore
Share & tools
lore

Sean Paul

author
#0 lore raw

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
index c2e8985b4c54..ae03d8d43b27 100644
@@ -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

Tested-by
#2 lore raw
Quoted 11 lines · Sean Paul

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.

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
index c2e8985b4c54..ae03d8d43b27 100644
@@ -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

#3 lore raw
In reply to a message not in the archive
Quoted 9 lines · Sean Paul

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.

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
---
 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
index c2e8985b4c54..ae03d8d43b27 100644
@@ -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 -0
 	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 · 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

author
#5 lore raw
Quoted 7 lines · Jeykumar Sankaran
Quoted 6 lines · Sean Paul

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.

Quoted 8 lines
Quoted 3 lines

This patch moves the NULL assignment to setup_display where 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?

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_master if possible in the dpms path?

Thanks,
Jeykumar S.

Quoted 30 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 +0 -2
index c2e8985b4c54..ae03d8d43b27 100644
@@ -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 -0
 	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 · 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
Reviewed-by
#6 lore raw
Quoted 18 lines · Sean Paul
Quoted 5 lines · Jeykumar Sankaran
Quoted 4 lines · Sean Paul

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

Quoted 10 lines
Quoted 5 lines

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.

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?

Quoted 6 lines

DPMS is invoking enable, but cur_master is 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_master if possible in the dpms path?

Thanks,
Jeykumar S.

Quoted 29 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 +0 -2
index c2e8985b4c54..ae03d8d43b27 100644
@@ -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 -0
 	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;
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

author
#8 lore raw
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_master in dpu_encoder is assigned at modeset and cleared on .disable(). Unfortunately dpms (or enable/disable) does not guarantee

a

Quoted 10 lines
Quoted 5 lines

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.

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?

DPMS is invoking enable, but cur_master is currently only set on modeset which
isn't invoked on DPMS.

Quoted 5 lines
Quoted 2 lines

Sean

Got it! Misread the commit text.

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_master if possible in the dpms path?

Thanks,
Jeykumar S.

Quoted 29 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 +0 -2
index c2e8985b4c54..ae03d8d43b27 100644
@@ -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 -0
 	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;
Quoted 1 line

phys_params.parent = &dpu_enc->base;

--
Jeykumar S

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