diff options
author | Matthew Auld <matthew.auld@intel.com> | 2021-02-05 13:20:25 +0300 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2021-03-24 21:31:59 +0300 |
commit | 8ec8ad0f2f8e3e17e6a1f73ca18901097a90e6c4 (patch) | |
tree | 39047f3c2be31cd783114f7e5d0516ed44c94508 /drivers/gpu/drm/i915/intel_memory_region.h | |
parent | 2827ce6e543086deb24a46ddedc5a8a072275670 (diff) | |
download | linux-8ec8ad0f2f8e3e17e6a1f73ca18901097a90e6c4.tar.xz |
drm/i915: cleanup the region class/instance encoding
Get rid of the strange REGION_MAP encoding stuff and just use an
explicit class/instance pair for each region. This better matches our
future uAPI where all queryable regions are identified with a u16 class
and u16 instance.
v2: fix whitespace
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20210205102026.806699-1-matthew.auld@intel.com
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_memory_region.h')
-rw-r--r-- | drivers/gpu/drm/i915/intel_memory_region.h | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/gpu/drm/i915/intel_memory_region.h b/drivers/gpu/drm/i915/intel_memory_region.h index d17e4fe3123c..8baf2536d7a5 100644 --- a/drivers/gpu/drm/i915/intel_memory_region.h +++ b/drivers/gpu/drm/i915/intel_memory_region.h @@ -39,11 +39,6 @@ enum intel_region_id { #define REGION_LMEM BIT(INTEL_REGION_LMEM) #define REGION_STOLEN BIT(INTEL_REGION_STOLEN) -#define INTEL_MEMORY_TYPE_SHIFT 16 - -#define MEMORY_TYPE_FROM_REGION(r) (ilog2((r) >> INTEL_MEMORY_TYPE_SHIFT)) -#define MEMORY_INSTANCE_FROM_REGION(r) (ilog2((r) & 0xffff)) - #define I915_ALLOC_MIN_PAGE_SIZE BIT(0) #define I915_ALLOC_CONTIGUOUS BIT(1) @@ -84,9 +79,9 @@ struct intel_memory_region { resource_size_t total; resource_size_t avail; - unsigned int type; - unsigned int instance; - unsigned int id; + u16 type; + u16 instance; + enum intel_region_id id; char name[8]; struct list_head reserved; |