All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Imre Deak <imre.deak@intel.com>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2 1/2] drm/i915: Get power refs in encoder->get_power_domains()
Date: Sun, 07 Apr 2019 14:04:30 +0100	[thread overview]
Message-ID: <155464227089.17806.5865772385921170147@skylake-alporthouse-com> (raw)
In-Reply-To: <20190407124655.31536-1-imre.deak@intel.com>

Quoting Imre Deak (2019-04-07 13:46:55)
> Push getting the reference for the encoders' power domains into the
> encoder get_power_domains() hook instead of doing this from the caller.
> This way the encoder can store away the corresponding wakerefs.
> 
> This fixes the DSI encoder disabling, which didn't release these
> power references it acquired during HW state readout.
> 
> Note that longtime ownership for the corresponding wakerefs can be thus
> acquired / released in two ways. Nevertheless there is always only one
> owner for them:
> 
> After HW readout (booting/system resume):
> - encoder->get_power_domains() acquires
> - encoder->disable*() releases
> 
> After a modeset (calling intel_atomic_commit()):
> - encoder->enable*() acquires
> - encoder->disable*() releases
> 
> * can be any of the encoder enable/disable hooks.
> 
> v2:
> - Check that the DSI io_wakerefs are unset both during encoder HW
>   readout and enabling. (Chris)
> 
> Fixes: 0e6e0be4c9523 ("drm/i915: Markup paired operations on display power domains")
> Cc: Vandita Kulkarni <vandita.kulkarni@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Imre Deak <imre.deak@intel.com>
> ---
>  drivers/gpu/drm/i915/icl_dsi.c       | 40 ++++++++++++++++++------------------
>  drivers/gpu/drm/i915/intel_ddi.c     | 17 ++++++++-------
>  drivers/gpu/drm/i915/intel_display.c |  6 +-----
>  drivers/gpu/drm/i915/intel_drv.h     | 10 +++++----
>  4 files changed, 35 insertions(+), 38 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/icl_dsi.c b/drivers/gpu/drm/i915/icl_dsi.c
> index b67ffaa283dc..586cf136546f 100644
> --- a/drivers/gpu/drm/i915/icl_dsi.c
> +++ b/drivers/gpu/drm/i915/icl_dsi.c
> @@ -323,6 +323,21 @@ static void gen11_dsi_program_esc_clk_div(struct intel_encoder *encoder)
>         }
>  }
>  
> +static void get_dsi_io_power_domains(struct drm_i915_private *dev_priv,
> +                                    struct intel_dsi *intel_dsi)
> +{
> +       enum port port;
> +
> +       for_each_dsi_port(port, intel_dsi->ports) {
> +               WARN_ON(intel_dsi->io_wakeref[port]);
> +               intel_dsi->io_wakeref[port] =
> +                       intel_display_power_get(dev_priv,
> +                                               port == PORT_A ?
> +                                               POWER_DOMAIN_PORT_DDI_A_IO :
> +                                               POWER_DOMAIN_PORT_DDI_B_IO);
> +       }

Ok, that looks much more convincing that get_power_domain is just a
temporary reference. The warn will make sure we don't loose track of an
old wakeref by overwriting it with a new one.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>

Only need to worry about the other the encoders now :)
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2019-04-07 13:04 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-05 15:36 [PATCH 1/2] drm/i915: Get power refs in encoder->get_power_domain() Imre Deak
2019-04-05 15:36 ` [PATCH 2/2] drm/i915/icl: Simplify release of encoder power refs Imre Deak
2019-04-05 17:37 ` ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: Get power refs in encoder->get_power_domain() Patchwork
2019-04-06 15:53 ` ✗ Fi.CI.IGT: failure " Patchwork
2019-04-07 10:48   ` Imre Deak
2019-04-06 16:05 ` [PATCH 1/2] " Chris Wilson
2019-04-07 10:25   ` Imre Deak
2019-04-07 11:41     ` Chris Wilson
2019-04-07 11:55       ` Imre Deak
2019-04-07 12:06         ` Imre Deak
2019-04-07 12:41           ` Chris Wilson
2019-04-07 12:46 ` [PATCH v2 1/2] drm/i915: Get power refs in encoder->get_power_domains() Imre Deak
2019-04-07 13:04   ` Chris Wilson [this message]
2019-04-07 13:32 ` ✓ Fi.CI.BAT: success for series starting with [v2,1/2] drm/i915: Get power refs in encoder->get_power_domains() (rev2) Patchwork
2019-04-07 14:40 ` ✗ Fi.CI.IGT: failure " Patchwork
2019-04-08 15:40   ` 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=155464227089.17806.5865772385921170147@skylake-alporthouse-com \
    --to=chris@chris-wilson.co.uk \
    --cc=imre.deak@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /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.