From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= Subject: Re: [PATCH v2 3/8] drm/i915: add always-on power wells instead of special casing them Date: Fri, 22 Nov 2013 18:11:24 +0200 Message-ID: <20131122161124.GG10036@intel.com> References: <1383326394-3933-1-git-send-email-imre.deak@intel.com> <1384434635-3077-1-git-send-email-imre.deak@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 E4B7FFAC7F for ; Fri, 22 Nov 2013 08:11:40 -0800 (PST) Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Paulo Zanoni Cc: Intel Graphics Development List-Id: intel-gfx@lists.freedesktop.org On Fri, Nov 22, 2013 at 02:04:02PM -0200, Paulo Zanoni wrote: > 2013/11/14 Imre Deak : > > Instead of using a separate function to check whether a power domain is > > is always on, add an always-on power well covering all these power > > domains and do the usual get/put on these unconditionally. Since we > > don't assign a .set handler for these the get/put won't have any effect > > besides the adjusted refcount. > = > Oh, now I see why you had all those checks for the existence of the > "set" function :) > = > = > > > > This makes the code more readable and provides debug info also on the > > use of always-on power wells (once the relevant debugfs entry is added.) > > > > Signed-off-by: Imre Deak > > --- > > drivers/gpu/drm/i915/i915_drv.h | 1 + > > drivers/gpu/drm/i915/intel_pm.c | 41 +++++++++++++--------------------= -------- > > 2 files changed, 14 insertions(+), 28 deletions(-) > > > > diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i91= 5_drv.h > > index b20016c..ff3314d 100644 > > --- a/drivers/gpu/drm/i915/i915_drv.h > > +++ b/drivers/gpu/drm/i915/i915_drv.h > > @@ -946,6 +946,7 @@ struct intel_ilk_power_mgmt { > > /* Power well structure for haswell */ > > struct i915_power_well { > > const char *name; > > + unsigned always_on:1; > = > On our driver we have many cases where we just use many "bool" > variables, and we also have many cases where we use single-bit > variables like this. On this specific case we're not gaining anything > by using the single-bit variable, so I'm not sure if it's the most > appropriate thing to use. I wish we had a guideline telling us which > one is preferred on each case :) I wish we'd use 'bool foo:1' for single bit bitfields. Otherwise stuff like 'foo =3D 2' doesn't work (you get false instead of true). -- = Ville Syrj=E4l=E4 Intel OTC