diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2024-05-02 15:14:22 +0300 |
---|---|---|
committer | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2024-05-08 14:24:45 +0300 |
commit | d082c05a635e59764c5337a5da7f4287b8a80476 (patch) | |
tree | a8def8d6ac1781127b27220176dcd6d1ef233ed6 | |
parent | 8b69ac66d68907deb473b310b4f2c2a6b26ef191 (diff) | |
download | lwn-d082c05a635e59764c5337a5da7f4287b8a80476.tar.gz lwn-d082c05a635e59764c5337a5da7f4287b8a80476.zip |
drm/i915: Pass the region ID rather than a bitmask to HAS_REGION()
The name 'HAS_REGION()' suggests we are checking for a single
region, so seem more sensible to pass in the region ID rather
than a bitmask.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240502121423.1002-2-ville.syrjala@linux.intel.com
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
-rw-r--r-- | drivers/gpu/drm/i915/gt/intel_gt.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.h | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_memory_region.c | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gpu/drm/i915/gt/intel_gt.c b/drivers/gpu/drm/i915/gt/intel_gt.c index 96b444905d8c..45920cda0cc7 100644 --- a/drivers/gpu/drm/i915/gt/intel_gt.c +++ b/drivers/gpu/drm/i915/gt/intel_gt.c @@ -105,7 +105,7 @@ static int intel_gt_probe_lmem(struct intel_gt *gt) intel_memory_region_set_name(mem, "local%u", mem->instance); - GEM_BUG_ON(!HAS_REGION(i915, BIT(id))); + GEM_BUG_ON(!HAS_REGION(i915, id)); GEM_BUG_ON(i915->mm.regions[id]); i915->mm.regions[id] = mem; diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index a72cecd2dbc7..1ddd9c8a4881 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -757,8 +757,8 @@ IS_SUBPLATFORM(const struct drm_i915_private *i915, */ #define HAS_64K_PAGES(i915) (INTEL_INFO(i915)->has_64k_pages) -#define HAS_REGION(i915, i) (INTEL_INFO(i915)->memory_regions & (i)) -#define HAS_LMEM(i915) HAS_REGION(i915, REGION_LMEM) +#define HAS_REGION(i915, id) (INTEL_INFO(i915)->memory_regions & BIT(id)) +#define HAS_LMEM(i915) HAS_REGION(i915, INTEL_REGION_LMEM_0) #define HAS_EXTRA_GT_LIST(i915) (INTEL_INFO(i915)->extra_gt_list) diff --git a/drivers/gpu/drm/i915/intel_memory_region.c b/drivers/gpu/drm/i915/intel_memory_region.c index 60a03340bbd4..3a64ba4fa299 100644 --- a/drivers/gpu/drm/i915/intel_memory_region.c +++ b/drivers/gpu/drm/i915/intel_memory_region.c @@ -333,7 +333,7 @@ int intel_memory_regions_hw_probe(struct drm_i915_private *i915) struct intel_memory_region *mem = ERR_PTR(-ENODEV); u16 type, instance; - if (!HAS_REGION(i915, BIT(i))) + if (!HAS_REGION(i915, i)) continue; type = intel_region_map[i].class; |