All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Extract intel_encoder_has_connectors()
@ 2016-02-17 19:28 ville.syrjala
  2016-02-18  7:59 ` ✓ Fi.CI.BAT: success for " Patchwork
  2016-02-18 11:02 ` [PATCH] " Daniel Vetter
  0 siblings, 2 replies; 4+ messages in thread
From: ville.syrjala @ 2016-02-17 19:28 UTC (permalink / raw)
  To: intel-gfx

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

We have an open coded loop which tries to see if the encoder has any
connectors linked to it. Let's extract that to a helper similar to
intel_crtc_has_encoders().

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

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index afcabe455ad1..4071b75a7247 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -15486,6 +15486,17 @@ static bool intel_crtc_has_encoders(struct intel_crtc *crtc)
 	return false;
 }
 
+static bool intel_encoder_has_connectors(struct intel_encoder *encoder)
+{
+	struct drm_device *dev = encoder->base.dev;
+	struct intel_connector *connector;
+
+	for_each_connector_on_encoder(dev, &encoder->base, connector)
+		return true;
+
+	return false;
+}
+
 static void intel_sanitize_crtc(struct intel_crtc *crtc)
 {
 	struct drm_device *dev = crtc->base.dev;
@@ -15596,7 +15607,6 @@ static void intel_sanitize_encoder(struct intel_encoder *encoder)
 {
 	struct intel_connector *connector;
 	struct drm_device *dev = encoder->base.dev;
-	bool active = false;
 
 	/* We need to check both for a crtc link (meaning that the
 	 * encoder is active and trying to read from a pipe) and the
@@ -15604,15 +15614,7 @@ static void intel_sanitize_encoder(struct intel_encoder *encoder)
 	bool has_active_crtc = encoder->base.crtc &&
 		to_intel_crtc(encoder->base.crtc)->active;
 
-	for_each_intel_connector(dev, connector) {
-		if (connector->base.encoder != &encoder->base)
-			continue;
-
-		active = true;
-		break;
-	}
-
-	if (active && !has_active_crtc) {
+	if (intel_encoder_has_connectors(encoder) && !has_active_crtc) {
 		DRM_DEBUG_KMS("[ENCODER:%d:%s] has active connectors but no active pipe!\n",
 			      encoder->base.base.id,
 			      encoder->base.name);
-- 
2.4.10

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

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

* ✓ Fi.CI.BAT: success for drm/i915: Extract intel_encoder_has_connectors()
  2016-02-17 19:28 [PATCH] drm/i915: Extract intel_encoder_has_connectors() ville.syrjala
@ 2016-02-18  7:59 ` Patchwork
  2016-02-18 13:25   ` Ville Syrjälä
  2016-02-18 11:02 ` [PATCH] " Daniel Vetter
  1 sibling, 1 reply; 4+ messages in thread
From: Patchwork @ 2016-02-18  7:59 UTC (permalink / raw)
  To: ville.syrjala; +Cc: intel-gfx

== Summary ==

Series 3540v1 drm/i915: Extract intel_encoder_has_connectors()
http://patchwork.freedesktop.org/api/1.0/series/3540/revisions/1/mbox/

Test kms_flip:
        Subgroup basic-flip-vs-dpms:
                dmesg-warn -> PASS       (ilk-hp8440p) UNSTABLE
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-a:
                dmesg-warn -> PASS       (skl-i5k-2) UNSTABLE
        Subgroup suspend-read-crc-pipe-c:
                pass       -> DMESG-WARN (skl-i5k-2) UNSTABLE

bdw-nuci7        total:162  pass:152  dwarn:0   dfail:0   fail:0   skip:10 
bdw-ultra        total:165  pass:152  dwarn:0   dfail:0   fail:0   skip:13 
bsw-nuc-2        total:165  pass:134  dwarn:2   dfail:0   fail:0   skip:29 
byt-nuc          total:165  pass:140  dwarn:1   dfail:0   fail:0   skip:24 
hsw-gt2          total:165  pass:154  dwarn:0   dfail:0   fail:1   skip:10 
ilk-hp8440p      total:165  pass:116  dwarn:0   dfail:0   fail:1   skip:48 
ivb-t430s        total:165  pass:150  dwarn:0   dfail:0   fail:1   skip:14 
skl-i5k-2        total:165  pass:149  dwarn:1   dfail:0   fail:0   skip:15 
snb-dellxps      total:165  pass:142  dwarn:0   dfail:0   fail:1   skip:22 
snb-x220t        total:165  pass:142  dwarn:0   dfail:0   fail:2   skip:21 

Results at /archive/results/CI_IGT_test/Patchwork_1428/

631053ba117c294f0cdfe704718a040b4406a240 drm-intel-nightly: 2016y-02m-17d-21h-05m-38s UTC integration manifest
739dffa23ebca5fb05f3bc1520a4b5ed4f215bac drm/i915: Extract intel_encoder_has_connectors()

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

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

* Re: [PATCH] drm/i915: Extract intel_encoder_has_connectors()
  2016-02-17 19:28 [PATCH] drm/i915: Extract intel_encoder_has_connectors() ville.syrjala
  2016-02-18  7:59 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2016-02-18 11:02 ` Daniel Vetter
  1 sibling, 0 replies; 4+ messages in thread
From: Daniel Vetter @ 2016-02-18 11:02 UTC (permalink / raw)
  To: ville.syrjala; +Cc: intel-gfx

On Wed, Feb 17, 2016 at 09:28:45PM +0200, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> We have an open coded loop which tries to see if the encoder has any
> connectors linked to it. Let's extract that to a helper similar to
> intel_crtc_has_encoders().
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

> ---
>  drivers/gpu/drm/i915/intel_display.c | 22 ++++++++++++----------
>  1 file changed, 12 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index afcabe455ad1..4071b75a7247 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -15486,6 +15486,17 @@ static bool intel_crtc_has_encoders(struct intel_crtc *crtc)
>  	return false;
>  }
>  
> +static bool intel_encoder_has_connectors(struct intel_encoder *encoder)
> +{
> +	struct drm_device *dev = encoder->base.dev;
> +	struct intel_connector *connector;
> +
> +	for_each_connector_on_encoder(dev, &encoder->base, connector)
> +		return true;
> +
> +	return false;
> +}
> +
>  static void intel_sanitize_crtc(struct intel_crtc *crtc)
>  {
>  	struct drm_device *dev = crtc->base.dev;
> @@ -15596,7 +15607,6 @@ static void intel_sanitize_encoder(struct intel_encoder *encoder)
>  {
>  	struct intel_connector *connector;
>  	struct drm_device *dev = encoder->base.dev;
> -	bool active = false;
>  
>  	/* We need to check both for a crtc link (meaning that the
>  	 * encoder is active and trying to read from a pipe) and the
> @@ -15604,15 +15614,7 @@ static void intel_sanitize_encoder(struct intel_encoder *encoder)
>  	bool has_active_crtc = encoder->base.crtc &&
>  		to_intel_crtc(encoder->base.crtc)->active;
>  
> -	for_each_intel_connector(dev, connector) {
> -		if (connector->base.encoder != &encoder->base)
> -			continue;
> -
> -		active = true;
> -		break;
> -	}
> -
> -	if (active && !has_active_crtc) {
> +	if (intel_encoder_has_connectors(encoder) && !has_active_crtc) {
>  		DRM_DEBUG_KMS("[ENCODER:%d:%s] has active connectors but no active pipe!\n",
>  			      encoder->base.base.id,
>  			      encoder->base.name);
> -- 
> 2.4.10
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: ✓ Fi.CI.BAT: success for drm/i915: Extract intel_encoder_has_connectors()
  2016-02-18  7:59 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2016-02-18 13:25   ` Ville Syrjälä
  0 siblings, 0 replies; 4+ messages in thread
From: Ville Syrjälä @ 2016-02-18 13:25 UTC (permalink / raw)
  To: intel-gfx

On Thu, Feb 18, 2016 at 07:59:02AM -0000, Patchwork wrote:
> == Summary ==
> 
> Series 3540v1 drm/i915: Extract intel_encoder_has_connectors()
> http://patchwork.freedesktop.org/api/1.0/series/3540/revisions/1/mbox/
> 
> Test kms_flip:
>         Subgroup basic-flip-vs-dpms:
>                 dmesg-warn -> PASS       (ilk-hp8440p) UNSTABLE
> Test kms_pipe_crc_basic:
>         Subgroup suspend-read-crc-pipe-a:
>                 dmesg-warn -> PASS       (skl-i5k-2) UNSTABLE
>         Subgroup suspend-read-crc-pipe-c:
>                 pass       -> DMESG-WARN (skl-i5k-2) UNSTABLE

This is the standard cpu_hotplug lockdep noise.

Patch pushed to dinq. Thanks for the review.

> 
> bdw-nuci7        total:162  pass:152  dwarn:0   dfail:0   fail:0   skip:10 
> bdw-ultra        total:165  pass:152  dwarn:0   dfail:0   fail:0   skip:13 
> bsw-nuc-2        total:165  pass:134  dwarn:2   dfail:0   fail:0   skip:29 
> byt-nuc          total:165  pass:140  dwarn:1   dfail:0   fail:0   skip:24 
> hsw-gt2          total:165  pass:154  dwarn:0   dfail:0   fail:1   skip:10 
> ilk-hp8440p      total:165  pass:116  dwarn:0   dfail:0   fail:1   skip:48 
> ivb-t430s        total:165  pass:150  dwarn:0   dfail:0   fail:1   skip:14 
> skl-i5k-2        total:165  pass:149  dwarn:1   dfail:0   fail:0   skip:15 
> snb-dellxps      total:165  pass:142  dwarn:0   dfail:0   fail:1   skip:22 
> snb-x220t        total:165  pass:142  dwarn:0   dfail:0   fail:2   skip:21 
> 
> Results at /archive/results/CI_IGT_test/Patchwork_1428/
> 
> 631053ba117c294f0cdfe704718a040b4406a240 drm-intel-nightly: 2016y-02m-17d-21h-05m-38s UTC integration manifest
> 739dffa23ebca5fb05f3bc1520a4b5ed4f215bac drm/i915: Extract intel_encoder_has_connectors()

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2016-02-18 13:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-17 19:28 [PATCH] drm/i915: Extract intel_encoder_has_connectors() ville.syrjala
2016-02-18  7:59 ` ✓ Fi.CI.BAT: success for " Patchwork
2016-02-18 13:25   ` Ville Syrjälä
2016-02-18 11:02 ` [PATCH] " Daniel Vetter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.