drivers/gpu/drm/i915/i915_gtt_view_types.h

Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/i915_gtt_view_types.h

File Facts

System
Linux kernel
Corpus path
drivers/gpu/drm/i915/i915_gtt_view_types.h
Extension
.h
Size
1631 bytes
Lines
75
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.

Dependency Surface

Detected Declarations

Annotated Snippet

struct intel_remapped_plane_info {
	/* in gtt pages */
	u32 offset:31;
	u32 linear:1;
	union {
		/* in gtt pages for !linear */
		struct {
			u16 width;
			u16 height;
			u16 src_stride;
			u16 dst_stride;
		};

		/* in gtt pages for linear */
		u32 size;
	};
} __packed;

struct intel_rotation_info {
	struct intel_remapped_plane_info plane[2];
} __packed;

struct intel_partial_info {
	u64 offset;
	unsigned int size;
} __packed;

struct intel_remapped_info {
	struct intel_remapped_plane_info plane[4];
	/* in gtt pages */
	u32 plane_alignment;
} __packed;

enum i915_gtt_view_type {
	I915_GTT_VIEW_NORMAL = 0,
	I915_GTT_VIEW_ROTATED = sizeof(struct intel_rotation_info),
	I915_GTT_VIEW_PARTIAL = sizeof(struct intel_partial_info),
	I915_GTT_VIEW_REMAPPED = sizeof(struct intel_remapped_info),
};

struct i915_gtt_view {
	enum i915_gtt_view_type type;
	union {
		/* Members need to contain no holes/padding */
		struct intel_partial_info partial;
		struct intel_rotation_info rotated;
		struct intel_remapped_info remapped;
	};
};

static inline bool i915_gtt_view_is_normal(const struct i915_gtt_view *view)
{
	return view->type == I915_GTT_VIEW_NORMAL;
}

static inline bool i915_gtt_view_is_remapped(const struct i915_gtt_view *view)
{
	return view->type == I915_GTT_VIEW_REMAPPED;
}

static inline bool i915_gtt_view_is_rotated(const struct i915_gtt_view *view)
{
	return view->type == I915_GTT_VIEW_ROTATED;
}

#endif /* __I915_GTT_VIEW_TYPES_H__ */

Annotation

Implementation Notes