From: Paulo Zanoni <paulo.r.zanoni@intel.com>
To: imre.deak@intel.com, Ramalingam C <ramalingam.c@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/4] drm/i915: kill intel_display_power_well_is_enabled()
Date: Mon, 20 Aug 2018 16:11:27 -0700 [thread overview]
Message-ID: <1534806687.2630.5.camel@intel.com> (raw)
In-Reply-To: <1534549297.3698.10.camel@intel.com>
Em Sex, 2018-08-17 às 16:41 -0700, Paulo Zanoni escreveu:
> Em Qua, 2018-08-15 às 23:27 +0300, Imre Deak escreveu:
> > On Wed, Aug 08, 2018 at 03:16:11PM -0700, Paulo Zanoni wrote:
> > > Use the same coding pattern as we use in the other functions of
> > > the
> > > same file: just call lookup_power_well() directly in the only
> > > caller.
> > >
> > > Cc: Imre Deak <imre.deak@intel.com>
> > > Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
> > > ---
> > > drivers/gpu/drm/i915/intel_runtime_pm.c | 20 +++--------------
> > > ---
> > > 1 file changed, 3 insertions(+), 17 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c
> > > b/drivers/gpu/drm/i915/intel_runtime_pm.c
> > > index e209edbc561d..e0947f662361 100644
> > > --- a/drivers/gpu/drm/i915/intel_runtime_pm.c
> > > +++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
> > > @@ -49,9 +49,6 @@
> > > * present for a given platform.
> > > */
> > >
> > > -bool intel_display_power_well_is_enabled(struct drm_i915_private
> > > *dev_priv,
> > > - enum i915_power_well_id
> > > power_well_id);
> > > -
> > > static struct i915_power_well *
> > > lookup_power_well(struct drm_i915_private *dev_priv,
> > > enum i915_power_well_id power_well_id);
> > > @@ -678,8 +675,9 @@ static void assert_csr_loaded(struct
> > > drm_i915_private *dev_priv)
> > >
> > > static void assert_can_enable_dc5(struct drm_i915_private
> > > *dev_priv)
> > > {
> > > - bool pg2_enabled =
> > > intel_display_power_well_is_enabled(dev_priv,
> > > - SKL_DISP_PW_2);
> > > + struct i915_power_well *pg2 =
> > > lookup_power_well(dev_priv,
> > > + SKL_DISP
> > > _P
> > > W_2);
> > > + bool pg2_enabled = pg2->desc->ops->is_enabled(dev_priv,
> > > pg2);
> > >
> > > WARN_ONCE(pg2_enabled, "PG2 not disabled to enable
> > > DC5.\n");
> > >
> > > @@ -2302,18 +2300,6 @@ static const struct i915_power_well_desc
> > > chv_power_wells[] = {
> > > },
> > > };
> > >
> > > -bool intel_display_power_well_is_enabled(struct drm_i915_private
> > > *dev_priv,
> > > - enum i915_power_well_id
> > > power_well_id)
> > > -{
> > > - struct i915_power_well *power_well;
> > > - bool ret;
> > > -
> > > - power_well = lookup_power_well(dev_priv, power_well_id);
> > > - ret = power_well->desc->ops->is_enabled(dev_priv,
> > > power_well);
> > > -
> > > - return ret;
> > > -}
> > > -
> >
> > Or rather export a locked version of it and use that in
> > intel_hdcp.c
> > to
> > better hide the internals?
>
> That should probably be combined with José's idea of using ->enabled
> so
> we trust the hardware sync.
>
> Thanks for the suggestions.
After further analysis, I wonder if intel_hdcp.c should really be
checking for enabled power wells or if it should be doing something
else, such as actually grabbing power domain references to make sure
we're able to enable/disable HDCP whenever we need. Most of our code
should not be checking for power wells/domains being enabled/disabled
(except for HW readout), it should actually be requesting those
resources to make sure we have them when we need them.
CCing Ramaligam for that.
>
> >
> > > static const struct i915_power_well_desc skl_power_wells[] = {
> > > {
> > > .name = "always-on",
> > > --
> > > 2.14.4
> > >
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2018-08-20 23:11 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-08 22:16 [PATCH 1/4] drm/i915: kill intel_display_power_well_is_enabled() Paulo Zanoni
2018-08-08 22:16 ` [PATCH 2/4] drm/i915: BUG() if we can't lookup_power_well() Paulo Zanoni
2018-08-08 22:16 ` [PATCH 3/4] drm/i915: use for_each_power_well in lookup_power_well() Paulo Zanoni
2018-08-08 22:50 ` Souza, Jose
2018-08-08 22:16 ` [PATCH 4/4] drm/i915: move lookup_power_well() up Paulo Zanoni
2018-08-08 22:22 ` [PATCH 1/4] drm/i915: kill intel_display_power_well_is_enabled() Souza, Jose
2018-08-08 22:55 ` Paulo Zanoni
2018-08-08 22:22 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/4] " Patchwork
2018-08-08 22:58 ` Paulo Zanoni
2018-08-09 6:29 ` Michal Wajdeczko
2018-08-09 17:15 ` Paulo Zanoni
2018-08-08 22:38 ` ✓ Fi.CI.BAT: success " Patchwork
2018-08-09 1:16 ` ✓ Fi.CI.IGT: " Patchwork
2018-08-15 20:27 ` [PATCH 1/4] " Imre Deak
2018-08-17 23:41 ` Paulo Zanoni
2018-08-20 23:11 ` Paulo Zanoni [this message]
2018-08-21 11:12 ` Imre Deak
2018-08-21 19:54 ` Paulo Zanoni
2018-08-22 10:21 ` Imre Deak
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=1534806687.2630.5.camel@intel.com \
--to=paulo.r.zanoni@intel.com \
--cc=imre.deak@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=ramalingam.c@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;
as well as URLs for NNTP newsgroup(s).