Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Cc: jani.nikula@intel.com
Subject: [PATCH 04/16] drm/i915/bw: abstract intel_bw_pmdemand_needs_update()
Date: Thu, 12 Jun 2025 15:11:59 +0300	[thread overview]
Message-ID: <0e4652336c340b60e2fbf8030832e82b2dbdbfd1.1749730224.git.jani.nikula@intel.com> (raw)
In-Reply-To: <cover.1749730224.git.jani.nikula@intel.com>

Add intel_bw_pmdemand_needs_update() helper to avoid looking at struct
intel_bw_state internals outside of intel_bw.c.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/display/intel_bw.c       | 14 ++++++++++++++
 drivers/gpu/drm/i915/display/intel_bw.h       |  2 ++
 drivers/gpu/drm/i915/display/intel_pmdemand.c |  6 +-----
 3 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_bw.c b/drivers/gpu/drm/i915/display/intel_bw.c
index 6c2ab2e0dc91..c077ab05eb61 100644
--- a/drivers/gpu/drm/i915/display/intel_bw.c
+++ b/drivers/gpu/drm/i915/display/intel_bw.c
@@ -1644,3 +1644,17 @@ int intel_bw_init(struct intel_display *display)
 
 	return 0;
 }
+
+bool intel_bw_pmdemand_needs_update(struct intel_atomic_state *state)
+{
+	const struct intel_bw_state *new_bw_state, *old_bw_state;
+
+	new_bw_state = intel_atomic_get_new_bw_state(state);
+	old_bw_state = intel_atomic_get_old_bw_state(state);
+
+	if (new_bw_state &&
+	    new_bw_state->qgv_point_peakbw != old_bw_state->qgv_point_peakbw)
+		return true;
+
+	return false;
+}
diff --git a/drivers/gpu/drm/i915/display/intel_bw.h b/drivers/gpu/drm/i915/display/intel_bw.h
index eb2cc883e9c1..0acc6f19c981 100644
--- a/drivers/gpu/drm/i915/display/intel_bw.h
+++ b/drivers/gpu/drm/i915/display/intel_bw.h
@@ -76,4 +76,6 @@ int intel_bw_min_cdclk(struct intel_display *display,
 void intel_bw_update_hw_state(struct intel_display *display);
 void intel_bw_crtc_disable_noatomic(struct intel_crtc *crtc);
 
+bool intel_bw_pmdemand_needs_update(struct intel_atomic_state *state);
+
 #endif /* __INTEL_BW_H__ */
diff --git a/drivers/gpu/drm/i915/display/intel_pmdemand.c b/drivers/gpu/drm/i915/display/intel_pmdemand.c
index eeb88f9fc92d..8334744a2e23 100644
--- a/drivers/gpu/drm/i915/display/intel_pmdemand.c
+++ b/drivers/gpu/drm/i915/display/intel_pmdemand.c
@@ -294,16 +294,12 @@ intel_pmdemand_connector_needs_update(struct intel_atomic_state *state)
 
 static bool intel_pmdemand_needs_update(struct intel_atomic_state *state)
 {
-	const struct intel_bw_state *new_bw_state, *old_bw_state;
 	const struct intel_cdclk_state *new_cdclk_state, *old_cdclk_state;
 	const struct intel_crtc_state *new_crtc_state, *old_crtc_state;
 	struct intel_crtc *crtc;
 	int i;
 
-	new_bw_state = intel_atomic_get_new_bw_state(state);
-	old_bw_state = intel_atomic_get_old_bw_state(state);
-	if (new_bw_state && new_bw_state->qgv_point_peakbw !=
-	    old_bw_state->qgv_point_peakbw)
+	if (intel_bw_pmdemand_needs_update(state))
 		return true;
 
 	if (intel_dbuf_pmdemand_needs_update(state))
-- 
2.39.5


  parent reply	other threads:[~2025-06-12 12:12 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-12 12:11 [PATCH 00/16] drm/i915/display: make all global state opaque Jani Nikula
2025-06-12 12:11 ` [PATCH 01/16] drm/i915/wm: abstract intel_dbuf_pmdemand_needs_update() Jani Nikula
2025-06-12 12:11 ` [PATCH 02/16] drm/i915/wm: add more accessors to dbuf state Jani Nikula
2025-06-12 12:11 ` [PATCH 03/16] drm/i915/wm: make struct intel_dbuf_state opaque type Jani Nikula
2025-06-12 12:11 ` Jani Nikula [this message]
2025-06-12 12:12 ` [PATCH 05/16] drm/i915/bw: relocate intel_can_enable_sagv() and rename to intel_bw_can_enable_sagv() Jani Nikula
2025-06-12 12:12 ` [PATCH 06/16] drm/i915: move icl_sagv_{pre, post}_plane_update() to intel_bw.c Jani Nikula
2025-06-12 12:12 ` [PATCH 07/16] drm/i915/bw: abstract intel_bw_qgv_point_peakbw() Jani Nikula
2025-06-12 12:12 ` [PATCH 08/16] drm/i915/bw: make struct intel_bw_state opaque Jani Nikula
2025-06-12 12:12 ` [PATCH 09/16] drm/i915/cdclk: abstract intel_cdclk_logical() Jani Nikula
2025-06-12 12:12 ` [PATCH 10/16] drm/i915/cdclk: abstract intel_cdclk_min_cdclk() Jani Nikula
2025-06-12 12:12 ` [PATCH 11/16] drm/i915/cdclk: abstract intel_cdclk_bw_min_cdclk() Jani Nikula
2025-06-12 12:12 ` [PATCH 12/16] drm/i915/cdclk: abstract intel_cdclk_pmdemand_needs_update() Jani Nikula
2025-06-12 12:12 ` [PATCH 13/16] drm/i915/cdclk: abstract intel_cdclk_force_min_cdclk() Jani Nikula
2025-06-12 12:12 ` [PATCH 14/16] drm/i915/cdclk: abstract intel_cdclk_read_hw() Jani Nikula
2025-06-12 12:12 ` [PATCH 15/16] drm/i915/cdclk: abstract intel_cdclk_actual() and intel_cdclk_actual_voltage_level() Jani Nikula
2025-06-18 18:17   ` Imre Deak
2025-06-19 10:11     ` Jani Nikula
2025-06-19 11:23       ` Imre Deak
2025-06-12 12:12 ` [PATCH 16/16] drm/i915/cdclk: make struct intel_cdclk_state opaque Jani Nikula
2025-06-12 15:35 ` ✗ i915.CI.BAT: failure for drm/i915/display: make all global state opaque Patchwork
2025-06-18 18:08 ` [PATCH 00/16] " 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=0e4652336c340b60e2fbf8030832e82b2dbdbfd1.1749730224.git.jani.nikula@intel.com \
    --to=jani.nikula@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox