drivers/gpu/drm/i915/intel_memory_region.h
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/intel_memory_region.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/intel_memory_region.h- Extension
.h- Size
- 3529 bytes
- Lines
- 136
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/ioport.hlinux/mutex.hlinux/io-mapping.hdrm/drm_mm.huapi/drm/i915_drm.h
Detected Declarations
struct drm_i915_privatestruct drm_i915_gem_objectstruct drm_printerstruct intel_memory_regionstruct sg_tablestruct ttm_resourcestruct intel_memory_region_opsstruct intel_memory_regionenum intel_memory_typeenum intel_region_id
Annotated Snippet
struct intel_memory_region_ops {
int (*init)(struct intel_memory_region *mem);
int (*release)(struct intel_memory_region *mem);
int (*init_object)(struct intel_memory_region *mem,
struct drm_i915_gem_object *obj,
resource_size_t offset,
resource_size_t size,
resource_size_t page_size,
unsigned int flags);
};
struct intel_memory_region {
struct drm_i915_private *i915;
const struct intel_memory_region_ops *ops;
struct io_mapping iomap;
struct resource region;
struct resource io;
resource_size_t min_page_size;
resource_size_t total;
u16 type;
u16 instance;
enum intel_region_id id;
char name[16];
char uabi_name[20];
bool private; /* not for userspace */
struct {
struct mutex lock; /* Protects access to objects */
struct list_head list;
} objects;
bool is_range_manager;
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);
struct intel_memory_region *
intel_memory_region_create(struct drm_i915_private *i915,
resource_size_t start,
resource_size_t size,
resource_size_t min_page_size,
resource_size_t io_start,
resource_size_t io_size,
u16 type,
u16 instance,
const struct intel_memory_region_ops *ops);
void intel_memory_region_destroy(struct intel_memory_region *mem);
int intel_memory_regions_hw_probe(struct drm_i915_private *i915);
void intel_memory_regions_driver_release(struct drm_i915_private *i915);
struct intel_memory_region *
intel_memory_region_by_type(struct drm_i915_private *i915,
enum intel_memory_type mem_type);
const char *intel_memory_type_str(enum intel_memory_type type);
__printf(2, 3) void
intel_memory_region_set_name(struct intel_memory_region *mem,
const char *fmt, ...);
int intel_memory_region_reserve(struct intel_memory_region *mem,
resource_size_t offset,
resource_size_t size);
void intel_memory_region_debug(struct intel_memory_region *mr,
struct drm_printer *printer);
void intel_memory_region_avail(struct intel_memory_region *mr,
u64 *avail, u64 *visible_avail);
struct intel_memory_region *
i915_gem_ttm_system_setup(struct drm_i915_private *i915,
u16 type, u16 instance);
struct intel_memory_region *
i915_gem_shmem_setup(struct drm_i915_private *i915,
u16 type, u16 instance);
#endif
Annotation
- Immediate include surface: `linux/ioport.h`, `linux/mutex.h`, `linux/io-mapping.h`, `drm/drm_mm.h`, `uapi/drm/i915_drm.h`.
- Detected declarations: `struct drm_i915_private`, `struct drm_i915_gem_object`, `struct drm_printer`, `struct intel_memory_region`, `struct sg_table`, `struct ttm_resource`, `struct intel_memory_region_ops`, `struct intel_memory_region`, `enum intel_memory_type`, `enum intel_region_id`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.