From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH 3/7] drm/i915: add intel_using_power_well Date: Wed, 17 Apr 2013 14:27:00 +0200 Message-ID: References: <1362611003-4823-4-git-send-email-przanoni@gmail.com> <1363972453-2726-1-git-send-email-przanoni@gmail.com> <20130417090423.GO27612@phenom.ffwll.local> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-ia0-f170.google.com (mail-ia0-f170.google.com [209.85.210.170]) by gabe.freedesktop.org (Postfix) with ESMTP id 2A4EBE5C54 for ; Wed, 17 Apr 2013 05:27:06 -0700 (PDT) Received: by mail-ia0-f170.google.com with SMTP id 21so1170437iay.1 for ; Wed, 17 Apr 2013 05:27:05 -0700 (PDT) In-Reply-To: <20130417090423.GO27612@phenom.ffwll.local> 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-gfx , Paulo Zanoni List-Id: intel-gfx@lists.freedesktop.org On Wed, Apr 17, 2013 at 11:04:23AM +0200, Daniel Vetter wrote: > Hi Paulo, > > On Fri, Mar 22, 2013 at 02:14:13PM -0300, Paulo Zanoni wrote: > > From: Paulo Zanoni > > > > It returns true if we've requested to turn the power well on and it's > > really on. It also returns true for all the previous gens. > > > > For now there's just one caller, but I'm going to add more. > > > > Signed-off-by: Paulo Zanoni > > Yeah, I've merged this but just stumbled over it again while rebasing the > -internal tree. And I'm still unhappy with the name a bit, since > power_well is a bit generic. I know it's what bspec uses, but still I'd > like to have some notion in it that this is about display stuff > > The other thing which always irked me is that sprinkling power wells > checks all over the place just feels ugly. What we actually want to check > is whether the display hw is powered on, which feels much less > platform-specific. > > So what about a s/intel_using_power_well/intel_display_power_enabled? It's > not perfect since the actual piece of hw we care about is still platform > specific, so I'd suggest to throw an enum on top: > > enum intel_display_power_domains { > POWER_DOMAIN_EDP, > POWER_DOMAIN_EDP_PFIT, > POWER_DOMAIN_OTHER > }; > > bool intel_display_power_enabled(struct drm_device *dev, > enum intel_display_power_domain domain); > > We could easily add new domains for e.g. the pc8 stuff with a > POWER_DOMAIN_CONNECTOR_AUX or so if we need to work around more unclaimed > register warnings. > > With that piece of infrastructure I think I'll stop being grumpy about > power wells checks and unclaimed register fixup patches and just merge > them all. Also, that function should probably use HAS_POWER_WELL instead of the manual IS_HASWELL check. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch