summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/i915_mmio_range.c
diff options
context:
space:
mode:
authorMatt Atwood <matthew.s.atwood@intel.com>2025-10-09 14:52:08 -0700
committerRodrigo Vivi <rodrigo.vivi@intel.com>2025-10-16 15:20:56 -0400
commit27e21516914dc130a79aa895a5a26e18f0213a5a (patch)
treefeada21d4a95543097a8603407820746059556c6 /drivers/gpu/drm/i915/i915_mmio_range.c
parent08c54f3c83e531d13f165ea341a312a49a4eb267 (diff)
drm/i915: move and rename reg_in_range_table
reg_in_range_table is a useful function that is used in multiple places, and will be needed for WA_BB implementation later. Let's move this function and i915_range struct to its own file, as we are trying to move away from i915_utils files. v2: move functions to their own file v3: use correct naming convention Suggested-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Matt Atwood <matthew.s.atwood@intel.com> Link: https://lore.kernel.org/r/20251009215210.41000-1-matthew.s.atwood@intel.com Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_mmio_range.c')
-rw-r--r--drivers/gpu/drm/i915/i915_mmio_range.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_mmio_range.c b/drivers/gpu/drm/i915/i915_mmio_range.c
new file mode 100644
index 000000000000..724041e81aa7
--- /dev/null
+++ b/drivers/gpu/drm/i915/i915_mmio_range.c
@@ -0,0 +1,18 @@
+// SPDX-License-Identifier: MIT
+/*
+ * Copyright © 2025 Intel Corporation
+ */
+
+#include "i915_mmio_range.h"
+
+bool i915_mmio_range_table_contains(u32 addr, const struct i915_mmio_range *table)
+{
+ while (table->start || table->end) {
+ if (addr >= table->start && addr <= table->end)
+ return true;
+
+ table++;
+ }
+
+ return false;
+}