From: Gustavo Sousa <gustavo.sousa@intel.com>
To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Subject: [PATCH 1/4] drm/i915/dmc_wl: Pass offset instead of reg to range table iterator
Date: Fri, 17 Jan 2025 19:06:52 -0300 [thread overview]
Message-ID: <20250117220747.87927-2-gustavo.sousa@intel.com> (raw)
In-Reply-To: <20250117220747.87927-1-gustavo.sousa@intel.com>
We will add another function that checks the offset in an upcoming
change. Instead of passing the reg variable to only extract the offset
later, let's extract the offset before so that we do not need to repeat
ourselves.
Signed-off-by: Gustavo Sousa <gustavo.sousa@intel.com>
---
drivers/gpu/drm/i915/display/intel_dmc_wl.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_dmc_wl.c b/drivers/gpu/drm/i915/display/intel_dmc_wl.c
index 43884740f8ea..330b43a72e08 100644
--- a/drivers/gpu/drm/i915/display/intel_dmc_wl.c
+++ b/drivers/gpu/drm/i915/display/intel_dmc_wl.c
@@ -227,11 +227,9 @@ static void __intel_dmc_wl_take(struct intel_display *display)
wl->taken = true;
}
-static bool intel_dmc_wl_reg_in_range(i915_reg_t reg,
- const struct intel_dmc_wl_range ranges[])
+static bool intel_dmc_wl_offset_in_ranges(u32 offset,
+ const struct intel_dmc_wl_range ranges[])
{
- u32 offset = i915_mmio_reg_offset(reg);
-
for (int i = 0; ranges[i].start; i++) {
u32 end = ranges[i].end ?: ranges[i].start;
@@ -247,6 +245,7 @@ static bool intel_dmc_wl_check_range(struct intel_display *display,
u32 dc_state)
{
const struct intel_dmc_wl_range *ranges;
+ u32 offset = i915_mmio_reg_offset(reg);
if (display->params.enable_dmc_wl == ENABLE_DMC_WL_ANY_REGISTER)
return true;
@@ -255,7 +254,7 @@ static bool intel_dmc_wl_check_range(struct intel_display *display,
* Check that the offset is in one of the ranges for which
* registers are powered off during DC states.
*/
- if (intel_dmc_wl_reg_in_range(reg, powered_off_ranges))
+ if (intel_dmc_wl_offset_in_ranges(offset, powered_off_ranges))
return true;
/*
@@ -274,7 +273,7 @@ static bool intel_dmc_wl_check_range(struct intel_display *display,
ranges = NULL;
}
- if (ranges && intel_dmc_wl_reg_in_range(reg, ranges))
+ if (ranges && intel_dmc_wl_offset_in_ranges(offset, ranges))
return true;
return false;
--
2.48.0
next prev parent reply other threads:[~2025-01-17 22:08 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-17 22:06 [PATCH 0/4] drm/i915/dmc_wl: Introduce debugfs interface Gustavo Sousa
2025-01-17 22:06 ` Gustavo Sousa [this message]
2025-01-22 8:23 ` [PATCH 1/4] drm/i915/dmc_wl: Pass offset instead of reg to range table iterator Luca Coelho
2025-01-17 22:06 ` [PATCH 2/4] drm/i915/dmc_wl: Add debugfs for untracked offsets Gustavo Sousa
2025-01-22 9:06 ` Luca Coelho
2025-01-23 14:41 ` Gustavo Sousa
2025-01-30 9:33 ` Luca Coelho
2025-01-23 16:11 ` Vivekanandan, Balasubramani
2025-01-23 16:41 ` Gustavo Sousa
2025-01-30 8:54 ` Vivekanandan, Balasubramani
2025-01-27 9:47 ` Jani Nikula
2025-01-27 11:17 ` Gustavo Sousa
2025-01-27 11:59 ` Jani Nikula
2025-01-27 12:55 ` Gustavo Sousa
2025-01-17 22:06 ` [PATCH 3/4] drm/i915/dmc_wl: Add extra_ranges debugfs Gustavo Sousa
2025-01-22 10:19 ` Luca Coelho
2025-01-23 15:52 ` Gustavo Sousa
2025-01-30 9:18 ` Luca Coelho
2025-01-30 8:30 ` Vivekanandan, Balasubramani
2025-01-30 8:49 ` Vivekanandan, Balasubramani
2025-01-17 22:06 ` [PATCH 4/4] drm/i915/dmc_wl: Enable the debugfs only with enable_dmc_wl_debugfs=1 Gustavo Sousa
2025-01-22 10:24 ` Luca Coelho
2025-01-23 16:10 ` Gustavo Sousa
2025-01-30 9:28 ` Luca Coelho
2025-01-27 12:01 ` Jani Nikula
2025-01-27 12:02 ` Jani Nikula
2025-01-27 13:24 ` Gustavo Sousa
2025-01-27 13:35 ` Jani Nikula
2025-01-27 13:50 ` Gustavo Sousa
2025-01-27 14:40 ` Jani Nikula
2025-01-30 8:46 ` Vivekanandan, Balasubramani
2025-01-17 22:14 ` ✓ CI.Patch_applied: success for drm/i915/dmc_wl: Introduce debugfs interface Patchwork
2025-01-17 22:15 ` ✗ CI.checkpatch: warning " Patchwork
2025-01-17 22:16 ` ✓ CI.KUnit: success " Patchwork
2025-01-17 22:34 ` ✓ CI.Build: " Patchwork
2025-01-17 22:36 ` ✓ CI.Hooks: " Patchwork
2025-01-17 22:38 ` ✓ CI.checksparse: " Patchwork
2025-01-17 23:06 ` ✓ Xe.CI.BAT: " Patchwork
2025-01-18 13:06 ` ✗ Xe.CI.Full: 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=20250117220747.87927-2-gustavo.sousa@intel.com \
--to=gustavo.sousa@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