Skip to contentSkip to conversation

use encoder type to identify display

PATCH In review Jeykumar Sankaran 3 participants 6 messages Aug 28, 2018 – Aug 30, 2018 2 messages not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover use encoder type to identify display

DPU is broken with patch [1]. This patch cleans up few stale codes and fixes the DPU bug by using encoder type to identify displays.

[1] https://patchwork.kernel.org/patch/10568269/

Thanks.

Jeykumar Sankaran (3):
drm/msm/dpu: remove stale display port programming drm/msm/dpu: remove unwanted encoder type mapping drm/msm/dpu: use encoder type to identify display type

 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 32 ++++++++---------------------
 1 file changed, 9 insertions(+), 23 deletions(-)
Signature · 7 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

_______________________________________________
Freedreno mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/freedreno
#2 lore raw

PATCH 1/3 drm/msm/dpu: remove stale display port programming

In reply to a message not in the archive

Remove stale display port programming. It can be
added back with DPU support for display port.

---
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +0 -6
index 1b4de34..5b07f63 100644
@@ -1111,12 +1111,6 @@ static void _dpu_encoder_virt_enable_helper(struct drm_encoder *drm_enc)
 		return;
 	}
 
-	if (dpu_enc->disp_info.intf_type == DRM_MODE_CONNECTOR_DisplayPort &&
-	    dpu_enc->cur_master->hw_mdptop &&
-	    dpu_enc->cur_master->hw_mdptop->ops.intf_audio_select)
-		dpu_enc->cur_master->hw_mdptop->ops.intf_audio_select(
-					dpu_enc->cur_master->hw_mdptop);
-
 	if (dpu_enc->cur_master->hw_mdptop &&
 			dpu_enc->cur_master->hw_mdptop->ops.reset_ubwc)
 		dpu_enc->cur_master->hw_mdptop->ops.reset_ubwc(
Signature · 7 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

_______________________________________________
Freedreno mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/freedreno
#3 lore raw

PATCH 2/3 drm/msm/dpu: remove unwanted encoder type mapping

In reply to a message not in the archive

This change gets rid of unwanted connector-encoder type mapping used for dsi-staging driver. Now that DPU will be using upstream DSI driver, remove the stale code.

---
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 20 ++++++--------------
 1 file changed, 6 insertions(+), 14 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +6 -14
index 5b07f63..26c80b6 100644
@@ -2200,8 +2200,7 @@ static int dpu_encoder_virt_add_phys_encs(
 
 static int dpu_encoder_setup_display(struct dpu_encoder_virt *dpu_enc,
 				 struct dpu_kms *dpu_kms,
-				 struct msm_display_info *disp_info,
-				 int *drm_enc_mode)
+				 struct msm_display_info *disp_info)
 {
 	int ret = 0;
 	int i = 0;
@@ -2222,16 +2221,11 @@ static int dpu_encoder_setup_display(struct dpu_encoder_virt *dpu_enc,
 
 	DPU_DEBUG("\n");
 
-	if (disp_info->intf_type == DRM_MODE_CONNECTOR_DSI) {
-		*drm_enc_mode = DRM_MODE_ENCODER_DSI;
+	switch (disp_info->intf_type) {
+	case DRM_MODE_CONNECTOR_DSI:
 		intf_type = INTF_DSI;
-	} else if (disp_info->intf_type == DRM_MODE_CONNECTOR_HDMIA) {
-		*drm_enc_mode = DRM_MODE_ENCODER_TMDS;
-		intf_type = INTF_HDMI;
-	} else if (disp_info->intf_type == DRM_MODE_CONNECTOR_DisplayPort) {
-		*drm_enc_mode = DRM_MODE_ENCODER_TMDS;
-		intf_type = INTF_DP;
-	} else {
+		break;
+	default:
 		DPU_ERROR_ENC(dpu_enc, "unsupported display interface type\n");
 		return -EINVAL;
 	}
@@ -2352,14 +2346,12 @@ int dpu_encoder_setup(struct drm_device *dev, struct drm_encoder *enc,
 	struct dpu_kms *dpu_kms = to_dpu_kms(priv->kms);
 	struct drm_encoder *drm_enc = NULL;
 	struct dpu_encoder_virt *dpu_enc = NULL;
-	int drm_enc_mode = DRM_MODE_ENCODER_NONE;
 	int ret = 0;
 
 	dpu_enc = to_dpu_encoder_virt(enc);
 
 	mutex_init(&dpu_enc->enc_lock);
-	ret = dpu_encoder_setup_display(dpu_enc, dpu_kms, disp_info,
-			&drm_enc_mode);
+	ret = dpu_encoder_setup_display(dpu_enc, dpu_kms, disp_info);
 	if (ret)
 		goto fail;
 
Signature · 7 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

_______________________________________________
Freedreno mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/freedreno
#4 lore raw

PATCH 3/3 drm/msm/dpu: use encoder type to identify display type

In reply to a message not in the archive

With patch [1], DPU is broken since it continues to use incorrect connector_type to identify the display type. Update DPU to use the encoder type to get the info.

[1] https://patchwork.kernel.org/patch/10568269/

---
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +4 -4
index 26c80b6..5b0e944 100644
@@ -525,7 +525,7 @@ void dpu_encoder_helper_split_config(
 	hw_mdptop = phys_enc->hw_mdptop;
 	disp_info = &dpu_enc->disp_info;
 
-	if (disp_info->intf_type != DRM_MODE_CONNECTOR_DSI)
+	if (disp_info->intf_type != DRM_MODE_ENCODER_DSI)
 		return;
 
 	/**
@@ -1873,7 +1873,7 @@ void dpu_encoder_kickoff(struct drm_encoder *drm_enc)
 			phys->ops.handle_post_kickoff(phys);
 	}
 
-	if (dpu_enc->disp_info.intf_type == DRM_MODE_CONNECTOR_DSI &&
+	if (dpu_enc->disp_info.intf_type == DRM_MODE_ENCODER_DSI &&
 			!_dpu_encoder_wakeup_time(drm_enc, &wakeup_time)) {
 		trace_dpu_enc_early_kickoff(DRMID(drm_enc),
 					    ktime_to_ms(wakeup_time));
@@ -2222,7 +2222,7 @@ static int dpu_encoder_setup_display(struct dpu_encoder_virt *dpu_enc,
 	DPU_DEBUG("\n");
 
 	switch (disp_info->intf_type) {
-	case DRM_MODE_CONNECTOR_DSI:
+	case DRM_MODE_ENCODER_DSI:
 		intf_type = INTF_DSI;
 		break;
 	default:
@@ -2362,7 +2362,7 @@ int dpu_encoder_setup(struct drm_device *dev, struct drm_encoder *enc,
 	timer_setup(&dpu_enc->frame_done_timer,
 			dpu_encoder_frame_done_timeout, 0);
 
-	if (disp_info->intf_type == DRM_MODE_CONNECTOR_DSI)
+	if (disp_info->intf_type == DRM_MODE_ENCODER_DSI)
 		timer_setup(&dpu_enc->vsync_event_timer,
 				dpu_encoder_vsync_event_handler,
 				0);
Signature · 7 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

_______________________________________________
Freedreno mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/freedreno
Acked-by
#6 lore raw

Re: [PATCH 3/3] drm/msm/dpu: use encoder type to identify display type

In reply to a message not in the archive
Quoted 5 lines · Jeykumar Sankaran

With patch [1], DPU is broken since it continues to use incorrect connector_type to identify the display type. Update DPU to use the encoder type to get the info.

[1] https://patchwork.kernel.org/patch/10568269/

This plus [1] takes care of all the warnings and other noise I was seeing during boot. Thanks for this.

Quoted 53 lines
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +4 -4
index 26c80b6..5b0e944 100644
@@ -525,7 +525,7 @@ void dpu_encoder_helper_split_config(
 	hw_mdptop = phys_enc->hw_mdptop;
 	disp_info = &dpu_enc->disp_info;
 
-	if (disp_info->intf_type != DRM_MODE_CONNECTOR_DSI)
+	if (disp_info->intf_type != DRM_MODE_ENCODER_DSI)
 		return;
 
 	/**
@@ -1873,7 +1873,7 @@ void dpu_encoder_kickoff(struct drm_encoder *drm_enc)
 			phys->ops.handle_post_kickoff(phys);
 	}
 
-	if (dpu_enc->disp_info.intf_type == DRM_MODE_CONNECTOR_DSI &&
+	if (dpu_enc->disp_info.intf_type == DRM_MODE_ENCODER_DSI &&
 			!_dpu_encoder_wakeup_time(drm_enc, &wakeup_time)) {
 		trace_dpu_enc_early_kickoff(DRMID(drm_enc),
 					    ktime_to_ms(wakeup_time));
@@ -2222,7 +2222,7 @@ static int dpu_encoder_setup_display(struct dpu_encoder_virt *dpu_enc,
 	DPU_DEBUG("\n");
 
 	switch (disp_info->intf_type) {
-	case DRM_MODE_CONNECTOR_DSI:
+	case DRM_MODE_ENCODER_DSI:
 		intf_type = INTF_DSI;
 		break;
 	default:
@@ -2362,7 +2362,7 @@ int dpu_encoder_setup(struct drm_device *dev, struct drm_encoder *enc,
 	timer_setup(&dpu_enc->frame_done_timer,
 			dpu_encoder_frame_done_timeout, 0);
 
-	if (disp_info->intf_type == DRM_MODE_CONNECTOR_DSI)
+	if (disp_info->intf_type == DRM_MODE_ENCODER_DSI)
 		timer_setup(&dpu_enc->vsync_event_timer,
 				dpu_encoder_vsync_event_handler,
 				0);
Signature · 7 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

_______________________________________________
Freedreno mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/freedreno
Signature · 6 lines
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
_______________________________________________
Freedreno mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/freedreno
reviewer Reviewed-by on the v1 series
#7 lore raw
In reply to Jeykumar Sankaran
Quoted 11 lines · Jeykumar Sankaran

DPU is broken with patch [1]. This patch cleans up few stale codes and fixes the DPU bug by using encoder type to identify displays.

[1] https://patchwork.kernel.org/patch/10568269/

Thanks.

Jeykumar Sankaran (3):
drm/msm/dpu: remove stale display port programming drm/msm/dpu: remove unwanted encoder type mapping drm/msm/dpu: use encoder type to identify display type

Entire series is

I've pushed them to dpu-staging/for-next

Thanks,

Sean

Quoted 8 lines
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 32 ++++++++---------------------
 1 file changed, 9 insertions(+), 23 deletions(-)
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
Signature · 5 lines
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel