public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org, Paulo Zanoni <paulo.r.zanoni@intel.com>
Subject: Re: [PATCH 2/4] drm/i915: add intel_encoder_power_get/put
Date: Thu, 24 Apr 2014 17:14:27 +0200	[thread overview]
Message-ID: <20140424151427.GE26374@phenom.ffwll.local> (raw)
In-Reply-To: <20140424141110.GR18465@intel.com>

On Thu, Apr 24, 2014 at 05:11:10PM +0300, Ville Syrjälä wrote:
> On Thu, Apr 24, 2014 at 10:49:28AM -0300, Paulo Zanoni wrote:
> > From: Paulo Zanoni <paulo.r.zanoni@intel.com>
> > 
> > This was suggested by Chris on his review to the first version of
> > "drm/i915: get power domain in case the BIOS enabled eDP VDD". Well,
> > at least that's what I understood from his comment :)
> > 
> > v2: - Make it intel_encoder_power_get/put
> >     - Don't call the new functions on functions where we need both
> >       get() and put(), so we don't end up calling
> >       intel_display_port_power_domain() more than needed.
> > 
> > Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_dp.c  | 19 +++++--------------
> >  drivers/gpu/drm/i915/intel_drv.h |  2 ++
> >  drivers/gpu/drm/i915/intel_pm.c  | 24 ++++++++++++++++++++++++
> >  3 files changed, 31 insertions(+), 14 deletions(-)
> > 
> > 
> > I am not really sure if this patch is worth it... I certainly won't be mad if we
> > drop it. The diffstat is not good.
> 
> I'm not sure either. In fact I had this same idea already when I saw
> Imre's power well patches for the first time, but then I thought that
> it doesn't help that much and decided to keep the idea to myself.

If you guys ask about my color choices I have to admit that I'm not a huge
fan of intel_display_port_power_domain. In roughly object-oriented code
functions with giant switch statements which use the object class to
decide what to do tend to be a red flag ...

In case you care for a reference see the switch statement code smell in
Martin Fowler's refactoring.

But that was just my bikeshed, tbh I don't care strongly enough here.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

  reply	other threads:[~2014-04-24 15:14 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-09 21:47 [PATCH] drm/i915: get power domain in case the BIOS enabled eDP VDD Paulo Zanoni
2014-04-10  7:21 ` Daniel Vetter
2014-04-10  7:36   ` Chris Wilson
2014-04-11 13:21 ` Daniel Vetter
2014-04-22 22:55   ` [PATCH 1/4] " Paulo Zanoni
2014-04-22 22:55     ` [PATCH 2/4] drm/i915: add intel_dp_power_get/put Paulo Zanoni
2014-04-23  9:45       ` Ville Syrjälä
2014-04-24 13:49         ` [PATCH 2/4] drm/i915: add intel_encoder_power_get/put Paulo Zanoni
2014-04-24 14:11           ` Ville Syrjälä
2014-04-24 15:14             ` Daniel Vetter [this message]
2014-04-22 22:55     ` [PATCH 3/4] drm/i915: remove redundant is_edp() check Paulo Zanoni
2014-04-22 22:55     ` [PATCH 4/4] drm/i915: remove useless runtime PM get call Paulo Zanoni
2014-04-23  9:52       ` Ville Syrjälä
2014-04-24 13:50         ` [PATCH 4/4] drm/i915: remove useless runtime PM get calls Paulo Zanoni
2014-04-24 14:05           ` Ville Syrjälä
2014-07-14 15:59             ` Daniel Vetter
2014-04-23  6:59     ` [PATCH 1/4] drm/i915: get power domain in case the BIOS enabled eDP VDD Daniel Vetter
2014-04-23 11:02     ` Jani Nikula

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140424151427.GE26374@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=paulo.r.zanoni@intel.com \
    --cc=ville.syrjala@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox