From 3797783b1c966885e8bae4a7e6b99ca2f0fae4f0 Mon Sep 17 00:00:00 2001 From: Ville Syrjälä Date: Thu, 2 May 2024 15:14:23 +0300 Subject: drm/i915: Remove counter productive REGION_* wrappers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This extra macro level between the region IDs and their bitmasks just makes it harder to see what is used where. Get rid of the wrappers. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20240502121423.1002-3-ville.syrjala@linux.intel.com Reviewed-by: Rodrigo Vivi --- drivers/gpu/drm/i915/i915_pci.c | 6 +++--- drivers/gpu/drm/i915/intel_memory_region.h | 5 ----- drivers/gpu/drm/i915/selftests/mock_gem_device.c | 2 +- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c index 8b4fdeabb12a..37a1d530a59c 100644 --- a/drivers/gpu/drm/i915/i915_pci.c +++ b/drivers/gpu/drm/i915/i915_pci.c @@ -81,7 +81,7 @@ .__runtime.page_sizes = I915_GTT_PAGE_SIZE_4K #define GEN_DEFAULT_REGIONS \ - .memory_regions = REGION_SMEM | REGION_STOLEN_SMEM + .memory_regions = BIT(INTEL_REGION_SMEM) | BIT(INTEL_REGION_STOLEN_SMEM) #define I830_FEATURES \ GEN(2), \ @@ -660,7 +660,7 @@ static const struct intel_device_info rkl_info = { }; #define DGFX_FEATURES \ - .memory_regions = REGION_SMEM | REGION_LMEM | REGION_STOLEN_LMEM, \ + .memory_regions = BIT(INTEL_REGION_SMEM) | BIT(INTEL_REGION_LMEM_0) | BIT(INTEL_REGION_STOLEN_LMEM), \ .has_llc = 0, \ .has_pxp = 0, \ .has_snoop = 1, \ @@ -835,7 +835,7 @@ static const struct intel_device_info mtl_info = { .has_snoop = 1, .max_pat_index = 4, .has_pxp = 1, - .memory_regions = REGION_SMEM | REGION_STOLEN_LMEM, + .memory_regions = BIT(INTEL_REGION_SMEM) | BIT(INTEL_REGION_STOLEN_LMEM), .platform_engine_mask = BIT(RCS0) | BIT(BCS0) | BIT(CCS0), MTL_CACHELEVEL, }; diff --git a/drivers/gpu/drm/i915/intel_memory_region.h b/drivers/gpu/drm/i915/intel_memory_region.h index 9ba36454e51b..72496e401016 100644 --- a/drivers/gpu/drm/i915/intel_memory_region.h +++ b/drivers/gpu/drm/i915/intel_memory_region.h @@ -38,11 +38,6 @@ enum intel_region_id { INTEL_REGION_UNKNOWN, /* Should be last */ }; -#define REGION_SMEM BIT(INTEL_REGION_SMEM) -#define REGION_LMEM BIT(INTEL_REGION_LMEM_0) -#define REGION_STOLEN_SMEM BIT(INTEL_REGION_STOLEN_SMEM) -#define REGION_STOLEN_LMEM BIT(INTEL_REGION_STOLEN_LMEM) - #define I915_ALLOC_CONTIGUOUS BIT(0) #define for_each_memory_region(mr, i915, id) \ diff --git a/drivers/gpu/drm/i915/selftests/mock_gem_device.c b/drivers/gpu/drm/i915/selftests/mock_gem_device.c index af349fd9abc2..0bd29846873b 100644 --- a/drivers/gpu/drm/i915/selftests/mock_gem_device.c +++ b/drivers/gpu/drm/i915/selftests/mock_gem_device.c @@ -122,7 +122,7 @@ static const struct intel_device_info mock_info = { .__runtime.page_sizes = (I915_GTT_PAGE_SIZE_4K | I915_GTT_PAGE_SIZE_64K | I915_GTT_PAGE_SIZE_2M), - .memory_regions = REGION_SMEM, + .memory_regions = BIT(INTEL_REGION_SMEM), .platform_engine_mask = BIT(0), /* simply use legacy cache level for mock device */ -- cgit v1.2.3