intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Matt Roper <matthew.d.roper@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: drm-intel-fixes@lists.freedesktop.org,
	"Ville Syrjälä" <ville.syrjala@intel.com>
Subject: Re: [PATCH 1/7] drm/i915: Disable primary plane if we fail to reconstruct BIOS fb (v2)
Date: Tue, 15 Dec 2015 09:20:06 -0800	[thread overview]
Message-ID: <20151215172006.GE2778@intel.com> (raw)
In-Reply-To: <1449171462-30763-2-git-send-email-matthew.d.roper@intel.com>

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@ffwll.ch>
> Cc: Ville Syrjälä <ville.syrjala@intel.com>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@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
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2015-12-15 17:20 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-03 19:37 [PATCH 0/7] Wrap up ILK-style atomic watermarks (v2) Matt Roper
2015-12-03 19:37 ` [PATCH 1/7] drm/i915: Disable primary plane if we fail to reconstruct BIOS fb (v2) Matt Roper
2015-12-15 17:20   ` Matt Roper [this message]
2015-12-03 19:37 ` [PATCH 2/7] drm/i915: Extract plane dumping from intel_dump_pipe_config() Matt Roper
2015-12-03 19:37 ` [PATCH 3/7] drm/i915: Setup clipped src/dest coordinates during FB reconstruction (v2) Matt Roper
2015-12-03 19:37 ` [PATCH 4/7] drm/i915: Convert hsw_compute_linetime_wm to use in-flight state Matt Roper
2015-12-03 19:37 ` [PATCH 5/7] drm/i915: Add extra paranoia to ILK watermark calculations Matt Roper
2015-12-03 19:37 ` [PATCH 6/7] drm/i915: Sanitize watermarks after hardware state readout (v4) Matt Roper
2015-12-03 19:37 ` [PATCH 7/7] drm/i915: Add two-stage ILK-style watermark programming (v8) Matt Roper
2015-12-14 23:51   ` [PATCH 7/7] drm/i915: Add two-stage ILK-style watermark programming (v9) Matt Roper
2016-01-06 10:38     ` Maarten Lankhorst
2016-01-06 18:51       ` Matt Roper
2016-01-06 19:34       ` [PATCH] drm/i915: Add two-stage ILK-style watermark programming (v10) Matt Roper
2016-01-07 11:29         ` Maarten Lankhorst
2016-01-06 12:58 ` [PATCH 0/7] Wrap up ILK-style atomic watermarks (v2) Maarten Lankhorst

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151215172006.GE2778@intel.com \
    --to=matthew.d.roper@intel.com \
    --cc=drm-intel-fixes@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ville.syrjala@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).