From: Damien Lespiau Subject: Re: [PATCH 44/89] drm/i915/skl: Register definitions and macros for SKL Watermark regs Date: Tue, 16 Sep 2014 15:11:46 +0100 Message-ID: <20140916141146.GH26627@strange.amr.corp.intel.com> References: <1409830075-11139-1-git-send-email-damien.lespiau@intel.com> <1409830075-11139-45-git-send-email-damien.lespiau@intel.com> <20140910180404.GC4193@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id 25FD46E44C for ; Tue, 16 Sep 2014 07:12:10 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20140910180404.GC4193@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= Cc: intel-gfx@lists.freedesktop.org, Pradeep Bhat List-Id: intel-gfx@lists.freedesktop.org On Wed, Sep 10, 2014 at 09:04:04PM +0300, Ville Syrj=E4l=E4 wrote: > > +#define PLANE_WM_TRANS_1(pipe) \ > > + _PIPE(pipe, PLANE_WM_TRANS_1_A_0, PLANE_WM_TRANS_1_B_0) > > +#define PLANE_WM_TRANS_2(pipe) \ > > + _PIPE(pipe, PLANE_WM_TRANS_2_A_0, PLANE_WM_TRANS_2_B_0) > > +#define PLANE_WM_TRANS(pipe, plane) \ > > + _PLANE(plane, PLANE_WM_TRANS_1(pipe), PLANE_WM_TRANS_2(pipe)) > = > I must admit to my eyes glazing over when trying to parse these macros. > Not sure if a bit less redirection might help here. Anyway I plugged them > into a small test program and the resulting register offsets were all goo= d. While I'm generally for simple things, there's some pleasure to be had in abusing the preprocessor a bit. Sometimes it has to be about fun to keep us interested :) > Just one small nit: if the intermediate macros aren't supposed to be used > by anywhere outside this file then they might be prefixed with _ to make > it clear they're internal. Fair enough, will spin a new version for this one. > Either way: > Reviewed-by: Ville Syrj=E4l=E4 -- = Damien