All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gustavo Sousa <gustavo.sousa@intel.com>
To: Jani Nikula <jani.nikula@intel.com>,
	<intel-gfx@lists.freedesktop.org>,
	<intel-xe@lists.freedesktop.org>
Cc: <jani.nikula@intel.com>
Subject: Re: [PATCH v2 3/7] drm/i915/dpll: use intel_de_wait_custom() instead of wait_for_us()
Date: Thu, 31 Jul 2025 10:09:19 -0300	[thread overview]
Message-ID: <175396735922.2011.12714287925274064060@intel.com> (raw)
In-Reply-To: <d8c381524d721e01228b76b71080c6e4ccc528e9.1753956266.git.jani.nikula@intel.com>

Quoting Jani Nikula (2025-07-31 07:05:10-03:00)
>Prefer the register read specific wait function over i915 wait_for_us().
>
>Signed-off-by: Jani Nikula <jani.nikula@intel.com>

Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com>

>---
> drivers/gpu/drm/i915/display/intel_dpll_mgr.c | 20 +++++++++++++------
> 1 file changed, 14 insertions(+), 6 deletions(-)
>
>diff --git a/drivers/gpu/drm/i915/display/intel_dpll_mgr.c b/drivers/gpu/drm/i915/display/intel_dpll_mgr.c
>index 33e0398120c8..8ea96cc524a1 100644
>--- a/drivers/gpu/drm/i915/display/intel_dpll_mgr.c
>+++ b/drivers/gpu/drm/i915/display/intel_dpll_mgr.c
>@@ -2046,6 +2046,7 @@ static void bxt_ddi_pll_enable(struct intel_display *display,
>         enum dpio_phy phy = DPIO_PHY0;
>         enum dpio_channel ch = DPIO_CH0;
>         u32 temp;
>+        int ret;
> 
>         bxt_port_to_phy_channel(display, port, &phy, &ch);
> 
>@@ -2056,8 +2057,10 @@ static void bxt_ddi_pll_enable(struct intel_display *display,
>                 intel_de_rmw(display, BXT_PORT_PLL_ENABLE(port),
>                              0, PORT_PLL_POWER_ENABLE);
> 
>-                if (wait_for_us((intel_de_read(display, BXT_PORT_PLL_ENABLE(port)) &
>-                                 PORT_PLL_POWER_STATE), 200))
>+                ret = intel_de_wait_custom(display, BXT_PORT_PLL_ENABLE(port),
>+                                           PORT_PLL_POWER_STATE, PORT_PLL_POWER_STATE,
>+                                           200, 0, NULL);
>+                if (ret)
>                         drm_err(display->drm,
>                                 "Power state not set for PLL:%d\n", port);
>         }
>@@ -2119,8 +2122,10 @@ static void bxt_ddi_pll_enable(struct intel_display *display,
>         intel_de_rmw(display, BXT_PORT_PLL_ENABLE(port), 0, PORT_PLL_ENABLE);
>         intel_de_posting_read(display, BXT_PORT_PLL_ENABLE(port));
> 
>-        if (wait_for_us((intel_de_read(display, BXT_PORT_PLL_ENABLE(port)) & PORT_PLL_LOCK),
>-                        200))
>+        ret = intel_de_wait_custom(display, BXT_PORT_PLL_ENABLE(port),
>+                                   PORT_PLL_LOCK, PORT_PLL_LOCK,
>+                                   200, 0, NULL);
>+        if (ret)
>                 drm_err(display->drm, "PLL %d not locked\n", port);
> 
>         if (display->platform.geminilake) {
>@@ -2144,6 +2149,7 @@ static void bxt_ddi_pll_disable(struct intel_display *display,
>                                 struct intel_dpll *pll)
> {
>         enum port port = (enum port)pll->info->id; /* 1:1 port->PLL mapping */
>+        int ret;
> 
>         intel_de_rmw(display, BXT_PORT_PLL_ENABLE(port), PORT_PLL_ENABLE, 0);
>         intel_de_posting_read(display, BXT_PORT_PLL_ENABLE(port));
>@@ -2152,8 +2158,10 @@ static void bxt_ddi_pll_disable(struct intel_display *display,
>                 intel_de_rmw(display, BXT_PORT_PLL_ENABLE(port),
>                              PORT_PLL_POWER_ENABLE, 0);
> 
>-                if (wait_for_us(!(intel_de_read(display, BXT_PORT_PLL_ENABLE(port)) &
>-                                  PORT_PLL_POWER_STATE), 200))
>+                ret = intel_de_wait_custom(display, BXT_PORT_PLL_ENABLE(port),
>+                                           PORT_PLL_POWER_STATE, 0,
>+                                           200, 0, NULL);
>+                if (ret)
>                         drm_err(display->drm,
>                                 "Power state not reset for PLL:%d\n", port);
>         }
>-- 
>2.39.5
>

  reply	other threads:[~2025-07-31 13:09 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-31 10:05 [PATCH v2 0/7] drm/i915/display: use intel_de_wait_*() functions Jani Nikula
2025-07-31 10:05 ` [PATCH v2 1/7] drm/i915/hdmi: use intel_de_wait_for_set() instead of wait_for() Jani Nikula
2025-07-31 12:54   ` Gustavo Sousa
2025-07-31 10:05 ` [PATCH v2 2/7] drm/i915/ddi: use intel_de_wait_custom() instead of wait_for_us() Jani Nikula
2025-07-31 13:00   ` Gustavo Sousa
2025-08-01  9:10     ` Jani Nikula
2025-07-31 10:05 ` [PATCH v2 3/7] drm/i915/dpll: " Jani Nikula
2025-07-31 13:09   ` Gustavo Sousa [this message]
2025-07-31 10:05 ` [PATCH v2 4/7] drm/i915/cdclk: " Jani Nikula
2025-07-31 13:22   ` Gustavo Sousa
2025-07-31 10:05 ` [PATCH v2 5/7] drm/i915/power: " Jani Nikula
2025-07-31 13:25   ` Gustavo Sousa
2025-07-31 10:05 ` [PATCH v2 6/7] drm/i915/pch: " Jani Nikula
2025-07-31 13:27   ` Gustavo Sousa
2025-07-31 10:05 ` [PATCH v2 7/7] drm/i915/dsi: " Jani Nikula
2025-07-31 13:32   ` Gustavo Sousa
2025-07-31 11:13 ` ✓ i915.CI.BAT: success for drm/i915/display: use intel_de_wait_*() functions (rev3) Patchwork
2025-07-31 12:43 ` ✓ CI.KUnit: " Patchwork
2025-07-31 12:58 ` ✗ CI.checksparse: warning " Patchwork
2025-07-31 13:54 ` ✓ Xe.CI.BAT: success " Patchwork
2025-07-31 15:25 ` ✗ Xe.CI.Full: failure " Patchwork
2025-07-31 16:25 ` ✓ i915.CI.Full: success " 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=175396735922.2011.12714287925274064060@intel.com \
    --to=gustavo.sousa@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@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.