[Intel-gfx] [PATCH 1/7] drm/i915: Disable primary plane if we fail to reconstruct BIOS fb (v2)

Matt Roper matthew.d.roper at intel.com
Tue Dec 15 09:20:06 PST 2015


On Thu, Dec 03, 2015 at 11:37:36AM -0800, Matt Roper wrote:
> If we fail to reconstruct the BIOS fb (e.g., because the FB is too
> large), we'll be left with plane state that indicates the primary plane
> is visible yet has a NULL fb.  This mismatch causes problems later on
> (e.g., for the watermark code).  Since we've failed to reconstruct the
> BIOS FB, the best solution is to just disable the primary plane and
> pretend the BIOS never had it enabled.
> 
> v2: Add intel_pre_disable_primary() call (Maarten)
> 
> Cc: Daniel Vetter <daniel at ffwll.ch>
> Cc: Ville Syrjälä <ville.syrjala at intel.com>
> Cc: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
> Signed-off-by: Matt Roper <matthew.d.roper at intel.com>
> Reviewed-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>

+drm-intel-fixes

We're still waiting for the rest of the series to be reviewed, but this
first patch already has Maarten's r-b and should probably go into -fixes.
Possibly stable as well if we get confirmation that this also fixes any
of the bugzillas listed below?


Matt

> ---
> As previously noted, this might also fix some GPU hangs on older platforms
> (unconfirmed).  Potential bugzillas include:
> 
>         https://bugs.freedesktop.org/show_bug.cgi?id=89319
>         https://bugs.freedesktop.org/show_bug.cgi?id=87677
>         https://bugs.freedesktop.org/show_bug.cgi?id=89146
>         https://bugs.freedesktop.org/show_bug.cgi?id=91653
> 
> This should probably go into -fixes (and possibly stable if we get confirmation
> on any of those bugzillas?)
> 
>  drivers/gpu/drm/i915/intel_display.c | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 4959adb..e5c0807 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -116,6 +116,7 @@ static void skylake_pfit_enable(struct intel_crtc *crtc);
>  static void ironlake_pfit_disable(struct intel_crtc *crtc, bool force);
>  static void ironlake_pfit_enable(struct intel_crtc *crtc);
>  static void intel_modeset_setup_hw_state(struct drm_device *dev);
> +static void intel_pre_disable_primary(struct drm_crtc *crtc);
>  
>  typedef struct {
>  	int	min, max;
> @@ -2597,6 +2598,8 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
>  	struct drm_i915_gem_object *obj;
>  	struct drm_plane *primary = intel_crtc->base.primary;
>  	struct drm_plane_state *plane_state = primary->state;
> +	struct drm_crtc_state *crtc_state = intel_crtc->base.state;
> +	struct intel_plane *intel_plane = to_intel_plane(primary);
>  	struct drm_framebuffer *fb;
>  
>  	if (!plane_config->fb)
> @@ -2633,6 +2636,18 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
>  		}
>  	}
>  
> +	/*
> +	 * We've failed to reconstruct the BIOS FB.  Current display state
> +	 * indicates that the primary plane is visible, but has a NULL FB,
> +	 * which will lead to problems later if we don't fix it up.  The
> +	 * simplest solution is to just disable the primary plane now and
> +	 * pretend the BIOS never had it enabled.
> +	 */
> +	to_intel_plane_state(plane_state)->visible = false;
> +	crtc_state->plane_mask &= ~(1 << drm_plane_index(primary));
> +	intel_pre_disable_primary(&intel_crtc->base);
> +	intel_plane->disable_plane(primary, &intel_crtc->base);
> +
>  	return;
>  
>  valid_fb:
> -- 
> 2.1.4
> 

-- 
Matt Roper
Graphics Software Engineer
IoTG Platform Enabling & Development
Intel Corporation
(916) 356-2795


More information about the Intel-gfx mailing list