Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: document why dvo/sdvo/crt need a special dpms function
@ 2013-05-28  9:35 Jani Nikula
  2013-05-28  9:57 ` Daniel Vetter
  0 siblings, 1 reply; 2+ messages in thread
From: Jani Nikula @ 2013-05-28  9:35 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula

In the cloned case, changing just one output but keeping the other, the
pipe state won't change and intel_crtc_update_dpms will be a nop, but we
still need to update the dpms state of the output being changed.

Only dvo, sdvo and crt are cloneable, so only those three have special
dpms functions.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/intel_crt.c  |    4 +++-
 drivers/gpu/drm/i915/intel_dvo.c  |    3 +++
 drivers/gpu/drm/i915/intel_sdvo.c |    3 +++
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c
index 5e9f93e..3acec8c 100644
--- a/drivers/gpu/drm/i915/intel_crt.c
+++ b/drivers/gpu/drm/i915/intel_crt.c
@@ -149,7 +149,7 @@ static void intel_enable_crt(struct intel_encoder *encoder)
 	intel_crt_set_dpms(encoder, crt->connector->base.dpms);
 }
 
-
+/* Special dpms function to support cloning between dvo/sdvo/crt. */
 static void intel_crt_dpms(struct drm_connector *connector, int mode)
 {
 	struct drm_device *dev = connector->dev;
@@ -180,6 +180,8 @@ static void intel_crt_dpms(struct drm_connector *connector, int mode)
 	else
 		encoder->connectors_active = true;
 
+	/* We call connector dpms manually below in case pipe dpms doesn't
+	 * change due to cloning. */
 	if (mode < old_dpms) {
 		/* From off to on, enable the pipe first. */
 		intel_crtc_update_dpms(crtc);
diff --git a/drivers/gpu/drm/i915/intel_dvo.c b/drivers/gpu/drm/i915/intel_dvo.c
index 9e80d48..eb2020e 100644
--- a/drivers/gpu/drm/i915/intel_dvo.c
+++ b/drivers/gpu/drm/i915/intel_dvo.c
@@ -180,6 +180,7 @@ static void intel_enable_dvo(struct intel_encoder *encoder)
 	intel_dvo->dev.dev_ops->dpms(&intel_dvo->dev, true);
 }
 
+/* Special dpms function to support cloning between dvo/sdvo/crt. */
 static void intel_dvo_dpms(struct drm_connector *connector, int mode)
 {
 	struct intel_dvo *intel_dvo = intel_attached_dvo(connector);
@@ -201,6 +202,8 @@ static void intel_dvo_dpms(struct drm_connector *connector, int mode)
 		return;
 	}
 
+	/* We call connector dpms manually below in case pipe dpms doesn't
+	 * change due to cloning. */
 	if (mode == DRM_MODE_DPMS_ON) {
 		intel_dvo->base.connectors_active = true;
 
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
index 4d4a3f0..7068195 100644
--- a/drivers/gpu/drm/i915/intel_sdvo.c
+++ b/drivers/gpu/drm/i915/intel_sdvo.c
@@ -1416,6 +1416,7 @@ static void intel_enable_sdvo(struct intel_encoder *encoder)
 	intel_sdvo_set_active_outputs(intel_sdvo, intel_sdvo->attached_output);
 }
 
+/* Special dpms function to support cloning between dvo/sdvo/crt. */
 static void intel_sdvo_dpms(struct drm_connector *connector, int mode)
 {
 	struct drm_crtc *crtc;
@@ -1437,6 +1438,8 @@ static void intel_sdvo_dpms(struct drm_connector *connector, int mode)
 		return;
 	}
 
+	/* We set active outputs manually below in case pipe dpms doesn't change
+	 * due to cloning. */
 	if (mode != DRM_MODE_DPMS_ON) {
 		intel_sdvo_set_active_outputs(intel_sdvo, 0);
 		if (0)
-- 
1.7.9.5

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

* Re: [PATCH] drm/i915: document why dvo/sdvo/crt need a special dpms function
  2013-05-28  9:35 [PATCH] drm/i915: document why dvo/sdvo/crt need a special dpms function Jani Nikula
@ 2013-05-28  9:57 ` Daniel Vetter
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Vetter @ 2013-05-28  9:57 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx

On Tue, May 28, 2013 at 12:35:02PM +0300, Jani Nikula wrote:
> In the cloned case, changing just one output but keeping the other, the
> pipe state won't change and intel_crtc_update_dpms will be a nop, but we
> still need to update the dpms state of the output being changed.
> 
> Only dvo, sdvo and crt are cloneable, so only those three have special
> dpms functions.
> 
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>

Queued for -next since it took me a few minutes of digging myself to
figure this out again (git blame helped though), thanks for the patch.
-Daniel

> ---
>  drivers/gpu/drm/i915/intel_crt.c  |    4 +++-
>  drivers/gpu/drm/i915/intel_dvo.c  |    3 +++
>  drivers/gpu/drm/i915/intel_sdvo.c |    3 +++
>  3 files changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c
> index 5e9f93e..3acec8c 100644
> --- a/drivers/gpu/drm/i915/intel_crt.c
> +++ b/drivers/gpu/drm/i915/intel_crt.c
> @@ -149,7 +149,7 @@ static void intel_enable_crt(struct intel_encoder *encoder)
>  	intel_crt_set_dpms(encoder, crt->connector->base.dpms);
>  }
>  
> -
> +/* Special dpms function to support cloning between dvo/sdvo/crt. */
>  static void intel_crt_dpms(struct drm_connector *connector, int mode)
>  {
>  	struct drm_device *dev = connector->dev;
> @@ -180,6 +180,8 @@ static void intel_crt_dpms(struct drm_connector *connector, int mode)
>  	else
>  		encoder->connectors_active = true;
>  
> +	/* We call connector dpms manually below in case pipe dpms doesn't
> +	 * change due to cloning. */
>  	if (mode < old_dpms) {
>  		/* From off to on, enable the pipe first. */
>  		intel_crtc_update_dpms(crtc);
> diff --git a/drivers/gpu/drm/i915/intel_dvo.c b/drivers/gpu/drm/i915/intel_dvo.c
> index 9e80d48..eb2020e 100644
> --- a/drivers/gpu/drm/i915/intel_dvo.c
> +++ b/drivers/gpu/drm/i915/intel_dvo.c
> @@ -180,6 +180,7 @@ static void intel_enable_dvo(struct intel_encoder *encoder)
>  	intel_dvo->dev.dev_ops->dpms(&intel_dvo->dev, true);
>  }
>  
> +/* Special dpms function to support cloning between dvo/sdvo/crt. */
>  static void intel_dvo_dpms(struct drm_connector *connector, int mode)
>  {
>  	struct intel_dvo *intel_dvo = intel_attached_dvo(connector);
> @@ -201,6 +202,8 @@ static void intel_dvo_dpms(struct drm_connector *connector, int mode)
>  		return;
>  	}
>  
> +	/* We call connector dpms manually below in case pipe dpms doesn't
> +	 * change due to cloning. */
>  	if (mode == DRM_MODE_DPMS_ON) {
>  		intel_dvo->base.connectors_active = true;
>  
> diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
> index 4d4a3f0..7068195 100644
> --- a/drivers/gpu/drm/i915/intel_sdvo.c
> +++ b/drivers/gpu/drm/i915/intel_sdvo.c
> @@ -1416,6 +1416,7 @@ static void intel_enable_sdvo(struct intel_encoder *encoder)
>  	intel_sdvo_set_active_outputs(intel_sdvo, intel_sdvo->attached_output);
>  }
>  
> +/* Special dpms function to support cloning between dvo/sdvo/crt. */
>  static void intel_sdvo_dpms(struct drm_connector *connector, int mode)
>  {
>  	struct drm_crtc *crtc;
> @@ -1437,6 +1438,8 @@ static void intel_sdvo_dpms(struct drm_connector *connector, int mode)
>  		return;
>  	}
>  
> +	/* We set active outputs manually below in case pipe dpms doesn't change
> +	 * due to cloning. */
>  	if (mode != DRM_MODE_DPMS_ON) {
>  		intel_sdvo_set_active_outputs(intel_sdvo, 0);
>  		if (0)
> -- 
> 1.7.9.5
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

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

end of thread, other threads:[~2013-05-28  9:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-28  9:35 [PATCH] drm/i915: document why dvo/sdvo/crt need a special dpms function Jani Nikula
2013-05-28  9:57 ` Daniel Vetter

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