public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Fix new_config and new_enabled for load detect
@ 2014-01-16 14:59 ville.syrjala
  2014-01-17 13:59 ` [PATCH v2] " ville.syrjala
  0 siblings, 1 reply; 4+ messages in thread
From: ville.syrjala @ 2014-01-16 14:59 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

I forgot to set new_config and new_enabled appropriately in the load
detect code. Fix it up.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index dde98020..ec2fc95 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -7825,6 +7825,8 @@ bool intel_get_load_detect_pipe(struct drm_connector *connector,
 	to_intel_connector(connector)->new_encoder = intel_encoder;
 
 	intel_crtc = to_intel_crtc(crtc);
+	intel_crtc->new_enabled = true;
+	intel_crtc->new_config = &intel_crtc->config;
 	old->dpms_mode = connector->dpms;
 	old->load_detect_temp = true;
 	old->release_fb = NULL;
@@ -7856,6 +7858,11 @@ bool intel_get_load_detect_pipe(struct drm_connector *connector,
 		DRM_DEBUG_KMS("failed to set mode on load-detect pipe\n");
 		if (old->release_fb)
 			old->release_fb->funcs->destroy(old->release_fb);
+		intel_crtc->new_enabled = crtc->enabled;
+		if (intel_crtc->new_enabled)
+			intel_crtc->new_config = &intel_crtc->config;
+		else
+			intel_crtc->new_config = NULL;
 		mutex_unlock(&crtc->mutex);
 		return false;
 	}
@@ -7872,6 +7879,7 @@ void intel_release_load_detect_pipe(struct drm_connector *connector,
 		intel_attached_encoder(connector);
 	struct drm_encoder *encoder = &intel_encoder->base;
 	struct drm_crtc *crtc = encoder->crtc;
+	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
 
 	DRM_DEBUG_KMS("[CONNECTOR:%d:%s], [ENCODER:%d:%s]\n",
 		      connector->base.id, drm_get_connector_name(connector),
@@ -7880,6 +7888,8 @@ void intel_release_load_detect_pipe(struct drm_connector *connector,
 	if (old->load_detect_temp) {
 		to_intel_connector(connector)->new_encoder = NULL;
 		intel_encoder->new_crtc = NULL;
+		intel_crtc->new_enabled = false;
+		intel_crtc->new_config = NULL;
 		intel_set_mode(crtc, NULL, 0, 0, NULL);
 
 		if (old->release_fb) {
-- 
1.8.3.2

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

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

* [PATCH v2] drm/i915: Fix new_config and new_enabled for load detect
  2014-01-16 14:59 [PATCH] drm/i915: Fix new_config and new_enabled for load detect ville.syrjala
@ 2014-01-17 13:59 ` ville.syrjala
  2014-01-17 14:10   ` Imre Deak
  0 siblings, 1 reply; 4+ messages in thread
From: ville.syrjala @ 2014-01-17 13:59 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

I forgot to set new_config and new_enabled appropriately in the load
detect code. Fix it up.

v2: Handle the other error path in intel_get_load_detect_pipe() too (Imre)

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index dde98020..15f55e8 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -7825,6 +7825,8 @@ bool intel_get_load_detect_pipe(struct drm_connector *connector,
 	to_intel_connector(connector)->new_encoder = intel_encoder;
 
 	intel_crtc = to_intel_crtc(crtc);
+	intel_crtc->new_enabled = true;
+	intel_crtc->new_config = &intel_crtc->config;
 	old->dpms_mode = connector->dpms;
 	old->load_detect_temp = true;
 	old->release_fb = NULL;
@@ -7848,21 +7850,28 @@ bool intel_get_load_detect_pipe(struct drm_connector *connector,
 		DRM_DEBUG_KMS("reusing fbdev for load-detection framebuffer\n");
 	if (IS_ERR(fb)) {
 		DRM_DEBUG_KMS("failed to allocate framebuffer for load-detection\n");
-		mutex_unlock(&crtc->mutex);
-		return false;
+		goto fail;
 	}
 
 	if (intel_set_mode(crtc, mode, 0, 0, fb)) {
 		DRM_DEBUG_KMS("failed to set mode on load-detect pipe\n");
 		if (old->release_fb)
 			old->release_fb->funcs->destroy(old->release_fb);
-		mutex_unlock(&crtc->mutex);
-		return false;
+		goto fail;
 	}
 
 	/* let the connector get through one full cycle before testing */
 	intel_wait_for_vblank(dev, intel_crtc->pipe);
 	return true;
+
+ fail:
+	intel_crtc->new_enabled = crtc->enabled;
+	if (intel_crtc->new_enabled)
+		intel_crtc->new_config = &intel_crtc->config;
+	else
+		intel_crtc->new_config = NULL;
+	mutex_unlock(&crtc->mutex);
+	return false;
 }
 
 void intel_release_load_detect_pipe(struct drm_connector *connector,
@@ -7872,6 +7881,7 @@ void intel_release_load_detect_pipe(struct drm_connector *connector,
 		intel_attached_encoder(connector);
 	struct drm_encoder *encoder = &intel_encoder->base;
 	struct drm_crtc *crtc = encoder->crtc;
+	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
 
 	DRM_DEBUG_KMS("[CONNECTOR:%d:%s], [ENCODER:%d:%s]\n",
 		      connector->base.id, drm_get_connector_name(connector),
@@ -7880,6 +7890,8 @@ void intel_release_load_detect_pipe(struct drm_connector *connector,
 	if (old->load_detect_temp) {
 		to_intel_connector(connector)->new_encoder = NULL;
 		intel_encoder->new_crtc = NULL;
+		intel_crtc->new_enabled = false;
+		intel_crtc->new_config = NULL;
 		intel_set_mode(crtc, NULL, 0, 0, NULL);
 
 		if (old->release_fb) {
-- 
1.8.3.2

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

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

* Re: [PATCH v2] drm/i915: Fix new_config and new_enabled for load detect
  2014-01-17 13:59 ` [PATCH v2] " ville.syrjala
@ 2014-01-17 14:10   ` Imre Deak
  2014-01-17 17:15     ` Daniel Vetter
  0 siblings, 1 reply; 4+ messages in thread
From: Imre Deak @ 2014-01-17 14:10 UTC (permalink / raw)
  To: ville.syrjala; +Cc: intel-gfx


[-- Attachment #1.1: Type: text/plain, Size: 3077 bytes --]

On Fri, 2014-01-17 at 15:59 +0200, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> I forgot to set new_config and new_enabled appropriately in the load
> detect code. Fix it up.
> 
> v2: Handle the other error path in intel_get_load_detect_pipe() too (Imre)
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Reviewed-by: Imre Deak <imre.deak@intel.com>

> ---
>  drivers/gpu/drm/i915/intel_display.c | 20 ++++++++++++++++----
>  1 file changed, 16 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index dde98020..15f55e8 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -7825,6 +7825,8 @@ bool intel_get_load_detect_pipe(struct drm_connector *connector,
>  	to_intel_connector(connector)->new_encoder = intel_encoder;
>  
>  	intel_crtc = to_intel_crtc(crtc);
> +	intel_crtc->new_enabled = true;
> +	intel_crtc->new_config = &intel_crtc->config;
>  	old->dpms_mode = connector->dpms;
>  	old->load_detect_temp = true;
>  	old->release_fb = NULL;
> @@ -7848,21 +7850,28 @@ bool intel_get_load_detect_pipe(struct drm_connector *connector,
>  		DRM_DEBUG_KMS("reusing fbdev for load-detection framebuffer\n");
>  	if (IS_ERR(fb)) {
>  		DRM_DEBUG_KMS("failed to allocate framebuffer for load-detection\n");
> -		mutex_unlock(&crtc->mutex);
> -		return false;
> +		goto fail;
>  	}
>  
>  	if (intel_set_mode(crtc, mode, 0, 0, fb)) {
>  		DRM_DEBUG_KMS("failed to set mode on load-detect pipe\n");
>  		if (old->release_fb)
>  			old->release_fb->funcs->destroy(old->release_fb);
> -		mutex_unlock(&crtc->mutex);
> -		return false;
> +		goto fail;
>  	}
>  
>  	/* let the connector get through one full cycle before testing */
>  	intel_wait_for_vblank(dev, intel_crtc->pipe);
>  	return true;
> +
> + fail:
> +	intel_crtc->new_enabled = crtc->enabled;
> +	if (intel_crtc->new_enabled)
> +		intel_crtc->new_config = &intel_crtc->config;
> +	else
> +		intel_crtc->new_config = NULL;
> +	mutex_unlock(&crtc->mutex);
> +	return false;
>  }
>  
>  void intel_release_load_detect_pipe(struct drm_connector *connector,
> @@ -7872,6 +7881,7 @@ void intel_release_load_detect_pipe(struct drm_connector *connector,
>  		intel_attached_encoder(connector);
>  	struct drm_encoder *encoder = &intel_encoder->base;
>  	struct drm_crtc *crtc = encoder->crtc;
> +	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
>  
>  	DRM_DEBUG_KMS("[CONNECTOR:%d:%s], [ENCODER:%d:%s]\n",
>  		      connector->base.id, drm_get_connector_name(connector),
> @@ -7880,6 +7890,8 @@ void intel_release_load_detect_pipe(struct drm_connector *connector,
>  	if (old->load_detect_temp) {
>  		to_intel_connector(connector)->new_encoder = NULL;
>  		intel_encoder->new_crtc = NULL;
> +		intel_crtc->new_enabled = false;
> +		intel_crtc->new_config = NULL;
>  		intel_set_mode(crtc, NULL, 0, 0, NULL);
>  
>  		if (old->release_fb) {


[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

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

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

* Re: [PATCH v2] drm/i915: Fix new_config and new_enabled for load detect
  2014-01-17 14:10   ` Imre Deak
@ 2014-01-17 17:15     ` Daniel Vetter
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel Vetter @ 2014-01-17 17:15 UTC (permalink / raw)
  To: Imre Deak; +Cc: intel-gfx

On Fri, Jan 17, 2014 at 04:10:49PM +0200, Imre Deak wrote:
> On Fri, 2014-01-17 at 15:59 +0200, ville.syrjala@linux.intel.com wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > I forgot to set new_config and new_enabled appropriately in the load
> > detect code. Fix it up.
> > 
> > v2: Handle the other error path in intel_get_load_detect_pipe() too (Imre)
> > 
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Reviewed-by: Imre Deak <imre.deak@intel.com>

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

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

end of thread, other threads:[~2014-01-17 17:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-16 14:59 [PATCH] drm/i915: Fix new_config and new_enabled for load detect ville.syrjala
2014-01-17 13:59 ` [PATCH v2] " ville.syrjala
2014-01-17 14:10   ` Imre Deak
2014-01-17 17:15     ` Daniel Vetter

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