All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Matt Roper <matthew.d.roper@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 3/4] drm/i915: don't force full modeset if primary plane is disabled
Date: Thu, 15 May 2014 17:54:27 +0300	[thread overview]
Message-ID: <20140515145427.GE27580@intel.com> (raw)
In-Reply-To: <1398877623-16930-4-git-send-email-matthew.d.roper@intel.com>

On Wed, Apr 30, 2014 at 10:07:02AM -0700, Matt Roper wrote:
> In a future patch, we'll allow the primary plane to be disabled by
> userspace via the universal plane API.  If a modeset is requested while
> the primary plane is disabled, crtc->primary->fb will be NULL which
> generally triggers a full modeset (except in fastboot situations).  If
> we detect that the crtc is active, but there's no primary plane fb,
> we should still allow a simple plane update rather than a full modeset
> if the mode isn't actually changing (after re-enabling the primary plane
> of course).
> 
> Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 22 ++++++++++++++++++++--
>  1 file changed, 20 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index e1e1239..04bd821 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -10136,12 +10136,17 @@ intel_set_config_compute_mode_changes(struct drm_mode_set *set,
>  	if (is_crtc_connector_off(set)) {
>  		config->mode_changed = true;
>  	} else if (set->crtc->primary->fb != set->fb) {
> -		/* If we have no fb then treat it as a full mode set */
> +		/*
> +		 * If we have no fb, we can only flip as long as the crtc is
> +		 * active, otherwise we need a full mode set.  The crtc may
> +		 * be active if we've only disabled the primary plane, or
> +		 * in fastboot situations.
> +		 */
>  		if (set->crtc->primary->fb == NULL) {
>  			struct intel_crtc *intel_crtc =
>  				to_intel_crtc(set->crtc);
>  
> -			if (intel_crtc->active && i915.fastboot) {
> +			if (intel_crtc->active) {
>  				DRM_DEBUG_KMS("crtc has no fb, will flip\n");
>  				config->fb_changed = true;
>  			} else {
> @@ -10380,8 +10385,21 @@ static int intel_crtc_set_config(struct drm_mode_set *set)
>  		ret = intel_set_mode(set->crtc, set->mode,
>  				     set->x, set->y, set->fb);
>  	} else if (config->fb_changed) {
> +		struct drm_i915_private *dev_priv = dev->dev_private;
> +		struct intel_crtc *intel_crtc = to_intel_crtc(set->crtc);
> +
>  		intel_crtc_wait_for_pending_flips(set->crtc);
>  
> +		/*
> +		 * We need to make sure the primary plane is re-enabled if it
> +		 * has previously been turned off.
> +		 */
> +		if (!intel_crtc->primary_enabled) {
> +			BUG_ON(!intel_crtc->active);

BUG seems a bit harsh.

> +			intel_enable_primary_hw_plane(dev_priv, intel_crtc->plane,
> +						      intel_crtc->pipe);
> +		}
> +
>  		ret = intel_pipe_set_base(set->crtc,
>  					  set->x, set->y, set->fb);

Enable the plane after set_base to avoid lighting up the plane if
set_base fails, and it'll also make the flip+enable atomic and so
we avoid flashing the old fb at the user.

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

-- 
Ville Syrjälä
Intel OTC

  reply	other threads:[~2014-05-15 14:54 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-30 17:06 [PATCH 0/4] Intel primary plane support (v6) Matt Roper
2014-04-30 17:07 ` [PATCH 1/4] drm: Check CRTC compatibility in setplane Matt Roper
2014-04-30 17:07 ` [PATCH 2/4] drm/plane-helper: Add drm_primary_helper_check_update() (v2) Matt Roper
2014-05-16  2:51   ` Lee, Chon Ming
2014-05-16  3:04     ` Rob Clark
2014-05-16  5:25       ` Lee, Chon Ming
2014-05-16  8:02         ` Daniel Vetter
2014-05-16 15:45     ` Matt Roper
2014-05-19 21:46   ` [PATCH 2/4] drm/plane-helper: Add drm_plane_helper_check_update() (v3) Matt Roper
2014-04-30 17:07 ` [PATCH 3/4] drm/i915: don't force full modeset if primary plane is disabled Matt Roper
2014-05-15 14:54   ` Ville Syrjälä [this message]
2014-05-15 16:13   ` [PATCH 3/4] drm/i915: don't force full modeset if primary plane is disabled (v2) Matt Roper
2014-04-30 17:07 ` [PATCH 4/4] drm/i915: Intel-specific primary plane handling (v6) Matt Roper
2014-05-15 15:52   ` Ville Syrjälä
2014-05-15 16:37     ` Matt Roper
2014-05-15 17:00       ` Ville Syrjälä
2014-05-15 19:35         ` Matt Roper
2014-05-15 20:49           ` Daniel Vetter
2014-05-15 20:59             ` Matt Roper
2014-05-15 21:20               ` Daniel Vetter
2014-05-15 21:25                 ` Matt Roper
2014-05-15 19:21   ` [PATCH 4/4] drm/i915: Intel-specific primary plane handling (v7) Matt Roper
2014-05-18 15:53     ` Lee, Chon Ming
2014-05-19 21:44       ` Matt Roper
2014-05-19 21:48     ` [PATCH 4/4] drm/i915: Intel-specific primary plane handling (v8) Matt Roper
2014-05-28  5:41       ` Lee, Chon Ming

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=20140515145427.GE27580@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=matthew.d.roper@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 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.