From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Cc: Jani Nikula <jani.nikula@intel.com>
Subject: Re: [PATCH 16/21] drm/i915: Markup paired operations on display power domains
Date: Thu, 10 Jan 2019 18:49:50 +0200 [thread overview]
Message-ID: <8736q01mq9.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <154713729642.3384.16046994765324163750@skylake-alporthouse-com>
Chris Wilson <chris@chris-wilson.co.uk> writes:
> Quoting Mika Kuoppala (2019-01-10 15:51:33)
>> Chris Wilson <chris@chris-wilson.co.uk> writes:
>> > @@ -680,6 +682,8 @@ static int i915_interrupt_info(struct seq_file *m, void *data)
>> > wakeref = intel_runtime_pm_get(dev_priv);
>> >
>> > if (IS_CHERRYVIEW(dev_priv)) {
>> > + intel_wakeref_t pref;
>> > +
>>
>> In here you are introducing a new, descriptive, power reference for display.
>> But then you drop it after using it twice. And can't seem to find
>> reason for inconsistency.
>
> pref, pref, pref...
>
>> > seq_printf(m, "Master Interrupt Control:\t%08x\n",
>> > I915_READ(GEN8_MASTER_IRQ));
>> >
>> > @@ -695,8 +699,9 @@ static int i915_interrupt_info(struct seq_file *m, void *data)
>> > enum intel_display_power_domain power_domain;
>> >
>> > power_domain = POWER_DOMAIN_PIPE(pipe);
>> > - if (!intel_display_power_get_if_enabled(dev_priv,
>> > - power_domain)) {
>> > + pref = intel_display_power_get_if_enabled(dev_priv,
>> > + power_domain);
>> > + if (!pref) {
>
> ah, it would have been chosen to fit 80cols.
You should have adopted it then fully! :)
>
>> > seq_printf(m, "Pipe %c power disabled\n",
>> > pipe_name(pipe));
>> > continue;
>> > diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
>> > index f0a405604b75..44c1b21febba 100644
>> > --- a/drivers/gpu/drm/i915/i915_drv.h
>> > +++ b/drivers/gpu/drm/i915/i915_drv.h
>> > @@ -344,6 +344,7 @@ struct intel_csr {
>> > uint32_t mmiodata[8];
>> > uint32_t dc_state;
>> > uint32_t allowed_dc_mask;
>> > + intel_wakeref_t wakeref;
>> > };
>> >
>> > enum i915_cache_level {
>> > @@ -1982,6 +1983,7 @@ struct drm_i915_private {
>> > * is a slight delay before we do so.
>> > */
>> > intel_wakeref_t awake;
>> > + intel_wakeref_t power;
>>
>> This prolly explains the prefs above :)
>
> Possibly.
>
>> > - intel_display_power_put(dev_priv, POWER_DOMAIN_PORT_DDI_A_IO);
>> > -
>> > - if (intel_dsi->dual_link)
>> > - intel_display_power_put(dev_priv, POWER_DOMAIN_PORT_DDI_B_IO);
>> > + for_each_dsi_port(port, intel_dsi->ports) {
>> > + intel_wakeref_t wakeref;
>> > +
>> > + wakeref = fetch_and_zero(&intel_dsi->io_wakeref[port]);
>> > + if (wakeref) {
>> > + intel_display_power_put(dev_priv,
>> > + port == PORT_A ?
>> > + POWER_DOMAIN_PORT_DDI_A_IO :
>> > + POWER_DOMAIN_PORT_DDI_B_IO,
>> > + wakeref);
>> > + }
>> > + }
>>
>> Ok, well. I have been trying to figure out what really is going on here.
>>
>> First it seems that you fix a bug. We take refs for each dsi port but
>> only release once special casing 'dual_link' without this patch.
>>
>> Second, all the hw access is before getting the refs, looking
>> suspicious.
>
> There's always been two, just this moves into a for(;;). I don't think
> it was buggy, but I do think the for(;;) has the advantage of being
> clearer that it operates over all the ports and wakerefs.
Agreed that your patch makes it more clear.
I am still suspicious about the ordering, hopefully there is
upper lever pdomain to cover access. But that is not
problem for this patch.
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
>
>> > @@ -15808,12 +15827,13 @@ intel_modeset_setup_hw_state(struct drm_device *dev,
>> > struct drm_modeset_acquire_ctx *ctx)
>> > {
>> > struct drm_i915_private *dev_priv = to_i915(dev);
>> > - struct intel_crtc *crtc;
>> > struct intel_crtc_state *crtc_state;
>> > struct intel_encoder *encoder;
>> > + struct intel_crtc *crtc;
>>
>> Not that I mind but I don't understand the reasoning
>> behind the change of order on this and on few other places in this
>> patch.
>
> Just quietly moving everyone over to a tidy set of variable definitions
> (we are not meant to grow Christmas trees as part of the kernel coding
> style).
>
>> > -/**
>> > - * intel_display_power_put - release a power domain reference
>> > - * @dev_priv: i915 device instance
>> > - * @domain: power domain to reference
>> > - *
>> > - * This function drops the power domain reference obtained by
>> > - * intel_display_power_get() and might power down the corresponding hardware
>> > - * block right away if this is the last reference.
>> > - */
>> > -void intel_display_power_put(struct drm_i915_private *dev_priv,
>> > - enum intel_display_power_domain domain)
>> > +static void __intel_display_power_put(struct drm_i915_private *dev_priv,
>> > + enum intel_display_power_domain domain)
>> > {
>> > struct i915_power_domains *power_domains;
>> > struct i915_power_well *power_well;
>> > @@ -1947,10 +1944,34 @@ void intel_display_power_put(struct drm_i915_private *dev_priv,
>> > intel_power_well_put(dev_priv, power_well);
>> >
>> > mutex_unlock(&power_domains->lock);
>> > +}
>> >
>> > +/**
>> > + * intel_display_power_put - release a power domain reference
>>
>> +unchecked? or is this in wrong place.
>
> unchecked doesn't exist, you just need a stronger pair of glasses.
>
> So the only API documented interface is the full version that requires
> you take ownership of your wakeref, we don't tempt you with the easy
> version that is meant to only exist for transitioning
> -Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2019-01-10 16:51 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-10 10:11 Track rpm wakerefs to fix bugs Chris Wilson
2019-01-10 10:11 ` [PATCH 01/21] drm/i915: Track all held rpm wakerefs Chris Wilson
2019-01-10 10:11 ` [PATCH 02/21] drm/i915: Markup paired operations on wakerefs Chris Wilson
2019-01-10 10:20 ` Mika Kuoppala
2019-01-10 10:11 ` [PATCH 03/21] drm/i915: Track GT wakeref Chris Wilson
2019-01-10 10:11 ` [PATCH 04/21] drm/i915: Track the rpm wakerefs for error handling Chris Wilson
2019-01-10 10:11 ` [PATCH 05/21] drm/i915: Mark up sysfs with rpm wakeref tracking Chris Wilson
2019-01-10 10:11 ` [PATCH 06/21] drm/i915: Mark up debugfs " Chris Wilson
2019-01-10 10:11 ` [PATCH 07/21] drm/i915/perf: Track the rpm wakeref Chris Wilson
2019-01-10 10:11 ` [PATCH 08/21] drm/i915/pmu: Track " Chris Wilson
2019-01-10 10:11 ` [PATCH 09/21] drm/i915/guc: Track the " Chris Wilson
2019-01-10 10:11 ` [PATCH 10/21] drm/i915/gem: Track the rpm wakerefs Chris Wilson
2019-01-10 10:11 ` [PATCH 11/21] drm/i915/fb: Track " Chris Wilson
2019-01-10 10:11 ` [PATCH 12/21] drm/i915/hotplug: Track temporary rpm wakeref Chris Wilson
2019-01-10 10:11 ` [PATCH 13/21] drm/i915/panel: " Chris Wilson
2019-01-10 10:11 ` [PATCH 14/21] drm/i915/selftests: Mark up rpm wakerefs Chris Wilson
2019-01-10 10:11 ` [PATCH 15/21] drm/i915: Syntatic sugar for using intel_runtime_pm Chris Wilson
2019-01-10 10:11 ` [PATCH 16/21] drm/i915: Markup paired operations on display power domains Chris Wilson
2019-01-10 15:51 ` Mika Kuoppala
2019-01-10 16:21 ` Chris Wilson
2019-01-10 16:49 ` Mika Kuoppala [this message]
2019-01-10 10:11 ` [PATCH 17/21] drm/i915: Track the wakeref used to initialise " Chris Wilson
2019-01-10 23:15 ` John Harrison
2019-01-10 23:21 ` Chris Wilson
2019-01-11 13:09 ` Mika Kuoppala
2019-01-10 10:11 ` [PATCH 18/21] drm/i915: Combined gt.awake/gt.power wakerefs Chris Wilson
2019-01-14 14:20 ` Mika Kuoppala
2019-01-10 10:11 ` [PATCH 19/21] drm/i915/dp: Markup pps lock power well Chris Wilson
2019-01-11 0:16 ` John Harrison
2019-01-11 1:19 ` Chris Wilson
2019-01-10 10:11 ` [PATCH 20/21] drm/i915: Complain if hsw_get_pipe_config acquires the same power well twice Chris Wilson
2019-01-11 13:47 ` Mika Kuoppala
2019-01-10 10:11 ` [PATCH 21/21] drm/i915: Mark up Ironlake ips with rpm wakerefs Chris Wilson
2019-01-11 21:05 ` John Harrison
2019-01-14 15:01 ` Mika Kuoppala
2019-01-14 16:57 ` Chris Wilson
2019-01-10 11:47 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/21] drm/i915: Track all held " Patchwork
2019-01-10 11:54 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-01-10 12:31 ` ✗ Fi.CI.BAT: failure " Patchwork
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=8736q01mq9.fsf@gaia.fi.intel.com \
--to=mika.kuoppala@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.