drivers/gpu/drm/i915/gem/i915_gem_object_types.h
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/gem/i915_gem_object_types.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/gem/i915_gem_object_types.h- Extension
.h- Size
- 26443 bytes
- Lines
- 749
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/mmu_notifier.hdrm/drm_gem.hdrm/ttm/ttm_bo.huapi/drm/i915_drm.hi915_active.hi915_selftest.hi915_vma_resource.hgt/intel_gt_defines.h
Detected Declarations
struct drm_i915_gem_objectstruct intel_fronbufferstruct intel_memory_regionstruct i915_lut_handlestruct drm_i915_gem_object_opsstruct i915_mmap_offsetstruct i915_gem_object_page_iterstruct drm_i915_gem_objectstruct i915_gem_userptrenum i915_cache_levelenum i915_map_typeenum i915_mmap_typefunction to_intel_bo
Annotated Snippet
struct i915_lut_handle {
struct list_head obj_link;
struct i915_gem_context *ctx;
u32 handle;
};
struct drm_i915_gem_object_ops {
unsigned int flags;
#define I915_GEM_OBJECT_IS_SHRINKABLE BIT(1)
/* Skip the shrinker management in set_pages/unset_pages */
#define I915_GEM_OBJECT_SELF_MANAGED_SHRINK_LIST BIT(2)
#define I915_GEM_OBJECT_IS_PROXY BIT(3)
#define I915_GEM_OBJECT_NO_MMAP BIT(4)
/* Interface between the GEM object and its backing storage.
* get_pages() is called once prior to the use of the associated set
* of pages before to binding them into the GTT, and put_pages() is
* called after we no longer need them. As we expect there to be
* associated cost with migrating pages between the backing storage
* and making them available for the GPU (e.g. clflush), we may hold
* onto the pages after they are no longer referenced by the GPU
* in case they may be used again shortly (for example migrating the
* pages to a different memory domain within the GTT). put_pages()
* will therefore most likely be called when the object itself is
* being released or under memory pressure (where we attempt to
* reap pages for the shrinker).
*/
int (*get_pages)(struct drm_i915_gem_object *obj);
void (*put_pages)(struct drm_i915_gem_object *obj,
struct sg_table *pages);
int (*truncate)(struct drm_i915_gem_object *obj);
/**
* shrink - Perform further backend specific actions to facilate
* shrinking.
* @obj: The gem object
* @flags: Extra flags to control shrinking behaviour in the backend
*
* Possible values for @flags:
*
* I915_GEM_OBJECT_SHRINK_WRITEBACK - Try to perform writeback of the
* backing pages, if supported.
*
* I915_GEM_OBJECT_SHRINK_NO_GPU_WAIT - Don't wait for the object to
* idle. Active objects can be considered later. The TTM backend for
* example might have aync migrations going on, which don't use any
* i915_vma to track the active GTT binding, and hence having an unbound
* object might not be enough.
*/
#define I915_GEM_OBJECT_SHRINK_WRITEBACK BIT(0)
#define I915_GEM_OBJECT_SHRINK_NO_GPU_WAIT BIT(1)
int (*shrink)(struct drm_i915_gem_object *obj, unsigned int flags);
int (*pread)(struct drm_i915_gem_object *obj,
const struct drm_i915_gem_pread *arg);
int (*pwrite)(struct drm_i915_gem_object *obj,
const struct drm_i915_gem_pwrite *arg);
u64 (*mmap_offset)(struct drm_i915_gem_object *obj);
void (*unmap_virtual)(struct drm_i915_gem_object *obj);
int (*dmabuf_export)(struct drm_i915_gem_object *obj);
/**
* adjust_lru - notify that the madvise value was updated
* @obj: The gem object
*
* The madvise value may have been updated, or object was recently
* referenced so act accordingly (Perhaps changing an LRU list etc).
*/
void (*adjust_lru)(struct drm_i915_gem_object *obj);
/**
* delayed_free - Override the default delayed free implementation
*/
void (*delayed_free)(struct drm_i915_gem_object *obj);
/**
* migrate - Migrate object to a different region either for
* pinning or for as long as the object lock is held.
*/
int (*migrate)(struct drm_i915_gem_object *obj,
struct intel_memory_region *mr,
unsigned int flags);
void (*release)(struct drm_i915_gem_object *obj);
const struct vm_operations_struct *mmap_ops;
const char *name; /* friendly name for debug, e.g. lockdep classes */
};
/**
Annotation
- Immediate include surface: `linux/mmu_notifier.h`, `drm/drm_gem.h`, `drm/ttm/ttm_bo.h`, `uapi/drm/i915_drm.h`, `i915_active.h`, `i915_selftest.h`, `i915_vma_resource.h`, `gt/intel_gt_defines.h`.
- Detected declarations: `struct drm_i915_gem_object`, `struct intel_fronbuffer`, `struct intel_memory_region`, `struct i915_lut_handle`, `struct drm_i915_gem_object_ops`, `struct i915_mmap_offset`, `struct i915_gem_object_page_iter`, `struct drm_i915_gem_object`, `struct i915_gem_userptr`, `enum i915_cache_level`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.