mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-08 22:16:29 -04:00
drm/i915: Extract intel_memory_type_is_local()
Extract the "is this memory region local?" check into a helper. I'll have another use for this in the BIOS FB takeover. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250313140838.29742-2-ville.syrjala@linux.intel.com Reviewed-by: Jouni Högander <jouni.hogander@intel.com>
This commit is contained in:
@@ -48,8 +48,7 @@ bool i915_gem_object_is_lmem(struct drm_i915_gem_object *obj)
|
||||
i915_gem_object_evictable(obj))
|
||||
assert_object_held(obj);
|
||||
#endif
|
||||
return mr && (mr->type == INTEL_MEMORY_LOCAL ||
|
||||
mr->type == INTEL_MEMORY_STOLEN_LOCAL);
|
||||
return mr && intel_memory_type_is_local(mr->type);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -171,6 +171,17 @@ intel_memory_region_by_type(struct drm_i915_private *i915,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool intel_memory_type_is_local(enum intel_memory_type mem_type)
|
||||
{
|
||||
switch (mem_type) {
|
||||
case INTEL_MEMORY_LOCAL:
|
||||
case INTEL_MEMORY_STOLEN_LOCAL:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* intel_memory_region_reserve - Reserve a memory range
|
||||
* @mem: The region for which we want to reserve a range.
|
||||
|
||||
@@ -85,6 +85,8 @@ struct intel_memory_region {
|
||||
void *region_private;
|
||||
};
|
||||
|
||||
bool intel_memory_type_is_local(enum intel_memory_type mem_type);
|
||||
|
||||
struct intel_memory_region *
|
||||
intel_memory_region_lookup(struct drm_i915_private *i915,
|
||||
u16 class, u16 instance);
|
||||
|
||||
Reference in New Issue
Block a user