From: Jani Nikula <jani.nikula@linux.intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>,
intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 2/4] drm/i915: Abstract the extra JSL/EHL DPLL4 power domain better
Date: Thu, 12 Oct 2023 17:56:34 +0300 [thread overview]
Message-ID: <87fs2f28kd.fsf@intel.com> (raw)
In-Reply-To: <20231012123522.26045-3-ville.syrjala@linux.intel.com>
On Thu, 12 Oct 2023, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Just include the JSL/EHL DPLL4 extra power domain in the dpll_info
> struct. This way the same approach could be used by other platforms
> as well (should the need arise), and we don't have to sprinkle
> platform checks all over the place.
>
> Note that I'm perhaps slightly abusing things here as
> power_domain==0 (which is actually POWER_DOMAIN_DISPLAY_CORE) now
> indicates that no extra power domain is needed. I suppose using
> POWER_DOMAIN_INVALID would be more correct, but then we'd have to
> sprinkle that to all the other DPLLs.
Cc: Imre, how bad do you think that is?
Anyway,
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_dpll_mgr.c | 30 +++++--------------
> drivers/gpu/drm/i915/display/intel_dpll_mgr.h | 6 ++++
> 2 files changed, 14 insertions(+), 22 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_dpll_mgr.c b/drivers/gpu/drm/i915/display/intel_dpll_mgr.c
> index b7997b096796..4e524cb8ed83 100644
> --- a/drivers/gpu/drm/i915/display/intel_dpll_mgr.c
> +++ b/drivers/gpu/drm/i915/display/intel_dpll_mgr.c
> @@ -3838,17 +3838,8 @@ static void combo_pll_enable(struct drm_i915_private *i915,
> {
> i915_reg_t enable_reg = intel_combo_pll_enable_reg(i915, pll);
>
> - if ((IS_JASPERLAKE(i915) || IS_ELKHARTLAKE(i915)) &&
> - pll->info->id == DPLL_ID_EHL_DPLL4) {
> -
> - /*
> - * We need to disable DC states when this DPLL is enabled.
> - * This can be done by taking a reference on DPLL4 power
> - * domain.
> - */
> - pll->wakeref = intel_display_power_get(i915,
> - POWER_DOMAIN_DC_OFF);
> - }
> + if (pll->info->power_domain)
> + pll->wakeref = intel_display_power_get(i915, pll->info->power_domain);
>
> icl_pll_power_enable(i915, pll, enable_reg);
>
> @@ -3946,10 +3937,8 @@ static void combo_pll_disable(struct drm_i915_private *i915,
>
> icl_pll_disable(i915, pll, enable_reg);
>
> - if ((IS_JASPERLAKE(i915) || IS_ELKHARTLAKE(i915)) &&
> - pll->info->id == DPLL_ID_EHL_DPLL4)
> - intel_display_power_put(i915, POWER_DOMAIN_DC_OFF,
> - pll->wakeref);
> + if (pll->info->power_domain)
> + intel_display_power_put(i915, pll->info->power_domain, pll->wakeref);
> }
>
> static void tbt_pll_disable(struct drm_i915_private *i915,
> @@ -4041,7 +4030,8 @@ static const struct intel_dpll_mgr icl_pll_mgr = {
> static const struct dpll_info ehl_plls[] = {
> { .name = "DPLL 0", .funcs = &combo_pll_funcs, .id = DPLL_ID_ICL_DPLL0, },
> { .name = "DPLL 1", .funcs = &combo_pll_funcs, .id = DPLL_ID_ICL_DPLL1, },
> - { .name = "DPLL 4", .funcs = &combo_pll_funcs, .id = DPLL_ID_EHL_DPLL4, },
> + { .name = "DPLL 4", .funcs = &combo_pll_funcs, .id = DPLL_ID_EHL_DPLL4,
> + .power_domain = POWER_DOMAIN_DC_OFF, },
> {}
> };
>
> @@ -4369,12 +4359,8 @@ static void readout_dpll_hw_state(struct drm_i915_private *i915,
>
> pll->on = intel_dpll_get_hw_state(i915, pll, &pll->state.hw_state);
>
> - if ((IS_JASPERLAKE(i915) || IS_ELKHARTLAKE(i915)) &&
> - pll->on &&
> - pll->info->id == DPLL_ID_EHL_DPLL4) {
> - pll->wakeref = intel_display_power_get(i915,
> - POWER_DOMAIN_DC_OFF);
> - }
> + if (pll->on && pll->info->power_domain)
> + pll->wakeref = intel_display_power_get(i915, pll->info->power_domain);
>
> pll->state.pipe_mask = 0;
> for_each_intel_crtc(&i915->drm, crtc) {
> diff --git a/drivers/gpu/drm/i915/display/intel_dpll_mgr.h b/drivers/gpu/drm/i915/display/intel_dpll_mgr.h
> index dd4796a61751..2e7ea0d8d3ff 100644
> --- a/drivers/gpu/drm/i915/display/intel_dpll_mgr.h
> +++ b/drivers/gpu/drm/i915/display/intel_dpll_mgr.h
> @@ -27,6 +27,7 @@
>
> #include <linux/types.h>
>
> +#include "intel_display_power.h"
> #include "intel_wakeref.h"
>
> #define for_each_shared_dpll(__i915, __pll, __i) \
> @@ -270,6 +271,11 @@ struct dpll_info {
> */
> enum intel_dpll_id id;
>
> + /**
> + * @power_domain: extra power domain required by the DPLL
> + */
> + enum intel_display_power_domain power_domain;
> +
> #define INTEL_DPLL_ALWAYS_ON (1 << 0)
> /**
> * @flags:
--
Jani Nikula, Intel
next prev parent reply other threads:[~2023-10-12 14:56 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-12 12:35 [Intel-gfx] [PATCH 0/4] drm/i915: DPLL code cleanups Ville Syrjala
2023-10-12 12:35 ` [Intel-gfx] [PATCH 1/4] drm/i915: Use named initializers for DPLL info Ville Syrjala
2023-10-12 14:52 ` Jani Nikula
2023-10-12 12:35 ` [Intel-gfx] [PATCH 2/4] drm/i915: Abstract the extra JSL/EHL DPLL4 power domain better Ville Syrjala
2023-10-12 14:56 ` Jani Nikula [this message]
2023-10-12 16:20 ` Imre Deak
2023-10-12 12:35 ` [Intel-gfx] [PATCH 3/4] drm/i915: Move the DPLL extra power domain handling up one level Ville Syrjala
2023-10-12 14:56 ` Jani Nikula
2023-10-12 12:35 ` [Intel-gfx] [PATCH 4/4] drm/i915: Extract _intel_{enable, disable}_shared_dpll() Ville Syrjala
2023-10-12 14:57 ` Jani Nikula
2023-10-12 18:14 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915: DPLL code cleanups Patchwork
2023-10-12 18:33 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2023-10-13 22:46 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915: DPLL code cleanups (rev2) Patchwork
2023-10-13 23:00 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-10-17 16:17 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915: DPLL code cleanups (rev4) Patchwork
2023-10-17 16:36 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2023-10-27 22:18 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915: DPLL code cleanups (rev5) Patchwork
2023-10-27 22:32 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-10-30 7:03 ` [Intel-gfx] ✓ Fi.CI.IGT: " 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=87fs2f28kd.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--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