public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Gustavo Padovan <gustavo@padovan.org>
Cc: intel-gfx@lists.freedesktop.org,
	Gustavo Padovan <gustavo.padovan@collabora.co.uk>,
	dri-devel@lists.freedesktop.org
Subject: Re: [RFC 1/3] drm/i915: remove !enabled handling from commit primary plane step
Date: Tue, 9 Sep 2014 18:58:47 +0300	[thread overview]
Message-ID: <20140909155847.GL4193@intel.com> (raw)
In-Reply-To: <1410273801-20300-1-git-send-email-gustavo@padovan.org>

On Tue, Sep 09, 2014 at 11:43:19AM -0300, Gustavo Padovan wrote:
> From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> 
> The !crtc->enabled case will now be handled by the !visible code,
> since the handling is basically the same.
> 
> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 26 --------------------------
>  1 file changed, 26 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 5279b99..2ccf7c0 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -11837,32 +11837,6 @@ intel_commit_primary_plane(struct drm_plane *plane,
>  	struct drm_rect *src = &state->src;
>  	int ret;
>  
> -	/*
> -	 * If the CRTC isn't enabled, we're just pinning the framebuffer,
> -	 * updating the fb pointer, and returning without touching the
> -	 * hardware.  This allows us to later do a drmModeSetCrtc with fb=-1 to
> -	 * turn on the display with all planes setup as desired.
> -	 */
> -	if (!crtc->enabled) {
> -		mutex_lock(&dev->struct_mutex);
> -
> -		/*
> -		 * If we already called setplane while the crtc was disabled,
> -		 * we may have an fb pinned; unpin it.
> -		 */
> -		if (plane->fb)
> -			intel_unpin_fb_obj(old_obj);
> -
> -		i915_gem_track_fb(old_obj, obj,
> -				  INTEL_FRONTBUFFER_PRIMARY(intel_crtc->pipe));
> -
> -		/* Pin and return without programming hardware */
> -		ret = intel_pin_and_fence_fb_obj(dev, obj, NULL);
> -		mutex_unlock(&dev->struct_mutex);
> -
> -		return ret;
> -	}
> -
>  	intel_crtc_wait_for_pending_flips(crtc);

Yeah this should work just fine.

One difference between the code paths is the intel_crtc_wait_for_pending_flips()
call, but since the crtc isn't enabled there can't be any pending flip.

The other difference is the pin vs. unpin order, but that shouldn't matter
unless there's tons of other stuff pinned as well. It's not worth optimizing
setplane calls on disabled CRTCs too much IMO.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

>  
>  	/*
> -- 
> 1.9.3
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Ville Syrjälä
Intel OTC

  parent reply	other threads:[~2014-09-09 15:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-09 14:43 [RFC 1/3] drm/i915: remove !enabled handling from commit primary plane step Gustavo Padovan
2014-09-09 14:43 ` [RFC 2/3] drm/i915: create intel_update_pipe_size() Gustavo Padovan
2014-09-09 15:53   ` Ville Syrjälä
2014-09-09 17:43     ` Gustavo Padovan
2014-09-10  6:32       ` Daniel Vetter
2014-09-09 14:43 ` [RFC 3/3] drm/i915: Merge of visible and !visible paths for primary planes Gustavo Padovan
2014-09-09 17:26   ` Ville Syrjälä
2014-09-09 15:58 ` Ville Syrjälä [this message]
2014-09-10  6:33   ` [Intel-gfx] [RFC 1/3] drm/i915: remove !enabled handling from commit primary plane step Daniel Vetter

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=20140909155847.GL4193@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gustavo.padovan@collabora.co.uk \
    --cc=gustavo@padovan.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /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