public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH v2] drm/i915/mst: Use MST sideband message transactions for dpms control
@ 2017-09-13 20:06 Dhinakaran Pandiyan
  2017-09-13 20:27 ` ✓ Fi.CI.BAT: success for " Patchwork
                   ` (7 more replies)
  0 siblings, 8 replies; 13+ messages in thread
From: Dhinakaran Pandiyan @ 2017-09-13 20:06 UTC (permalink / raw)
  To: intel-gfx; +Cc: Dhinakaran Pandiyan

Use the POWER_DOWN_PHY and POWER_UP_PHY sideband message transactions to
set power states for downstream sinks. Apart from giving us the ability
to set power state for individual sinks, this fixes the below test for
me.

$ xrandr --display :0 --output DP-2-2-8 --off
$ xrandr --display :0 --output DP-2-2-1 --off
$ xrandr --display :0 --output DP-2-2-8 --auto #Black screen
$ xrandr --display :0 --output DP-2-2-1 --auto

v2: Modify and document the dpms and port disable order (Ville)
    Add comment explaining is_mst = !crtc_state equivalence(Ville, Maarten)

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Lyude <lyude@redhat.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
---
 drivers/gpu/drm/i915/intel_ddi.c    | 18 ++++++++++++++----
 drivers/gpu/drm/i915/intel_dp_mst.c | 13 +++++++++----
 2 files changed, 23 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index 1da3bb2cc4b4..0053d66393f8 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -2161,7 +2161,8 @@ static void intel_ddi_pre_enable_dp(struct intel_encoder *encoder,
 		intel_prepare_dp_ddi_buffers(encoder);
 
 	intel_ddi_init_dp_buf_reg(encoder);
-	intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_ON);
+	if (!link_mst)
+		intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_ON);
 	intel_dp_start_link_train(intel_dp);
 	if (port != PORT_A || INTEL_GEN(dev_priv) >= 9)
 		intel_dp_stop_link_train(intel_dp);
@@ -2235,12 +2236,21 @@ static void intel_ddi_post_disable(struct intel_encoder *intel_encoder,
 	uint32_t val;
 	bool wait = false;
 
-	/* old_crtc_state and old_conn_state are NULL when called from DP_MST */
-
 	if (type == INTEL_OUTPUT_DP || type == INTEL_OUTPUT_EDP) {
+		/*
+		 * old_crtc_state and old_conn_state are NULL when called from
+		 * DP_MST. The main connector associated with this port is never
+		 * bound to a crtc for MST.
+		 */
+		bool is_mst = !old_crtc_state;
 		struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
 
-		intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_OFF);
+		/*
+		 * Power down sink before disabling the port, otherwise we end
+		 * up getting interrupts from the sink on detecting link loss.
+		 */
+		if (!is_mst)
+			intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_OFF);
 	}
 
 	val = I915_READ(DDI_BUF_CTL(port));
diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i915/intel_dp_mst.c
index 8e3aad0ea60b..187f3f05a828 100644
--- a/drivers/gpu/drm/i915/intel_dp_mst.c
+++ b/drivers/gpu/drm/i915/intel_dp_mst.c
@@ -164,15 +164,19 @@ static void intel_mst_post_disable_dp(struct intel_encoder *encoder,
 
 	drm_dp_mst_deallocate_vcpi(&intel_dp->mst_mgr, connector->port);
 
+	/*
+	 * Power down mst path before disabling the port, otherwise we end
+	 * up getting interrupts from the sink upon detecting link loss.
+	 */
+	drm_dp_send_power_updown_phy(&intel_dp->mst_mgr, connector->port,
+				     false);
+
 	intel_dp->active_mst_links--;
 
 	intel_mst->connector = NULL;
-	if (intel_dp->active_mst_links == 0) {
+	if (intel_dp->active_mst_links == 0)
 		intel_dig_port->base.post_disable(&intel_dig_port->base,
 						  NULL, NULL);
-
-		intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_OFF);
-	}
 }
 
 static void intel_mst_pre_enable_dp(struct intel_encoder *encoder,
@@ -197,6 +201,7 @@ static void intel_mst_pre_enable_dp(struct intel_encoder *encoder,
 
 	DRM_DEBUG_KMS("%d\n", intel_dp->active_mst_links);
 
+	drm_dp_send_power_updown_phy(&intel_dp->mst_mgr, connector->port, true);
 	if (intel_dp->active_mst_links == 0)
 		intel_dig_port->base.pre_enable(&intel_dig_port->base,
 						pipe_config, NULL);
-- 
2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* ✓ Fi.CI.BAT: success for drm/i915/mst: Use MST sideband message transactions for dpms control
  2017-09-13 20:06 [PATCH v2] drm/i915/mst: Use MST sideband message transactions for dpms control Dhinakaran Pandiyan
@ 2017-09-13 20:27 ` Patchwork
  2017-09-14  5:11 ` ✓ Fi.CI.IGT: " Patchwork
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Patchwork @ 2017-09-13 20:27 UTC (permalink / raw)
  To: Pandiyan, Dhinakaran; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/mst: Use MST sideband message transactions for dpms control
URL   : https://patchwork.freedesktop.org/series/30314/
State : success

== Summary ==

Series 30314v1 drm/i915/mst: Use MST sideband message transactions for dpms control
https://patchwork.freedesktop.org/api/1.0/series/30314/revisions/1/mbox/

Test chamelium:
        Subgroup dp-crc-fast:
                pass       -> FAIL       (fi-kbl-7500u) fdo#102514
Test kms_flip:
        Subgroup basic-flip-vs-modeset:
                pass       -> SKIP       (fi-skl-x1585l) fdo#101781
Test kms_frontbuffer_tracking:
        Subgroup basic:
                dmesg-warn -> PASS       (fi-bdw-5557u) fdo#102473
Test pm_rpm:
        Subgroup basic-rte:
                pass       -> DMESG-WARN (fi-cfl-s) fdo#102294

fdo#102514 https://bugs.freedesktop.org/show_bug.cgi?id=102514
fdo#101781 https://bugs.freedesktop.org/show_bug.cgi?id=101781
fdo#102473 https://bugs.freedesktop.org/show_bug.cgi?id=102473
fdo#102294 https://bugs.freedesktop.org/show_bug.cgi?id=102294

fi-bdw-5557u     total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  time:442s
fi-bdw-gvtdvm    total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:461s
fi-blb-e6850     total:289  pass:224  dwarn:1   dfail:0   fail:0   skip:64  time:375s
fi-bsw-n3050     total:289  pass:243  dwarn:0   dfail:0   fail:0   skip:46  time:529s
fi-bwr-2160      total:289  pass:184  dwarn:0   dfail:0   fail:0   skip:105 time:272s
fi-bxt-j4205     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:506s
fi-byt-j1900     total:289  pass:254  dwarn:1   dfail:0   fail:0   skip:34  time:501s
fi-byt-n2820     total:289  pass:250  dwarn:1   dfail:0   fail:0   skip:38  time:493s
fi-cfl-s         total:289  pass:222  dwarn:35  dfail:0   fail:0   skip:32  time:558s
fi-elk-e7500     total:289  pass:230  dwarn:0   dfail:0   fail:0   skip:59  time:453s
fi-glk-2a        total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:598s
fi-hsw-4770      total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:428s
fi-hsw-4770r     total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:408s
fi-ilk-650       total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  time:440s
fi-ivb-3520m     total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:477s
fi-ivb-3770      total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:463s
fi-kbl-7500u     total:289  pass:263  dwarn:1   dfail:0   fail:1   skip:24  time:481s
fi-kbl-7560u     total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  time:583s
fi-kbl-r         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:585s
fi-pnv-d510      total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  time:554s
fi-skl-6260u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:459s
fi-skl-6700k     total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:525s
fi-skl-6770hq    total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:507s
fi-skl-gvtdvm    total:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  time:465s
fi-skl-x1585l    total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  time:475s
fi-snb-2520m     total:289  pass:251  dwarn:0   dfail:0   fail:0   skip:38  time:571s
fi-snb-2600      total:289  pass:248  dwarn:0   dfail:0   fail:2   skip:39  time:429s

fd4b78812edddb5118f97329ba04f36483e16e2a drm-tip: 2017y-09m-13d-17h-15m-44s UTC integration manifest
d5c4681f997d drm/i915/mst: Use MST sideband message transactions for dpms control

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_5688/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 13+ messages in thread

* ✓ Fi.CI.IGT: success for drm/i915/mst: Use MST sideband message transactions for dpms control
  2017-09-13 20:06 [PATCH v2] drm/i915/mst: Use MST sideband message transactions for dpms control Dhinakaran Pandiyan
  2017-09-13 20:27 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2017-09-14  5:11 ` Patchwork
  2017-09-14 17:37 ` [PATCH v2] " Lyude Paul
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Patchwork @ 2017-09-14  5:11 UTC (permalink / raw)
  To: Dhinakaran Pandiyan; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/mst: Use MST sideband message transactions for dpms control
URL   : https://patchwork.freedesktop.org/series/30314/
State : success

== Summary ==

Test kms_setmode:
        Subgroup basic:
                fail       -> PASS       (shard-hsw) fdo#99912
Test gem_eio:
        Subgroup in-flight:
                fail       -> PASS       (shard-hsw) fdo#102616
Test kms_flip:
        Subgroup wf_vblank-vs-dpms:
                dmesg-warn -> PASS       (shard-hsw)
Test perf:
        Subgroup blocking:
                pass       -> FAIL       (shard-hsw) fdo#102252
Test gem_flink_race:
        Subgroup flink_close:
                fail       -> PASS       (shard-hsw) fdo#102655

fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
fdo#102616 https://bugs.freedesktop.org/show_bug.cgi?id=102616
fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252
fdo#102655 https://bugs.freedesktop.org/show_bug.cgi?id=102655

shard-hsw        total:2313 pass:1245 dwarn:0   dfail:0   fail:13  skip:1055 time:9340s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_5688/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2] drm/i915/mst: Use MST sideband message transactions for dpms control
  2017-09-13 20:06 [PATCH v2] drm/i915/mst: Use MST sideband message transactions for dpms control Dhinakaran Pandiyan
  2017-09-13 20:27 ` ✓ Fi.CI.BAT: success for " Patchwork
  2017-09-14  5:11 ` ✓ Fi.CI.IGT: " Patchwork
@ 2017-09-14 17:37 ` Lyude Paul
  2017-09-18  8:30 ` Maarten Lankhorst
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Lyude Paul @ 2017-09-14 17:37 UTC (permalink / raw)
  To: Dhinakaran Pandiyan, intel-gfx

Reviewed-by: Lyude Paul <lyude@redhat.com>

On Wed, 2017-09-13 at 13:06 -0700, Dhinakaran Pandiyan wrote:
> Use the POWER_DOWN_PHY and POWER_UP_PHY sideband message transactions to
> set power states for downstream sinks. Apart from giving us the ability
> to set power state for individual sinks, this fixes the below test for
> me.
> 
> $ xrandr --display :0 --output DP-2-2-8 --off
> $ xrandr --display :0 --output DP-2-2-1 --off
> $ xrandr --display :0 --output DP-2-2-8 --auto #Black screen
> $ xrandr --display :0 --output DP-2-2-1 --auto
> 
> v2: Modify and document the dpms and port disable order (Ville)
>     Add comment explaining is_mst = !crtc_state equivalence(Ville, Maarten)
> 
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: Lyude <lyude@redhat.com>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_ddi.c    | 18 ++++++++++++++----
>  drivers/gpu/drm/i915/intel_dp_mst.c | 13 +++++++++----
>  2 files changed, 23 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_ddi.c
> b/drivers/gpu/drm/i915/intel_ddi.c
> index 1da3bb2cc4b4..0053d66393f8 100644
> --- a/drivers/gpu/drm/i915/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/intel_ddi.c
> @@ -2161,7 +2161,8 @@ static void intel_ddi_pre_enable_dp(struct
> intel_encoder *encoder,
>  		intel_prepare_dp_ddi_buffers(encoder);
>  
>  	intel_ddi_init_dp_buf_reg(encoder);
> -	intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_ON);
> +	if (!link_mst)
> +		intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_ON);
>  	intel_dp_start_link_train(intel_dp);
>  	if (port != PORT_A || INTEL_GEN(dev_priv) >= 9)
>  		intel_dp_stop_link_train(intel_dp);
> @@ -2235,12 +2236,21 @@ static void intel_ddi_post_disable(struct
> intel_encoder *intel_encoder,
>  	uint32_t val;
>  	bool wait = false;
>  
> -	/* old_crtc_state and old_conn_state are NULL when called from
> DP_MST */
> -
>  	if (type == INTEL_OUTPUT_DP || type == INTEL_OUTPUT_EDP) {
> +		/*
> +		 * old_crtc_state and old_conn_state are NULL when called
> from
> +		 * DP_MST. The main connector associated with this port is
> never
> +		 * bound to a crtc for MST.
> +		 */
> +		bool is_mst = !old_crtc_state;
>  		struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
>  
> -		intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_OFF);
> +		/*
> +		 * Power down sink before disabling the port, otherwise we
> end
> +		 * up getting interrupts from the sink on detecting link
> loss.
> +		 */
> +		if (!is_mst)
> +			intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_OFF);
>  	}
>  
>  	val = I915_READ(DDI_BUF_CTL(port));
> diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c
> b/drivers/gpu/drm/i915/intel_dp_mst.c
> index 8e3aad0ea60b..187f3f05a828 100644
> --- a/drivers/gpu/drm/i915/intel_dp_mst.c
> +++ b/drivers/gpu/drm/i915/intel_dp_mst.c
> @@ -164,15 +164,19 @@ static void intel_mst_post_disable_dp(struct
> intel_encoder *encoder,
>  
>  	drm_dp_mst_deallocate_vcpi(&intel_dp->mst_mgr, connector->port);
>  
> +	/*
> +	 * Power down mst path before disabling the port, otherwise we end
> +	 * up getting interrupts from the sink upon detecting link loss.
> +	 */
> +	drm_dp_send_power_updown_phy(&intel_dp->mst_mgr, connector->port,
> +				     false);
> +
>  	intel_dp->active_mst_links--;
>  
>  	intel_mst->connector = NULL;
> -	if (intel_dp->active_mst_links == 0) {
> +	if (intel_dp->active_mst_links == 0)
>  		intel_dig_port->base.post_disable(&intel_dig_port->base,
>  						  NULL, NULL);
> -
> -		intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_OFF);
> -	}
>  }
>  
>  static void intel_mst_pre_enable_dp(struct intel_encoder *encoder,
> @@ -197,6 +201,7 @@ static void intel_mst_pre_enable_dp(struct intel_encoder
> *encoder,
>  
>  	DRM_DEBUG_KMS("%d\n", intel_dp->active_mst_links);
>  
> +	drm_dp_send_power_updown_phy(&intel_dp->mst_mgr, connector->port,
> true);
>  	if (intel_dp->active_mst_links == 0)
>  		intel_dig_port->base.pre_enable(&intel_dig_port->base,
>  						pipe_config, NULL);
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2] drm/i915/mst: Use MST sideband message transactions for dpms control
  2017-09-13 20:06 [PATCH v2] drm/i915/mst: Use MST sideband message transactions for dpms control Dhinakaran Pandiyan
                   ` (2 preceding siblings ...)
  2017-09-14 17:37 ` [PATCH v2] " Lyude Paul
@ 2017-09-18  8:30 ` Maarten Lankhorst
  2017-09-19 17:57 ` Pandiyan, Dhinakaran
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Maarten Lankhorst @ 2017-09-18  8:30 UTC (permalink / raw)
  To: Dhinakaran Pandiyan, intel-gfx

Op 13-09-17 om 22:06 schreef Dhinakaran Pandiyan:
> Use the POWER_DOWN_PHY and POWER_UP_PHY sideband message transactions to
> set power states for downstream sinks. Apart from giving us the ability
> to set power state for individual sinks, this fixes the below test for
> me.
>
> $ xrandr --display :0 --output DP-2-2-8 --off
> $ xrandr --display :0 --output DP-2-2-1 --off
> $ xrandr --display :0 --output DP-2-2-8 --auto #Black screen
> $ xrandr --display :0 --output DP-2-2-1 --auto
>
> v2: Modify and document the dpms and port disable order (Ville)
>     Add comment explaining is_mst = !crtc_state equivalence(Ville, Maarten)
>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: Lyude <lyude@redhat.com>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Acked-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_ddi.c    | 18 ++++++++++++++----
>  drivers/gpu/drm/i915/intel_dp_mst.c | 13 +++++++++----
>  2 files changed, 23 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
> index 1da3bb2cc4b4..0053d66393f8 100644
> --- a/drivers/gpu/drm/i915/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/intel_ddi.c
> @@ -2161,7 +2161,8 @@ static void intel_ddi_pre_enable_dp(struct intel_encoder *encoder,
>  		intel_prepare_dp_ddi_buffers(encoder);
>  
>  	intel_ddi_init_dp_buf_reg(encoder);
> -	intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_ON);
> +	if (!link_mst)
> +		intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_ON);
>  	intel_dp_start_link_train(intel_dp);
>  	if (port != PORT_A || INTEL_GEN(dev_priv) >= 9)
>  		intel_dp_stop_link_train(intel_dp);
> @@ -2235,12 +2236,21 @@ static void intel_ddi_post_disable(struct intel_encoder *intel_encoder,
>  	uint32_t val;
>  	bool wait = false;
>  
> -	/* old_crtc_state and old_conn_state are NULL when called from DP_MST */
> -
>  	if (type == INTEL_OUTPUT_DP || type == INTEL_OUTPUT_EDP) {
> +		/*
> +		 * old_crtc_state and old_conn_state are NULL when called from
> +		 * DP_MST. The main connector associated with this port is never
> +		 * bound to a crtc for MST.
> +		 */
> +		bool is_mst = !old_crtc_state;
>  		struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
>  
> -		intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_OFF);
> +		/*
> +		 * Power down sink before disabling the port, otherwise we end
> +		 * up getting interrupts from the sink on detecting link loss.
> +		 */
> +		if (!is_mst)
> +			intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_OFF);
>  	}
>  
>  	val = I915_READ(DDI_BUF_CTL(port));
> diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i915/intel_dp_mst.c
> index 8e3aad0ea60b..187f3f05a828 100644
> --- a/drivers/gpu/drm/i915/intel_dp_mst.c
> +++ b/drivers/gpu/drm/i915/intel_dp_mst.c
> @@ -164,15 +164,19 @@ static void intel_mst_post_disable_dp(struct intel_encoder *encoder,
>  
>  	drm_dp_mst_deallocate_vcpi(&intel_dp->mst_mgr, connector->port);
>  
> +	/*
> +	 * Power down mst path before disabling the port, otherwise we end
> +	 * up getting interrupts from the sink upon detecting link loss.
> +	 */
> +	drm_dp_send_power_updown_phy(&intel_dp->mst_mgr, connector->port,
> +				     false);
> +
>  	intel_dp->active_mst_links--;
>  
>  	intel_mst->connector = NULL;
> -	if (intel_dp->active_mst_links == 0) {
> +	if (intel_dp->active_mst_links == 0)
>  		intel_dig_port->base.post_disable(&intel_dig_port->base,
>  						  NULL, NULL);
> -
> -		intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_OFF);
> -	}
>  }
>  
>  static void intel_mst_pre_enable_dp(struct intel_encoder *encoder,
> @@ -197,6 +201,7 @@ static void intel_mst_pre_enable_dp(struct intel_encoder *encoder,
>  
>  	DRM_DEBUG_KMS("%d\n", intel_dp->active_mst_links);
>  
> +	drm_dp_send_power_updown_phy(&intel_dp->mst_mgr, connector->port, true);
>  	if (intel_dp->active_mst_links == 0)
>  		intel_dig_port->base.pre_enable(&intel_dig_port->base,
>  						pipe_config, NULL);


_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2] drm/i915/mst: Use MST sideband message transactions for dpms control
  2017-09-13 20:06 [PATCH v2] drm/i915/mst: Use MST sideband message transactions for dpms control Dhinakaran Pandiyan
                   ` (3 preceding siblings ...)
  2017-09-18  8:30 ` Maarten Lankhorst
@ 2017-09-19 17:57 ` Pandiyan, Dhinakaran
  2017-10-03 14:22 ` [PATCH v3] " Jani Nikula
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Pandiyan, Dhinakaran @ 2017-09-19 17:57 UTC (permalink / raw)
  To: intel-gfx@lists.freedesktop.org

On Wed, 2017-09-13 at 13:06 -0700, Dhinakaran Pandiyan wrote:
> Use the POWER_DOWN_PHY and POWER_UP_PHY sideband message transactions to
> set power states for downstream sinks. Apart from giving us the ability
> to set power state for individual sinks, this fixes the below test for
> me.
> 
> $ xrandr --display :0 --output DP-2-2-8 --off
> $ xrandr --display :0 --output DP-2-2-1 --off
> $ xrandr --display :0 --output DP-2-2-8 --auto #Black screen
> $ xrandr --display :0 --output DP-2-2-1 --auto
> 
> v2: Modify and document the dpms and port disable order (Ville)
>     Add comment explaining is_mst = !crtc_state equivalence(Ville, Maarten)
> 

The patch probably does not fix all problems of these bugs, but some
problems do go away.

References: https://bugs.freedesktop.org/show_bug.cgi?id=90963
References: https://bugs.freedesktop.org/show_bug.cgi?id=88124

Thanks for the reviews.
-DK


> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: Lyude <lyude@redhat.com>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_ddi.c    | 18 ++++++++++++++----
>  drivers/gpu/drm/i915/intel_dp_mst.c | 13 +++++++++----
>  2 files changed, 23 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
> index 1da3bb2cc4b4..0053d66393f8 100644
> --- a/drivers/gpu/drm/i915/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/intel_ddi.c
> @@ -2161,7 +2161,8 @@ static void intel_ddi_pre_enable_dp(struct intel_encoder *encoder,
>  		intel_prepare_dp_ddi_buffers(encoder);
>  
>  	intel_ddi_init_dp_buf_reg(encoder);
> -	intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_ON);
> +	if (!link_mst)
> +		intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_ON);
>  	intel_dp_start_link_train(intel_dp);
>  	if (port != PORT_A || INTEL_GEN(dev_priv) >= 9)
>  		intel_dp_stop_link_train(intel_dp);
> @@ -2235,12 +2236,21 @@ static void intel_ddi_post_disable(struct intel_encoder *intel_encoder,
>  	uint32_t val;
>  	bool wait = false;
>  
> -	/* old_crtc_state and old_conn_state are NULL when called from DP_MST */
> -
>  	if (type == INTEL_OUTPUT_DP || type == INTEL_OUTPUT_EDP) {
> +		/*
> +		 * old_crtc_state and old_conn_state are NULL when called from
> +		 * DP_MST. The main connector associated with this port is never
> +		 * bound to a crtc for MST.
> +		 */
> +		bool is_mst = !old_crtc_state;
>  		struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
>  
> -		intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_OFF);
> +		/*
> +		 * Power down sink before disabling the port, otherwise we end
> +		 * up getting interrupts from the sink on detecting link loss.
> +		 */
> +		if (!is_mst)
> +			intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_OFF);
>  	}
>  
>  	val = I915_READ(DDI_BUF_CTL(port));
> diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i915/intel_dp_mst.c
> index 8e3aad0ea60b..187f3f05a828 100644
> --- a/drivers/gpu/drm/i915/intel_dp_mst.c
> +++ b/drivers/gpu/drm/i915/intel_dp_mst.c
> @@ -164,15 +164,19 @@ static void intel_mst_post_disable_dp(struct intel_encoder *encoder,
>  
>  	drm_dp_mst_deallocate_vcpi(&intel_dp->mst_mgr, connector->port);
>  
> +	/*
> +	 * Power down mst path before disabling the port, otherwise we end
> +	 * up getting interrupts from the sink upon detecting link loss.
> +	 */
> +	drm_dp_send_power_updown_phy(&intel_dp->mst_mgr, connector->port,
> +				     false);
> +
>  	intel_dp->active_mst_links--;
>  
>  	intel_mst->connector = NULL;
> -	if (intel_dp->active_mst_links == 0) {
> +	if (intel_dp->active_mst_links == 0)
>  		intel_dig_port->base.post_disable(&intel_dig_port->base,
>  						  NULL, NULL);
> -
> -		intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_OFF);
> -	}
>  }
>  
>  static void intel_mst_pre_enable_dp(struct intel_encoder *encoder,
> @@ -197,6 +201,7 @@ static void intel_mst_pre_enable_dp(struct intel_encoder *encoder,
>  
>  	DRM_DEBUG_KMS("%d\n", intel_dp->active_mst_links);
>  
> +	drm_dp_send_power_updown_phy(&intel_dp->mst_mgr, connector->port, true);
>  	if (intel_dp->active_mst_links == 0)
>  		intel_dig_port->base.pre_enable(&intel_dig_port->base,
>  						pipe_config, NULL);
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH v3] drm/i915/mst: Use MST sideband message transactions for dpms control
  2017-09-13 20:06 [PATCH v2] drm/i915/mst: Use MST sideband message transactions for dpms control Dhinakaran Pandiyan
                   ` (4 preceding siblings ...)
  2017-09-19 17:57 ` Pandiyan, Dhinakaran
@ 2017-10-03 14:22 ` Jani Nikula
  2017-10-04  8:47   ` Jani Nikula
  2017-10-03 15:05 ` ✓ Fi.CI.BAT: success for drm/i915/mst: Use MST sideband message transactions for dpms control (rev2) Patchwork
  2017-10-03 16:23 ` ✓ Fi.CI.IGT: " Patchwork
  7 siblings, 1 reply; 13+ messages in thread
From: Jani Nikula @ 2017-10-03 14:22 UTC (permalink / raw)
  To: Dhinakaran Pandiyan, intel-gfx; +Cc: Jani Nikula

From: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>

Use the POWER_DOWN_PHY and POWER_UP_PHY sideband message transactions to
set power states for downstream sinks. Apart from giving us the ability
to set power state for individual sinks, this fixes the below test for
me.

$ xrandr --display :0 --output DP-2-2-8 --off
$ xrandr --display :0 --output DP-2-2-1 --off
$ xrandr --display :0 --output DP-2-2-8 --auto #Black screen
$ xrandr --display :0 --output DP-2-2-1 --auto

v2: Modify and document the dpms and port disable order (Ville)
    Add comment explaining is_mst = !crtc_state equivalence(Ville, Maarten)

v3 by Jani: rebase

References: https://bugs.freedesktop.org/show_bug.cgi?id=90963
References: https://bugs.freedesktop.org/show_bug.cgi?id=88124
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Lyude <lyude@redhat.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Acked-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/intel_ddi.c    | 18 ++++++++++++++----
 drivers/gpu/drm/i915/intel_dp_mst.c | 10 ++++++++--
 2 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index 65f4b6786791..511aa60e0176 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -2162,7 +2162,8 @@ static void intel_ddi_pre_enable_dp(struct intel_encoder *encoder,
 		intel_prepare_dp_ddi_buffers(encoder);
 
 	intel_ddi_init_dp_buf_reg(encoder);
-	intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_ON);
+	if (!link_mst)
+		intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_ON);
 	intel_dp_start_link_train(intel_dp);
 	if (port != PORT_A || INTEL_GEN(dev_priv) >= 9)
 		intel_dp_stop_link_train(intel_dp);
@@ -2236,12 +2237,21 @@ static void intel_ddi_post_disable(struct intel_encoder *intel_encoder,
 	uint32_t val;
 	bool wait = false;
 
-	/* old_crtc_state and old_conn_state are NULL when called from DP_MST */
-
 	if (type == INTEL_OUTPUT_DP || type == INTEL_OUTPUT_EDP) {
+		/*
+		 * old_crtc_state and old_conn_state are NULL when called from
+		 * DP_MST. The main connector associated with this port is never
+		 * bound to a crtc for MST.
+		 */
+		bool is_mst = !old_crtc_state;
 		struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
 
-		intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_OFF);
+		/*
+		 * Power down sink before disabling the port, otherwise we end
+		 * up getting interrupts from the sink on detecting link loss.
+		 */
+		if (!is_mst)
+			intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_OFF);
 	}
 
 	val = I915_READ(DDI_BUF_CTL(port));
diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i915/intel_dp_mst.c
index 9a396f483f8b..3c131e2544cf 100644
--- a/drivers/gpu/drm/i915/intel_dp_mst.c
+++ b/drivers/gpu/drm/i915/intel_dp_mst.c
@@ -162,14 +162,19 @@ static void intel_mst_post_disable_dp(struct intel_encoder *encoder,
 
 	drm_dp_mst_deallocate_vcpi(&intel_dp->mst_mgr, connector->port);
 
+	/*
+	 * Power down mst path before disabling the port, otherwise we end
+	 * up getting interrupts from the sink upon detecting link loss.
+	 */
+	drm_dp_send_power_updown_phy(&intel_dp->mst_mgr, connector->port,
+				     false);
+
 	intel_dp->active_mst_links--;
 
 	intel_mst->connector = NULL;
 	if (intel_dp->active_mst_links == 0) {
 		intel_dig_port->base.post_disable(&intel_dig_port->base,
 						  NULL, NULL);
-
-		intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_OFF);
 	}
 	DRM_DEBUG_KMS("active links %d\n", intel_dp->active_mst_links);
 }
@@ -196,6 +201,7 @@ static void intel_mst_pre_enable_dp(struct intel_encoder *encoder,
 
 	DRM_DEBUG_KMS("active links %d\n", intel_dp->active_mst_links);
 
+	drm_dp_send_power_updown_phy(&intel_dp->mst_mgr, connector->port, true);
 	if (intel_dp->active_mst_links == 0)
 		intel_dig_port->base.pre_enable(&intel_dig_port->base,
 						pipe_config, NULL);
-- 
2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* ✓ Fi.CI.BAT: success for drm/i915/mst: Use MST sideband message transactions for dpms control (rev2)
  2017-09-13 20:06 [PATCH v2] drm/i915/mst: Use MST sideband message transactions for dpms control Dhinakaran Pandiyan
                   ` (5 preceding siblings ...)
  2017-10-03 14:22 ` [PATCH v3] " Jani Nikula
@ 2017-10-03 15:05 ` Patchwork
  2017-10-03 16:23 ` ✓ Fi.CI.IGT: " Patchwork
  7 siblings, 0 replies; 13+ messages in thread
From: Patchwork @ 2017-10-03 15:05 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/mst: Use MST sideband message transactions for dpms control (rev2)
URL   : https://patchwork.freedesktop.org/series/30314/
State : success

== Summary ==

Series 30314v2 drm/i915/mst: Use MST sideband message transactions for dpms control
https://patchwork.freedesktop.org/api/1.0/series/30314/revisions/2/mbox/

Test chamelium:
        Subgroup dp-crc-fast:
                pass       -> FAIL       (fi-kbl-7500u) fdo#102514
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-b:
                pass       -> DMESG-WARN (fi-byt-n2820) fdo#101705

fdo#102514 https://bugs.freedesktop.org/show_bug.cgi?id=102514
fdo#101705 https://bugs.freedesktop.org/show_bug.cgi?id=101705

fi-bdw-5557u     total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  time:460s
fi-bdw-gvtdvm    total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:470s
fi-blb-e6850     total:289  pass:224  dwarn:1   dfail:0   fail:0   skip:64  time:396s
fi-bsw-n3050     total:289  pass:243  dwarn:0   dfail:0   fail:0   skip:46  time:584s
fi-bwr-2160      total:289  pass:184  dwarn:0   dfail:0   fail:0   skip:105 time:286s
fi-bxt-dsi       total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  time:523s
fi-bxt-j4205     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:535s
fi-byt-j1900     total:289  pass:254  dwarn:1   dfail:0   fail:0   skip:34  time:547s
fi-byt-n2820     total:289  pass:250  dwarn:1   dfail:0   fail:0   skip:38  time:530s
fi-cfl-s         total:289  pass:256  dwarn:1   dfail:0   fail:0   skip:32  time:559s
fi-cnl-y         total:289  pass:261  dwarn:1   dfail:0   fail:0   skip:27  time:617s
fi-elk-e7500     total:289  pass:230  dwarn:0   dfail:0   fail:0   skip:59  time:431s
fi-glk-1         total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:594s
fi-hsw-4770      total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:441s
fi-hsw-4770r     total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:420s
fi-ilk-650       total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  time:465s
fi-ivb-3520m     total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:508s
fi-ivb-3770      total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:481s
fi-kbl-7500u     total:289  pass:263  dwarn:1   dfail:0   fail:1   skip:24  time:491s
fi-kbl-7560u     total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  time:578s
fi-kbl-7567u     total:289  pass:265  dwarn:4   dfail:0   fail:0   skip:20  time:489s
fi-kbl-r         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:589s
fi-pnv-d510      total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  time:658s
fi-skl-6260u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:471s
fi-skl-6700k     total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:533s
fi-skl-6770hq    total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:511s
fi-skl-gvtdvm    total:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  time:474s
fi-snb-2520m     total:289  pass:251  dwarn:0   dfail:0   fail:0   skip:38  time:582s
fi-snb-2600      total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  time:433s

5a0359bf59aa712a9e81ce7f75c3cd3c884cfeee drm-tip: 2017y-10m-03d-13h-34m-56s UTC integration manifest
984a2fb137ef drm/i915/mst: Use MST sideband message transactions for dpms control

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_5880/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 13+ messages in thread

* ✓ Fi.CI.IGT: success for drm/i915/mst: Use MST sideband message transactions for dpms control (rev2)
  2017-09-13 20:06 [PATCH v2] drm/i915/mst: Use MST sideband message transactions for dpms control Dhinakaran Pandiyan
                   ` (6 preceding siblings ...)
  2017-10-03 15:05 ` ✓ Fi.CI.BAT: success for drm/i915/mst: Use MST sideband message transactions for dpms control (rev2) Patchwork
@ 2017-10-03 16:23 ` Patchwork
  7 siblings, 0 replies; 13+ messages in thread
From: Patchwork @ 2017-10-03 16:23 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/mst: Use MST sideband message transactions for dpms control (rev2)
URL   : https://patchwork.freedesktop.org/series/30314/
State : success

== Summary ==

Test kms_cursor_legacy:
        Subgroup pipe-B-torture-bo:
                incomplete -> PASS       (shard-hsw)
Test perf:
        Subgroup blocking:
                pass       -> FAIL       (shard-hsw) fdo#102252

fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252

shard-hsw        total:2429 pass:1313 dwarn:7   dfail:0   fail:26  skip:1083 time:9979s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_5880/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3] drm/i915/mst: Use MST sideband message transactions for dpms control
  2017-10-03 14:22 ` [PATCH v3] " Jani Nikula
@ 2017-10-04  8:47   ` Jani Nikula
  2017-10-04  9:05     ` Maarten Lankhorst
  2017-10-04 19:03     ` Lyude Paul
  0 siblings, 2 replies; 13+ messages in thread
From: Jani Nikula @ 2017-10-04  8:47 UTC (permalink / raw)
  To: Dhinakaran Pandiyan, intel-gfx

On Tue, 03 Oct 2017, Jani Nikula <jani.nikula@intel.com> wrote:
> From: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
>
> Use the POWER_DOWN_PHY and POWER_UP_PHY sideband message transactions to
> set power states for downstream sinks. Apart from giving us the ability
> to set power state for individual sinks, this fixes the below test for
> me.
>
> $ xrandr --display :0 --output DP-2-2-8 --off
> $ xrandr --display :0 --output DP-2-2-1 --off
> $ xrandr --display :0 --output DP-2-2-8 --auto #Black screen
> $ xrandr --display :0 --output DP-2-2-1 --auto
>
> v2: Modify and document the dpms and port disable order (Ville)
>     Add comment explaining is_mst = !crtc_state equivalence(Ville, Maarten)
>
> v3 by Jani: rebase
>
> References: https://bugs.freedesktop.org/show_bug.cgi?id=90963
> References: https://bugs.freedesktop.org/show_bug.cgi?id=88124
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: Lyude <lyude@redhat.com>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Reviewed-by: Lyude Paul <lyude@redhat.com>
> Acked-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>

Lyude, Maarten, can you confirm your rb/ack on my rebase please?

BR,
Jani.


> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_ddi.c    | 18 ++++++++++++++----
>  drivers/gpu/drm/i915/intel_dp_mst.c | 10 ++++++++--
>  2 files changed, 22 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
> index 65f4b6786791..511aa60e0176 100644
> --- a/drivers/gpu/drm/i915/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/intel_ddi.c
> @@ -2162,7 +2162,8 @@ static void intel_ddi_pre_enable_dp(struct intel_encoder *encoder,
>  		intel_prepare_dp_ddi_buffers(encoder);
>  
>  	intel_ddi_init_dp_buf_reg(encoder);
> -	intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_ON);
> +	if (!link_mst)
> +		intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_ON);
>  	intel_dp_start_link_train(intel_dp);
>  	if (port != PORT_A || INTEL_GEN(dev_priv) >= 9)
>  		intel_dp_stop_link_train(intel_dp);
> @@ -2236,12 +2237,21 @@ static void intel_ddi_post_disable(struct intel_encoder *intel_encoder,
>  	uint32_t val;
>  	bool wait = false;
>  
> -	/* old_crtc_state and old_conn_state are NULL when called from DP_MST */
> -
>  	if (type == INTEL_OUTPUT_DP || type == INTEL_OUTPUT_EDP) {
> +		/*
> +		 * old_crtc_state and old_conn_state are NULL when called from
> +		 * DP_MST. The main connector associated with this port is never
> +		 * bound to a crtc for MST.
> +		 */
> +		bool is_mst = !old_crtc_state;
>  		struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
>  
> -		intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_OFF);
> +		/*
> +		 * Power down sink before disabling the port, otherwise we end
> +		 * up getting interrupts from the sink on detecting link loss.
> +		 */
> +		if (!is_mst)
> +			intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_OFF);
>  	}
>  
>  	val = I915_READ(DDI_BUF_CTL(port));
> diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i915/intel_dp_mst.c
> index 9a396f483f8b..3c131e2544cf 100644
> --- a/drivers/gpu/drm/i915/intel_dp_mst.c
> +++ b/drivers/gpu/drm/i915/intel_dp_mst.c
> @@ -162,14 +162,19 @@ static void intel_mst_post_disable_dp(struct intel_encoder *encoder,
>  
>  	drm_dp_mst_deallocate_vcpi(&intel_dp->mst_mgr, connector->port);
>  
> +	/*
> +	 * Power down mst path before disabling the port, otherwise we end
> +	 * up getting interrupts from the sink upon detecting link loss.
> +	 */
> +	drm_dp_send_power_updown_phy(&intel_dp->mst_mgr, connector->port,
> +				     false);
> +
>  	intel_dp->active_mst_links--;
>  
>  	intel_mst->connector = NULL;
>  	if (intel_dp->active_mst_links == 0) {
>  		intel_dig_port->base.post_disable(&intel_dig_port->base,
>  						  NULL, NULL);
> -
> -		intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_OFF);
>  	}
>  	DRM_DEBUG_KMS("active links %d\n", intel_dp->active_mst_links);
>  }
> @@ -196,6 +201,7 @@ static void intel_mst_pre_enable_dp(struct intel_encoder *encoder,
>  
>  	DRM_DEBUG_KMS("active links %d\n", intel_dp->active_mst_links);
>  
> +	drm_dp_send_power_updown_phy(&intel_dp->mst_mgr, connector->port, true);
>  	if (intel_dp->active_mst_links == 0)
>  		intel_dig_port->base.pre_enable(&intel_dig_port->base,
>  						pipe_config, NULL);

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3] drm/i915/mst: Use MST sideband message transactions for dpms control
  2017-10-04  8:47   ` Jani Nikula
@ 2017-10-04  9:05     ` Maarten Lankhorst
  2017-10-04 19:03     ` Lyude Paul
  1 sibling, 0 replies; 13+ messages in thread
From: Maarten Lankhorst @ 2017-10-04  9:05 UTC (permalink / raw)
  To: Jani Nikula, Dhinakaran Pandiyan, intel-gfx

Op 04-10-17 om 10:47 schreef Jani Nikula:
> On Tue, 03 Oct 2017, Jani Nikula <jani.nikula@intel.com> wrote:
>> From: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
>>
>> Use the POWER_DOWN_PHY and POWER_UP_PHY sideband message transactions to
>> set power states for downstream sinks. Apart from giving us the ability
>> to set power state for individual sinks, this fixes the below test for
>> me.
>>
>> $ xrandr --display :0 --output DP-2-2-8 --off
>> $ xrandr --display :0 --output DP-2-2-1 --off
>> $ xrandr --display :0 --output DP-2-2-8 --auto #Black screen
>> $ xrandr --display :0 --output DP-2-2-1 --auto
>>
>> v2: Modify and document the dpms and port disable order (Ville)
>>     Add comment explaining is_mst = !crtc_state equivalence(Ville, Maarten)
>>
>> v3 by Jani: rebase
>>
>> References: https://bugs.freedesktop.org/show_bug.cgi?id=90963
>> References: https://bugs.freedesktop.org/show_bug.cgi?id=88124
>> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
>> Cc: Lyude <lyude@redhat.com>
>> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
>> Reviewed-by: Lyude Paul <lyude@redhat.com>
>> Acked-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Lyude, Maarten, can you confirm your rb/ack on my rebase please?
>
Rebase looks good.
ack stands.

:)
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3] drm/i915/mst: Use MST sideband message transactions for dpms control
  2017-10-04  8:47   ` Jani Nikula
  2017-10-04  9:05     ` Maarten Lankhorst
@ 2017-10-04 19:03     ` Lyude Paul
  2017-10-05  6:10       ` Jani Nikula
  1 sibling, 1 reply; 13+ messages in thread
From: Lyude Paul @ 2017-10-04 19:03 UTC (permalink / raw)
  To: Jani Nikula, Dhinakaran Pandiyan, intel-gfx

On Wed, 2017-10-04 at 11:47 +0300, Jani Nikula wrote:
> On Tue, 03 Oct 2017, Jani Nikula <jani.nikula@intel.com> wrote:
> > From: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> > 
> > Use the POWER_DOWN_PHY and POWER_UP_PHY sideband message transactions to
> > set power states for downstream sinks. Apart from giving us the ability
> > to set power state for individual sinks, this fixes the below test for
> > me.
> > 
> > $ xrandr --display :0 --output DP-2-2-8 --off
> > $ xrandr --display :0 --output DP-2-2-1 --off
> > $ xrandr --display :0 --output DP-2-2-8 --auto #Black screen
> > $ xrandr --display :0 --output DP-2-2-1 --auto
> > 
> > v2: Modify and document the dpms and port disable order (Ville)
> >     Add comment explaining is_mst = !crtc_state equivalence(Ville,
> > Maarten)
> > 
> > v3 by Jani: rebase
> > 
> > References: https://bugs.freedesktop.org/show_bug.cgi?id=90963
> > References: https://bugs.freedesktop.org/show_bug.cgi?id=88124
> > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > Cc: Lyude <lyude@redhat.com>
> > Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > Reviewed-by: Lyude Paul <lyude@redhat.com>
> > Acked-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> 
> Lyude, Maarten, can you confirm your rb/ack on my rebase please?
Looks good to me
> 
> BR,
> Jani.
> 
> 
> > Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> > Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_ddi.c    | 18 ++++++++++++++----
> >  drivers/gpu/drm/i915/intel_dp_mst.c | 10 ++++++++--
> >  2 files changed, 22 insertions(+), 6 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_ddi.c
> > b/drivers/gpu/drm/i915/intel_ddi.c
> > index 65f4b6786791..511aa60e0176 100644
> > --- a/drivers/gpu/drm/i915/intel_ddi.c
> > +++ b/drivers/gpu/drm/i915/intel_ddi.c
> > @@ -2162,7 +2162,8 @@ static void intel_ddi_pre_enable_dp(struct
> > intel_encoder *encoder,
> >  		intel_prepare_dp_ddi_buffers(encoder);
> >  
> >  	intel_ddi_init_dp_buf_reg(encoder);
> > -	intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_ON);
> > +	if (!link_mst)
> > +		intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_ON);
> >  	intel_dp_start_link_train(intel_dp);
> >  	if (port != PORT_A || INTEL_GEN(dev_priv) >= 9)
> >  		intel_dp_stop_link_train(intel_dp);
> > @@ -2236,12 +2237,21 @@ static void intel_ddi_post_disable(struct
> > intel_encoder *intel_encoder,
> >  	uint32_t val;
> >  	bool wait = false;
> >  
> > -	/* old_crtc_state and old_conn_state are NULL when called from
> > DP_MST */
> > -
> >  	if (type == INTEL_OUTPUT_DP || type == INTEL_OUTPUT_EDP) {
> > +		/*
> > +		 * old_crtc_state and old_conn_state are NULL when called
> > from
> > +		 * DP_MST. The main connector associated with this port
> > is never
> > +		 * bound to a crtc for MST.
> > +		 */
> > +		bool is_mst = !old_crtc_state;
> >  		struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
> >  
> > -		intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_OFF);
> > +		/*
> > +		 * Power down sink before disabling the port, otherwise
> > we end
> > +		 * up getting interrupts from the sink on detecting link
> > loss.
> > +		 */
> > +		if (!is_mst)
> > +			intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_OFF);
> >  	}
> >  
> >  	val = I915_READ(DDI_BUF_CTL(port));
> > diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c
> > b/drivers/gpu/drm/i915/intel_dp_mst.c
> > index 9a396f483f8b..3c131e2544cf 100644
> > --- a/drivers/gpu/drm/i915/intel_dp_mst.c
> > +++ b/drivers/gpu/drm/i915/intel_dp_mst.c
> > @@ -162,14 +162,19 @@ static void intel_mst_post_disable_dp(struct
> > intel_encoder *encoder,
> >  
> >  	drm_dp_mst_deallocate_vcpi(&intel_dp->mst_mgr, connector->port);
> >  
> > +	/*
> > +	 * Power down mst path before disabling the port, otherwise we
> > end
> > +	 * up getting interrupts from the sink upon detecting link loss.
> > +	 */
> > +	drm_dp_send_power_updown_phy(&intel_dp->mst_mgr, connector->port,
> > +				     false);
> > +
> >  	intel_dp->active_mst_links--;
> >  
> >  	intel_mst->connector = NULL;
> >  	if (intel_dp->active_mst_links == 0) {
> >  		intel_dig_port->base.post_disable(&intel_dig_port->base,
> >  						  NULL, NULL);
> > -
> > -		intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_OFF);
> >  	}
> >  	DRM_DEBUG_KMS("active links %d\n", intel_dp->active_mst_links);
> >  }
> > @@ -196,6 +201,7 @@ static void intel_mst_pre_enable_dp(struct
> > intel_encoder *encoder,
> >  
> >  	DRM_DEBUG_KMS("active links %d\n", intel_dp->active_mst_links);
> >  
> > +	drm_dp_send_power_updown_phy(&intel_dp->mst_mgr, connector->port, 
> > true);
> >  	if (intel_dp->active_mst_links == 0)
> >  		intel_dig_port->base.pre_enable(&intel_dig_port->base,
> >  						pipe_config, NULL);
> 
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3] drm/i915/mst: Use MST sideband message transactions for dpms control
  2017-10-04 19:03     ` Lyude Paul
@ 2017-10-05  6:10       ` Jani Nikula
  0 siblings, 0 replies; 13+ messages in thread
From: Jani Nikula @ 2017-10-05  6:10 UTC (permalink / raw)
  To: Lyude Paul, Dhinakaran Pandiyan, intel-gfx

On Wed, 04 Oct 2017, Lyude Paul <lyude@redhat.com> wrote:
> On Wed, 2017-10-04 at 11:47 +0300, Jani Nikula wrote:
>> On Tue, 03 Oct 2017, Jani Nikula <jani.nikula@intel.com> wrote:
>> > From: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
>> > 
>> > Use the POWER_DOWN_PHY and POWER_UP_PHY sideband message transactions to
>> > set power states for downstream sinks. Apart from giving us the ability
>> > to set power state for individual sinks, this fixes the below test for
>> > me.
>> > 
>> > $ xrandr --display :0 --output DP-2-2-8 --off
>> > $ xrandr --display :0 --output DP-2-2-1 --off
>> > $ xrandr --display :0 --output DP-2-2-8 --auto #Black screen
>> > $ xrandr --display :0 --output DP-2-2-1 --auto
>> > 
>> > v2: Modify and document the dpms and port disable order (Ville)
>> >     Add comment explaining is_mst = !crtc_state equivalence(Ville,
>> > Maarten)
>> > 
>> > v3 by Jani: rebase
>> > 
>> > References: https://bugs.freedesktop.org/show_bug.cgi?id=90963
>> > References: https://bugs.freedesktop.org/show_bug.cgi?id=88124
>> > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
>> > Cc: Lyude <lyude@redhat.com>
>> > Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
>> > Reviewed-by: Lyude Paul <lyude@redhat.com>
>> > Acked-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
>> 
>> Lyude, Maarten, can you confirm your rb/ack on my rebase please?
> Looks good to me

Thanks Maarten and Lyude, pushed to dinq.

BR,
Jani.

>> 
>> BR,
>> Jani.
>> 
>> 
>> > Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
>> > Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>> > ---
>> >  drivers/gpu/drm/i915/intel_ddi.c    | 18 ++++++++++++++----
>> >  drivers/gpu/drm/i915/intel_dp_mst.c | 10 ++++++++--
>> >  2 files changed, 22 insertions(+), 6 deletions(-)
>> > 
>> > diff --git a/drivers/gpu/drm/i915/intel_ddi.c
>> > b/drivers/gpu/drm/i915/intel_ddi.c
>> > index 65f4b6786791..511aa60e0176 100644
>> > --- a/drivers/gpu/drm/i915/intel_ddi.c
>> > +++ b/drivers/gpu/drm/i915/intel_ddi.c
>> > @@ -2162,7 +2162,8 @@ static void intel_ddi_pre_enable_dp(struct
>> > intel_encoder *encoder,
>> >  		intel_prepare_dp_ddi_buffers(encoder);
>> >  
>> >  	intel_ddi_init_dp_buf_reg(encoder);
>> > -	intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_ON);
>> > +	if (!link_mst)
>> > +		intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_ON);
>> >  	intel_dp_start_link_train(intel_dp);
>> >  	if (port != PORT_A || INTEL_GEN(dev_priv) >= 9)
>> >  		intel_dp_stop_link_train(intel_dp);
>> > @@ -2236,12 +2237,21 @@ static void intel_ddi_post_disable(struct
>> > intel_encoder *intel_encoder,
>> >  	uint32_t val;
>> >  	bool wait = false;
>> >  
>> > -	/* old_crtc_state and old_conn_state are NULL when called from
>> > DP_MST */
>> > -
>> >  	if (type == INTEL_OUTPUT_DP || type == INTEL_OUTPUT_EDP) {
>> > +		/*
>> > +		 * old_crtc_state and old_conn_state are NULL when called
>> > from
>> > +		 * DP_MST. The main connector associated with this port
>> > is never
>> > +		 * bound to a crtc for MST.
>> > +		 */
>> > +		bool is_mst = !old_crtc_state;
>> >  		struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
>> >  
>> > -		intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_OFF);
>> > +		/*
>> > +		 * Power down sink before disabling the port, otherwise
>> > we end
>> > +		 * up getting interrupts from the sink on detecting link
>> > loss.
>> > +		 */
>> > +		if (!is_mst)
>> > +			intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_OFF);
>> >  	}
>> >  
>> >  	val = I915_READ(DDI_BUF_CTL(port));
>> > diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c
>> > b/drivers/gpu/drm/i915/intel_dp_mst.c
>> > index 9a396f483f8b..3c131e2544cf 100644
>> > --- a/drivers/gpu/drm/i915/intel_dp_mst.c
>> > +++ b/drivers/gpu/drm/i915/intel_dp_mst.c
>> > @@ -162,14 +162,19 @@ static void intel_mst_post_disable_dp(struct
>> > intel_encoder *encoder,
>> >  
>> >  	drm_dp_mst_deallocate_vcpi(&intel_dp->mst_mgr, connector->port);
>> >  
>> > +	/*
>> > +	 * Power down mst path before disabling the port, otherwise we
>> > end
>> > +	 * up getting interrupts from the sink upon detecting link loss.
>> > +	 */
>> > +	drm_dp_send_power_updown_phy(&intel_dp->mst_mgr, connector->port,
>> > +				     false);
>> > +
>> >  	intel_dp->active_mst_links--;
>> >  
>> >  	intel_mst->connector = NULL;
>> >  	if (intel_dp->active_mst_links == 0) {
>> >  		intel_dig_port->base.post_disable(&intel_dig_port->base,
>> >  						  NULL, NULL);
>> > -
>> > -		intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_OFF);
>> >  	}
>> >  	DRM_DEBUG_KMS("active links %d\n", intel_dp->active_mst_links);
>> >  }
>> > @@ -196,6 +201,7 @@ static void intel_mst_pre_enable_dp(struct
>> > intel_encoder *encoder,
>> >  
>> >  	DRM_DEBUG_KMS("active links %d\n", intel_dp->active_mst_links);
>> >  
>> > +	drm_dp_send_power_updown_phy(&intel_dp->mst_mgr, connector->port, 
>> > true);
>> >  	if (intel_dp->active_mst_links == 0)
>> >  		intel_dig_port->base.pre_enable(&intel_dig_port->base,
>> >  						pipe_config, NULL);
>> 
>> 

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2017-10-05  6:10 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-13 20:06 [PATCH v2] drm/i915/mst: Use MST sideband message transactions for dpms control Dhinakaran Pandiyan
2017-09-13 20:27 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-09-14  5:11 ` ✓ Fi.CI.IGT: " Patchwork
2017-09-14 17:37 ` [PATCH v2] " Lyude Paul
2017-09-18  8:30 ` Maarten Lankhorst
2017-09-19 17:57 ` Pandiyan, Dhinakaran
2017-10-03 14:22 ` [PATCH v3] " Jani Nikula
2017-10-04  8:47   ` Jani Nikula
2017-10-04  9:05     ` Maarten Lankhorst
2017-10-04 19:03     ` Lyude Paul
2017-10-05  6:10       ` Jani Nikula
2017-10-03 15:05 ` ✓ Fi.CI.BAT: success for drm/i915/mst: Use MST sideband message transactions for dpms control (rev2) Patchwork
2017-10-03 16:23 ` ✓ Fi.CI.IGT: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox