drivers/gpu/drm/sysfb/drm_sysfb_helper.h

Source file repositories/reference/linux-study-clean/drivers/gpu/drm/sysfb/drm_sysfb_helper.h

File Facts

System
Linux kernel
Corpus path
drivers/gpu/drm/sysfb/drm_sysfb_helper.h
Extension
.h
Size
6576 bytes
Lines
210
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 drm_sysfb_format {
	struct pixel_format pixel;
	u32 fourcc;
};

int drm_sysfb_get_validated_int(struct drm_device *dev, const char *name,
				u64 value, u32 max);
int drm_sysfb_get_validated_int0(struct drm_device *dev, const char *name,
				 u64 value, u32 max);
const struct drm_format_info *drm_sysfb_get_format(struct drm_device *dev,
						   const struct drm_sysfb_format *formats,
						   size_t nformats,
						   const struct pixel_format *pixel);

#if defined(CONFIG_SCREEN_INFO)
int drm_sysfb_get_width_si(struct drm_device *dev, const struct screen_info *si);
int drm_sysfb_get_height_si(struct drm_device *dev, const struct screen_info *si);
struct resource *drm_sysfb_get_memory_si(struct drm_device *dev,
					 const struct screen_info *si,
					 struct resource *res);
int drm_sysfb_get_stride_si(struct drm_device *dev, const struct screen_info *si,
			    const struct drm_format_info *format,
			    unsigned int width, unsigned int height, u64 size);
u64 drm_sysfb_get_visible_size_si(struct drm_device *dev, const struct screen_info *si,
				  unsigned int height, unsigned int stride, u64 size);
#endif

/*
 * Display modes
 */

struct drm_display_mode drm_sysfb_mode(unsigned int width,
				       unsigned int height,
				       unsigned int width_mm,
				       unsigned int height_mm);

/*
 * Device
 */

struct drm_sysfb_device {
	struct drm_device dev;

	const u8 *edid; /* can be NULL */

	/* hardware settings */
	struct drm_display_mode fb_mode;
	const struct drm_format_info *fb_format;
	unsigned int fb_pitch;
	unsigned int fb_gamma_lut_size;

	/* hardware-framebuffer kernel address */
	struct iosys_map fb_addr;
};

static inline struct drm_sysfb_device *to_drm_sysfb_device(struct drm_device *dev)
{
	return container_of(dev, struct drm_sysfb_device, dev);
}

/*
 * Plane
 */

struct drm_sysfb_plane_state {
	struct drm_shadow_plane_state base;

	/* transfers framebuffer data to scanout buffer in CRTC format */
	drm_sysfb_blit_func blit_to_crtc;
};

static inline struct drm_sysfb_plane_state *
to_drm_sysfb_plane_state(struct drm_plane_state *base)
{
	return container_of(to_drm_shadow_plane_state(base), struct drm_sysfb_plane_state, base);
}

size_t drm_sysfb_build_fourcc_list(struct drm_device *dev,
				   const u32 *native_fourccs, size_t native_nfourccs,
				   u32 *fourccs_out, size_t nfourccs_out);

int drm_sysfb_plane_helper_begin_fb_access(struct drm_plane *plane,
					   struct drm_plane_state *plane_state);
int drm_sysfb_plane_helper_atomic_check(struct drm_plane *plane,
					struct drm_atomic_commit *new_state);
void drm_sysfb_plane_helper_atomic_update(struct drm_plane *plane,
					  struct drm_atomic_commit *state);
void drm_sysfb_plane_helper_atomic_disable(struct drm_plane *plane,
					   struct drm_atomic_commit *state);
int drm_sysfb_plane_helper_get_scanout_buffer(struct drm_plane *plane,

Annotation

Implementation Notes