fill_dc_dirty_rects(9)
π fill_dc_dirty_rects(9) β kernel API manual, bestie edition β¨
okay so this is a page from the Kernel API Manual (section 9, the fancy kernel-internals section, iykyk) and we're talking about fill_dc_dirty_rects β the little function that handles DC dirty regions for PSR selective updates. yes it's as niche as it sounds and yes it's iconic π
πΈ NAME πΈ
fill_dc_dirty_rects β fills DC dirty regions so PSR selective updates can happen π
β¨ SYNOPSIS β¨
void fill_dc_dirty_rects (struct drm_plane *plane , struct
drm_plane_state *old_plane_state , struct drm_plane_state
*new_plane_state , struct drm_crtc_state *crtc_state , struct
dc_flip_addrs *flip_addrs , bool is_psr_su , bool *dirty_regions_changed
);
like, seven arguments and a pointer to a bool. she's high maintenance but she delivers π«Ά
π¦ ARGUMENTS π¦
planeβ the DRM plane holding the dirty regions that need to be flushed over to the eDP remote fb. this is the main character of the whole operation πold_plane_stateβ the old state of the plane. the before pic πΈnew_plane_stateβ the new state of the plane. the glow-up β¨crtc_stateβ the new state of the CRTC that's connected to the plane. yes, they're linked, it's giving committed relationship πflip_addrsβ the DC flip tracking struct, which also tracks dirty rects. multitasking queen πis_psr_suβ flag saying whether Panel Self Refresh Selective Update (PSR SU) is enabled. and here's the tea: if PSR SU is enabled and damage clips are available, only the regions of the screen that actually changed get updated π―. if PSR SU is not enabled, or if damage clips aren't available, then the entire screen gets updated. no shortcuts, no vibes check, just the whole thing πdirty_regions_changedβ dirty regions changed. that's it, that's the description, and honestly? she's straightforward and we respect that π
π₯ DESCRIPTION π₯
so for PSR SU, DC tells the DMUB uController all about the dirty rectangle regions (DRM calls these "damage clips", cute name fr fr) that need updating on the eDP remote buffer. and whose job is it to specify those dirty regions? that's amdgpu_dm's responsibility, no cap πͺ
a damage-aware DRM client should fill the FB_DAMAGE_CLIPS property on the plane with the regions that need flushing to the eDP remote buffer π
plus β and this is the fun part β some use cases, like cursor and multi-plane overlay (MPO), just go ahead and implicitly provide damage clips all on their own, no client support needed, straight from the plane bounds. self-sufficient icons, we love to see it β
π§ SEE ALSO π§
first up, the kernel file itself, go read the source bestie:
./drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
then the whole friend group π«Ά:
overview(9)update_planes_and_stream_adapter(9)dm_hw_init(9)dm_hw_fini(9)amdgpu_dm_dump_links_and_sinks(9)DM Lifecycle(9)atomic(9)dm_arm_vblank_event_pre_programming(9)amdgpu_dm_crtc_complete_writeback(9)amdgpu_dm_mod_power_update_streams(9)amdgpu_dm_mod_power_setup_streams(9)amdgpu_dm_atomic_commit_tail(9)amdgpu_dm_atomic_check(9)
π reminder bestie: this page comes from./drivers/gpu/drm/amd/display/...and it's dated October 2026, all under thefill_dc_dirty_rects(9)name. that's the whole source/version situation, mwah π
slay, you now understand dirty rects better than most of the internet. periodt πβ¨π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms