drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c- Extension
.c- Size
- 50593 bytes
- Lines
- 1715
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
vmwgfx_bo.hvmwgfx_kms.hvmwgfx_vkms.hvmw_surface_cache.hlinux/fsnotify.hdrm/drm_atomic.hdrm/drm_atomic_helper.hdrm/drm_damage_helper.hdrm/drm_fourcc.hdrm/drm_vblank.h
Detected Declarations
struct vmw_stdu_dirtystruct vmw_stdu_updatestruct vmw_stdu_surface_copystruct vmw_stdu_update_gb_imagestruct vmw_screen_target_display_unitenum stdu_content_typefunction vmw_stdu_crtc_destroyfunction vmw_stdu_define_stfunction vmw_stdu_bind_stfunction vmw_stdu_populate_updatefunction vmw_stdu_update_stfunction vmw_stdu_destroy_stfunction vmw_stdu_crtc_mode_set_nofbfunction vmw_stdu_crtc_atomic_disablefunction vmw_stdu_bo_cpu_clipfunction vmw_stdu_bo_cpu_commitfunction vmw_kms_stdu_readbackfunction vmw_kms_stdu_surface_clipfunction vmw_kms_stdu_surface_fifo_commitfunction vmw_kms_stdu_surface_dirtyfunction vmw_stdu_crtc_destroyfunction vmw_stdu_crtc_destroyfunction vmw_stdu_connector_mode_validfunction vmw_stdu_connector_atomic_checkfunction vmw_stdu_primary_plane_cleanup_fbfunction vmw_stdu_primary_plane_prepare_fbfunction sidefunction vmw_stdu_bo_fifo_size_cpufunction vmw_stdu_bo_pre_clip_cpufunction vmw_stdu_bo_clip_cpufunction vmw_stdu_bo_populate_update_cpufunction vmw_stdu_plane_update_bofunction vmw_stdu_surface_fifo_size_same_displayfunction vmw_stdu_surface_fifo_sizefunction vmw_stdu_surface_populate_copyfunction vmw_stdu_surface_populate_clipfunction vmw_stdu_surface_populate_updatefunction vmw_stdu_plane_update_surfacefunction vmw_stdu_primary_plane_atomic_updatefunction vmw_stdu_crtc_atomic_flushfunction vmw_stdu_initfunction vmw_stdu_destroyfunction vmw_kms_stdu_init_display
Annotated Snippet
struct vmw_stdu_dirty {
struct vmw_kms_dirty base;
s32 left, right, top, bottom;
s32 fb_left, fb_top;
u32 pitch;
union {
struct vmw_bo *buf;
u32 sid;
};
};
/*
* SVGA commands that are used by this code. Please see the device headers
* for explanation.
*/
struct vmw_stdu_update {
SVGA3dCmdHeader header;
SVGA3dCmdUpdateGBScreenTarget body;
};
struct vmw_stdu_surface_copy {
SVGA3dCmdHeader header;
SVGA3dCmdSurfaceCopy body;
};
struct vmw_stdu_update_gb_image {
SVGA3dCmdHeader header;
SVGA3dCmdUpdateGBImage body;
};
/**
* struct vmw_screen_target_display_unit - conglomerated STDU structure
*
* @base: VMW specific DU structure
* @display_srf: surface to be displayed. The dimension of this will always
* match the display mode. If the display mode matches
* content_vfbs dimensions, then this is a pointer into the
* corresponding field in content_vfbs. If not, then this
* is a separate buffer to which content_vfbs will blit to.
* @content_fb_type: content_fb type
* @display_width: display width
* @display_height: display height
* @defined: true if the current display unit has been initialized
* @cpp: Bytes per pixel
*/
struct vmw_screen_target_display_unit {
struct vmw_display_unit base;
struct vmw_surface *display_srf;
enum stdu_content_type content_fb_type;
s32 display_width, display_height;
bool defined;
/* For CPU Blit */
unsigned int cpp;
};
static void vmw_stdu_destroy(struct vmw_screen_target_display_unit *stdu);
/******************************************************************************
* Screen Target Display Unit CRTC Functions
*****************************************************************************/
/**
* vmw_stdu_crtc_destroy - cleans up the STDU
*
* @crtc: used to get a reference to the containing STDU
*/
static void vmw_stdu_crtc_destroy(struct drm_crtc *crtc)
{
vmw_stdu_destroy(vmw_crtc_to_stdu(crtc));
}
/**
* vmw_stdu_define_st - Defines a Screen Target
*
* @dev_priv: VMW DRM device
* @stdu: display unit to create a Screen Target for
* @mode: The mode to set.
* @crtc_x: X coordinate of screen target relative to framebuffer origin.
* @crtc_y: Y coordinate of screen target relative to framebuffer origin.
*
* Creates a STDU that we can used later. This function is called whenever the
* framebuffer size changes.
*
* RETURNs:
Annotation
- Immediate include surface: `vmwgfx_bo.h`, `vmwgfx_kms.h`, `vmwgfx_vkms.h`, `vmw_surface_cache.h`, `linux/fsnotify.h`, `drm/drm_atomic.h`, `drm/drm_atomic_helper.h`, `drm/drm_damage_helper.h`.
- Detected declarations: `struct vmw_stdu_dirty`, `struct vmw_stdu_update`, `struct vmw_stdu_surface_copy`, `struct vmw_stdu_update_gb_image`, `struct vmw_screen_target_display_unit`, `enum stdu_content_type`, `function vmw_stdu_crtc_destroy`, `function vmw_stdu_define_st`, `function vmw_stdu_bind_st`, `function vmw_stdu_populate_update`.
- 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.