drivers/gpu/drm/i915/gem/i915_gem_object_frontbuffer.h
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/gem/i915_gem_object_frontbuffer.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/gem/i915_gem_object_frontbuffer.h- Extension
.h- Size
- 2734 bytes
- Lines
- 97
- 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/kref.hlinux/rcupdate.hdisplay/intel_frontbuffer.hi915_gem_object_types.h
Detected Declarations
struct i915_frontbufferfunction i915_gem_object_frontbuffer_flushfunction i915_gem_object_frontbuffer_invalidatefunction i915_gem_object_frontbuffer_trackfunction i915_gem_object_frontbuffer_lookup
Annotated Snippet
struct i915_frontbuffer {
struct intel_frontbuffer base;
struct drm_i915_gem_object *obj;
struct i915_active write;
struct rcu_head rcu;
struct kref ref;
};
void __i915_gem_object_frontbuffer_flush(struct drm_i915_gem_object *obj,
enum fb_op_origin origin);
void __i915_gem_object_frontbuffer_invalidate(struct drm_i915_gem_object *obj,
enum fb_op_origin origin);
static inline void
i915_gem_object_frontbuffer_flush(struct drm_i915_gem_object *obj,
enum fb_op_origin origin)
{
if (unlikely(rcu_access_pointer(obj->frontbuffer)))
__i915_gem_object_frontbuffer_flush(obj, origin);
}
static inline void
i915_gem_object_frontbuffer_invalidate(struct drm_i915_gem_object *obj,
enum fb_op_origin origin)
{
if (unlikely(rcu_access_pointer(obj->frontbuffer)))
__i915_gem_object_frontbuffer_invalidate(obj, origin);
}
struct i915_frontbuffer *i915_gem_object_frontbuffer_get(struct drm_i915_gem_object *obj);
void i915_gem_object_frontbuffer_ref(struct i915_frontbuffer *front);
void i915_gem_object_frontbuffer_put(struct i915_frontbuffer *front);
static inline void i915_gem_object_frontbuffer_track(struct i915_frontbuffer *_old,
struct i915_frontbuffer *_new,
unsigned int frontbuffer_bits)
{
struct intel_frontbuffer *old = _old ? &_old->base : NULL;
struct intel_frontbuffer *new = _new ? &_new->base : NULL;
intel_frontbuffer_track(old, new, frontbuffer_bits);
}
/**
* i915_gem_object_frontbuffer_lookup - Look up the object's frontbuffer
* @obj: The object whose frontbuffer to look up.
*
* Get pointer to object's frontbuffer if such exists. Please note that RCU
* mechanism is used to handle e.g. ongoing removal of frontbuffer pointer.
*
* Return: pointer to object's frontbuffer is such exists or NULL
*/
static inline struct i915_frontbuffer *
i915_gem_object_frontbuffer_lookup(const struct drm_i915_gem_object *obj)
{
struct i915_frontbuffer *front;
if (likely(!rcu_access_pointer(obj->frontbuffer)))
return NULL;
rcu_read_lock();
do {
front = rcu_dereference(obj->frontbuffer);
if (!front)
break;
if (unlikely(!kref_get_unless_zero(&front->ref)))
continue;
if (likely(front == rcu_access_pointer(obj->frontbuffer)))
break;
i915_gem_object_frontbuffer_put(front);
} while (1);
rcu_read_unlock();
return front;
}
extern const struct intel_display_frontbuffer_interface i915_display_frontbuffer_interface;
#endif
Annotation
- Immediate include surface: `linux/kref.h`, `linux/rcupdate.h`, `display/intel_frontbuffer.h`, `i915_gem_object_types.h`.
- Detected declarations: `struct i915_frontbuffer`, `function i915_gem_object_frontbuffer_flush`, `function i915_gem_object_frontbuffer_invalidate`, `function i915_gem_object_frontbuffer_track`, `function i915_gem_object_frontbuffer_lookup`.
- 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.