From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [RFC 2/3] drm/i915: create intel_update_pipe_size() Date: Wed, 10 Sep 2014 08:32:21 +0200 Message-ID: <20140910063221.GM15520@phenom.ffwll.local> References: <1410273801-20300-1-git-send-email-gustavo@padovan.org> <1410273801-20300-2-git-send-email-gustavo@padovan.org> <20140909155318.GK4193@intel.com> <20140909174314.GD26794@joana> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mail-wg0-f52.google.com (mail-wg0-f52.google.com [74.125.82.52]) by gabe.freedesktop.org (Postfix) with ESMTP id E822789B62 for ; Tue, 9 Sep 2014 23:31:56 -0700 (PDT) Received: by mail-wg0-f52.google.com with SMTP id x13so4401255wgg.35 for ; Tue, 09 Sep 2014 23:31:56 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20140909174314.GD26794@joana> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Gustavo Padovan 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 02:43:14PM -0300, Gustavo Padovan wrote: > 2014-09-09 Ville Syrj=E4l=E4 : > = > > On Tue, Sep 09, 2014 at 11:43:20AM -0300, Gustavo Padovan wrote: > > > From: Gustavo Padovan > > > = > > > Factor out a piece of code from intel_pipe_set_base() that updates > > > the pipe size and adjust fitter. > > > = > > > This will help refactor the update primary plane path. > > > = > > > Signed-off-by: Gustavo Padovan > > > --- > > > drivers/gpu/drm/i915/intel_display.c | 71 +++++++++++++++++++++-----= ---------- > > > 1 file changed, 41 insertions(+), 30 deletions(-) > > > = > > > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i= 915/intel_display.c > > > index 2ccf7c0..e7e7184 100644 > > > --- a/drivers/gpu/drm/i915/intel_display.c > > > +++ b/drivers/gpu/drm/i915/intel_display.c > > > @@ -2779,6 +2779,46 @@ static bool intel_crtc_has_pending_flip(struct= drm_crtc *crtc) > > > return pending; > > > } > > > = > > > +static void intel_update_pipe_size(struct drm_crtc *crtc) > > = > > These days we usually prefer to pass intel_crtc instead of drm_crtc. You > > can still call it 'crtc' since that's shorter and because we don't need > > anything from drm_crtc in this function there won't be any confusion > > between the two. > = > Actually we need the drm_crtc 3 times in this function, that is why I lef= t it > as an argument. We could just do the other way around and get it from > &intel_crtc->base. Yeah I prefer we use the intel_foo types internally without an intel_ prefix in the local variable name. Adding the foo->base. prefix isn't really much longer than just foo. Imo upcasting should only be done in interface hooks where we have a reason for the paramater to have the more generic type, everywhere else it just looks a bit brittle. And yes I know that we're not there at all. -Daniel -- = Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch