From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [Intel-gfx] [RFC 1/3] drm/i915: remove !enabled handling from commit primary plane step Date: Wed, 10 Sep 2014 08:33:58 +0200 Message-ID: <20140910063358.GN15520@phenom.ffwll.local> References: <1410273801-20300-1-git-send-email-gustavo@padovan.org> <20140909155847.GL4193@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com [74.125.82.50]) by gabe.freedesktop.org (Postfix) with ESMTP id 30AD689C05 for ; Tue, 9 Sep 2014 23:33:34 -0700 (PDT) Received: by mail-wg0-f50.google.com with SMTP id x13so5794318wgg.9 for ; Tue, 09 Sep 2014 23:33:33 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20140909155847.GL4193@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= Cc: intel-gfx@lists.freedesktop.org, Gustavo Padovan , dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On Tue, Sep 09, 2014 at 06:58:47PM +0300, Ville Syrj=E4l=E4 wrote: > On Tue, Sep 09, 2014 at 11:43:19AM -0300, Gustavo Padovan wrote: > > From: Gustavo Padovan > > = > > The !crtc->enabled case will now be handled by the !visible code, > > since the handling is basically the same. > > = > > Signed-off-by: Gustavo Padovan > > --- > > 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/i91= 5/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 *p= lane, > > struct drm_rect *src =3D &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=3D-= 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 =3D 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 optimiz= ing > setplane calls on disabled CRTCs too much IMO. > = > Reviewed-by: Ville Syrj=E4l=E4 Queued for -next, thanks for the patch. -Daniel -- = Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch