diff mbox

[06/16] drm/i915: try a little harder to find an FBC CRTC

Message ID 1439588061-18064-7-git-send-email-paulo.r.zanoni@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Zanoni, Paulo R Aug. 14, 2015, 9:34 p.m. UTC
Keep searching in case the candidate has a NULL primary fb. This is
only relevant for the platforms that don't have the pipe_a_only
restriction.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
---
 drivers/gpu/drm/i915/intel_fbc.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Ville Syrjala Aug. 28, 2015, 4:55 p.m. UTC | #1
On Fri, Aug 14, 2015 at 06:34:11PM -0300, Paulo Zanoni wrote:
> Keep searching in case the candidate has a NULL primary fb. This is
> only relevant for the platforms that don't have the pipe_a_only
> restriction.
> 
> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_fbc.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_fbc.c b/drivers/gpu/drm/i915/intel_fbc.c
> index 73bd559..a63d10a 100644
> --- a/drivers/gpu/drm/i915/intel_fbc.c
> +++ b/drivers/gpu/drm/i915/intel_fbc.c
> @@ -532,16 +532,14 @@ static struct drm_crtc *intel_fbc_find_crtc(struct drm_i915_private *dev_priv)
>  		tmp_crtc = dev_priv->pipe_to_crtc_mapping[pipe];
>  
>  		if (intel_crtc_active(tmp_crtc) &&
> -		    to_intel_plane_state(tmp_crtc->primary->state)->visible)
> +		    to_intel_plane_state(tmp_crtc->primary->state)->visible &&
> +		    tmp_crtc->primary->fb != NULL)

I'd hoped we'd gotten past these plane is supposedly visible but doesn't
have an fb bugs. Does this actually happen in real life still?

>  			crtc = tmp_crtc;
>  
>  		if (pipe_a_only)
>  			break;
>  	}
>  
> -	if (!crtc || crtc->primary->fb == NULL)
> -		return NULL;
> -
>  	return crtc;
>  }
>  
> -- 
> 2.4.6
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_fbc.c b/drivers/gpu/drm/i915/intel_fbc.c
index 73bd559..a63d10a 100644
--- a/drivers/gpu/drm/i915/intel_fbc.c
+++ b/drivers/gpu/drm/i915/intel_fbc.c
@@ -532,16 +532,14 @@  static struct drm_crtc *intel_fbc_find_crtc(struct drm_i915_private *dev_priv)
 		tmp_crtc = dev_priv->pipe_to_crtc_mapping[pipe];
 
 		if (intel_crtc_active(tmp_crtc) &&
-		    to_intel_plane_state(tmp_crtc->primary->state)->visible)
+		    to_intel_plane_state(tmp_crtc->primary->state)->visible &&
+		    tmp_crtc->primary->fb != NULL)
 			crtc = tmp_crtc;
 
 		if (pipe_a_only)
 			break;
 	}
 
-	if (!crtc || crtc->primary->fb == NULL)
-		return NULL;
-
 	return crtc;
 }