drm: Improve logic behind damage handling
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v5 Latest15 patches 8 repliesIn review
- v410 patches 11 repliesSuperseded
- v310 patches 6 repliesSuperseded
Earlier versions · 2
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v2 | 10 patches | 0 replies | Superseded | |
| v1 | 10 patches | 1 reply | Superseded |
Changes in v5 from the cover letter
- support ignore_damage_clips in amdgpu, i915, virtgpu, vmwgfx
- reorder patches to avoid possible regressions during the series
- fix clearing ignore_damage_clips in a separate patch (Javier) v4:
- reorder patches to avoid error-prone intermediate state v3:
- fix error path in appletbdrm
Patches in v5 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/15 | drm/amd/display: Handle struct drm_plane_state.ignore_damage_clipsdrivers/ | +6 | 5 replies | |
| 2/15 | drm/i915/display: Handle struct drm_plane_state.ignore_damage_clipsdrivers/ | +3 | 1 reply | |
| 3/15 | drm/vboxvideo: Handle struct drm_plane_state.ignore_damage_clipsdrivers/ | +7 | 1 reply | |
| 4/15 | drm/vmwgfx: Handle struct drm_plane_state.ignore_damage_clipsdrivers/ | +7 | 1 reply | |
| 5/15 | drm/appletbdrm: Allocate request/response buffers in begin_fb_accessdrivers/ | +30 | 0 replies | |
| 6/15 | drm/damage-helper: Clear ignore_damage_clips in plane-state duplicationdrivers/ | +1 | 0 replies | |
| 7/15 | drm/damage-helper: Do not alter damage clips on modeset, but ignore themdrivers/ drivers/ | +30 | 0 replies | |
| 8/15 | drm/atomic-helpers: Evaluate plane damage after atomic_checkdrivers/ | +4 | 0 replies | |
| 9/15 | drm/ingenic: Remove calls to drm_atomic_helper_check_plane_damage()drivers/ drivers/ | +2 | 0 replies | |
| 10/15 | drm/atomic_helper: Do not evaluate plane damage before atomic_checkdrivers/ | +0 | 0 replies | |
| 11/15 | drm/damage-helper: Test src coord in drm_atomic_helper_check_plane_damage()drivers/ drivers/ drivers/ +1 more | +15 | 0 replies | |
| 12/15 | drm/damage-helper: Remove old state from drm_atomic_helper_damage_iter_init()drivers/ drivers/ drivers/ +14 more | +37 | 0 replies | |
| 13/15 | drm/damage-helper: Remove old state from drm_atomic_helper_damage_merged()drivers/ drivers/ drivers/ +10 more | +17 | 0 replies | |
| 14/15 | drm/damage-helper: Rename state parameters in damage helpersdrivers/ include/ | +12 | 0 replies | |
| 15/15 | drm/vmwgfx: Remove unused field struct vmwgfx_du_update_plane.old_statedrivers/ drivers/ drivers/ | +4 | 0 replies |
Reviews trailers per patch
All 15 patches have a Reviewed-by or Acked-by.
| Patch | Javier Martinez Canillas | Aditya Garg | Zack Rusin | Hamza Mahfooz | Harry Wentland |
|---|---|---|---|---|---|
| 1/15 | R-b | R-b | |||
| 2/15 | R-b | ||||
| 3/15 | R-b | ||||
| 4/15 | R-b | ||||
| 5/15 | R-b | A-b | A-b | ||
| 6/15 | R-b | A-b | |||
| 7/15 | R-b | A-b | |||
| 8/15 | R-b | A-b | |||
| 9/15 | R-b | A-b | |||
| 10/15 | R-b | A-b | |||
| 11/15 | R-b | A-b | |||
| 12/15 | R-b | A-b | A-b | ||
| 13/15 | R-b | A-b | |||
| 14/15 | R-b | A-b | |||
| 15/15 | R-b | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.
Cover letter [PATCH v5 00/15] drm: Improve logic behind damage handling
DRM clients can supply information on framebuffer areas to update as part of each page flip, called damage-clipping rectangles. But DRM's processing of this information is inconsistent and prone to errors.
- There are multiple fields and tests that decide if damage clips should be taken or ignored.
- Sometimes damage clips are removed behind the back of the DRM client.
- Atomic helpers evaluate damage clipping in the middle of the atomic
check: after connectors and encoders, but before planes and CRTCs. Hence pipeline stages have an inconsistent view.
- Which leads to drivers (ingenic) doing a re-evaluation if necessary.
- Tests of plane source coordinates only happen during commits. At this point, the driver should already know if damage clips are to be taken or not. Because of this, some drivers (appletbdrm) might operate on incorrect damage information for their internal workings. This also leads to excessive use of the old plane state.
Therefore go through DRM helpers and drivers and fix the logic.
- Run all of the atomic checks with the damage information supplied by DRM clients. Afterwards evaluate plane and CRTC states on whether to take or ignore damage clips. Do all related tests in a single atomic helper.
- Do not discard damage clips. Set ignore_damage_clips in struct drm_plane_state instead. This includes changes to plane source-coordinates. The damage iterator now only has to look at this flag to detect if it should use the damage clips.
- Go over drivers and fix the damage handling in the plane's atomic_update helpers. Most drivers no longer need the old plane state in their update.
- The appletbdrm driver requires a fix in how it uses damage information. Ingenic and vmwgfx can be simplified. These changes improve the drivers' code organization.
- Add support for ignore_damage_clips to various drivers that ignored it until now.
- Kunit tests require some changes. Drop some obsolete tests and add a new one for ignore_damage_flags.
Tested with bochs, mgag200, Kunit tests.
v5:
- support ignore_damage_clips in amdgpu, i915, virtgpu, vmwgfx
- reorder patches to avoid possible regressions during the series
- fix clearing ignore_damage_clips in a separate patch (Javier) v4:
- reorder patches to avoid error-prone intermediate state v3:
- fix error path in appletbdrm
v2:
- rebase on latest upstream
Thomas Zimmermann (15):
drm/amd/display: Handle struct drm_plane_state.ignore_damage_clips drm/i915/display: Handle struct drm_plane_state.ignore_damage_clips drm/vboxvideo: Handle struct drm_plane_state.ignore_damage_clips drm/vmwgfx: Handle struct drm_plane_state.ignore_damage_clips drm/appletbdrm: Allocate request/response buffers in begin_fb_access drm/damage-helper: Clear ignore_damage_clips in plane-state
duplication
drm/damage-helper: Do not alter damage clips on modeset, but ignore
them
drm/atomic-helpers: Evaluate plane damage after atomic_check drm/ingenic: Remove calls to drm_atomic_helper_check_plane_damage() drm/atomic_helper: Do not evaluate plane damage before atomic_check drm/damage-helper: Test src coord in
drm_atomic_helper_check_plane_damage()
drm/damage-helper: Remove old state from
drm_atomic_helper_damage_iter_init()
drm/damage-helper: Remove old state from
drm_atomic_helper_damage_merged()
drm/damage-helper: Rename state parameters in damage helpers drm/vmwgfx: Remove unused field struct
vmwgfx_du_update_plane.old_state
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 10 +- drivers/gpu/drm/ast/ast_cursor.c | 3 +- drivers/gpu/drm/ast/ast_mode.c | 2 +- drivers/gpu/drm/drm_atomic_helper.c | 6 +- drivers/gpu/drm/drm_atomic_state_helper.c | 1 + drivers/gpu/drm/drm_damage_helper.c | 44 ++-- drivers/gpu/drm/drm_fb_dma_helper.c | 2 +- drivers/gpu/drm/drm_mipi_dbi.c | 3 +- drivers/gpu/drm/gud/gud_pipe.c | 3 +- drivers/gpu/drm/hyperv/hyperv_drm_modeset.c | 3 +- drivers/gpu/drm/i915/display/intel_plane.c | 11 +- drivers/gpu/drm/i915/display/intel_psr.c | 8 +- drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 3 - drivers/gpu/drm/ingenic/ingenic-ipu.c | 8 +- drivers/gpu/drm/mgag200/mgag200_mode.c | 3 +- drivers/gpu/drm/sitronix/st7571.c | 3 +- drivers/gpu/drm/sitronix/st7586.c | 3 +- drivers/gpu/drm/sitronix/st7920.c | 3 +- drivers/gpu/drm/solomon/ssd130x.c | 9 +- drivers/gpu/drm/sysfb/drm_sysfb_modeset.c | 3 +- .../gpu/drm/tests/drm_damage_helper_test.c | 200 +++--------------- drivers/gpu/drm/tiny/appletbdrm.c | 59 +++--- drivers/gpu/drm/tiny/bochs.c | 3 +- drivers/gpu/drm/tiny/cirrus-qemu.c | 2 +- drivers/gpu/drm/tiny/gm12u320.c | 2 +- drivers/gpu/drm/tiny/ili9225.c | 3 +- drivers/gpu/drm/tiny/repaper.c | 2 +- drivers/gpu/drm/tiny/sharp-memory.c | 3 +- drivers/gpu/drm/udl/udl_modeset.c | 3 +- drivers/gpu/drm/vboxvideo/vbox_mode.c | 11 +- drivers/gpu/drm/virtio/virtgpu_plane.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 5 +- drivers/gpu/drm/vmwgfx/vmwgfx_kms.h | 2 - drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c | 9 +- drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c | 12 +- drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c | 15 +- include/drm/drm_damage_helper.h | 9 +- 37 files changed, 148 insertions(+), 325 deletions(-)
base-commit: fc59f76558703febba8056be87d1c97d14f7485e
Signature · 1 line
2.54.0