include/drm/drm_fb_helper.h

Source file repositories/reference/linux-study-clean/include/drm/drm_fb_helper.h

File Facts

System
Linux kernel
Corpus path
include/drm/drm_fb_helper.h
Extension
.h
Size
9490 bytes
Lines
285
Domain
Repository Root And Misc
Bucket
include
Inferred role
Repository Root And Misc: implementation source
Status
source implementation candidate

Why This File Exists

Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.

Dependency Surface

Detected Declarations

Annotated Snippet

struct drm_fb_helper_surface_size {
	u32 fb_width;
	u32 fb_height;
	u32 surface_width;
	u32 surface_height;
	u32 surface_bpp;
	u32 surface_depth;
};

/**
 * struct drm_fb_helper_funcs - driver callbacks for the fbdev emulation library
 *
 * Driver callbacks used by the fbdev emulation helper library.
 */
struct drm_fb_helper_funcs {
	/**
	 * @fb_dirty:
	 *
	 * Driver callback to update the framebuffer memory. If set, fbdev
	 * emulation will invoke this callback in regular intervals after
	 * the framebuffer has been written.
	 *
	 * This callback is optional.
	 *
	 * Returns:
	 * 0 on success, or an error code otherwise.
	 */
	int (*fb_dirty)(struct drm_fb_helper *helper, struct drm_clip_rect *clip);

	/**
	 * @fb_restore:
	 *
	 * Driver callback to restore internal fbdev state. If set, fbdev
	 * emulation will invoke this callback after restoring the display
	 * mode.
	 *
	 * Only for i915. Do not use in new code.
	 *
	 * TODO: Fix i915 to not require this callback.
	 */
	void (*fb_restore)(struct drm_fb_helper *helper);

	/**
	 * @fb_set_suspend:
	 *
	 * Driver callback to suspend or resume, if set, fbdev emulation will
	 * invoke this callback during suspend and resume. Driver should call
	 * fb_set_suspend() from their implementation. If not set, fbdev
	 * emulation will invoke fb_set_suspend() directly.
	 *
	 * Only for i915. Do not use in new code.
	 *
	 * TODO: Fix i915 to not require this callback.
	 */
	void (*fb_set_suspend)(struct drm_fb_helper *helper, bool suspend);
};

/**
 * struct drm_fb_helper - main structure to emulate fbdev on top of KMS
 * @fb: Scanout framebuffer object
 * @dev: DRM device
 * @funcs: driver callbacks for fb helper
 * @info: emulated fbdev device info struct
 * @pseudo_palette: fake palette of 16 colors
 * @damage_clip: clip rectangle used with deferred_io to accumulate damage to
 *                the screen buffer
 * @damage_lock: spinlock protecting @damage_clip
 * @damage_work: worker used to flush the framebuffer
 * @resume_work: worker used during resume if the console lock is already taken
 *
 * This is the main structure used by the fbdev helpers. Drivers supporting
 * fbdev emulation should embedded this into their overall driver structure.
 * Drivers must also fill out a &struct drm_fb_helper_funcs with a few
 * operations.
 */
struct drm_fb_helper {
	/**
	 * @client:
	 *
	 * DRM client used by the generic fbdev emulation.
	 */
	struct drm_client_dev client;

	/**
	 * @buffer:
	 *
	 * Framebuffer used by the generic fbdev emulation.
	 */
	struct drm_client_buffer *buffer;

Annotation

Implementation Notes