dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] drm/damage-helper: Improve damage-clipping heuristics
@ 2022-09-20 13:56 Thomas Zimmermann
  2022-09-20 13:56 ` [PATCH 1/5] drm/damage-helper: Style changes Thomas Zimmermann
                   ` (4 more replies)
  0 siblings, 5 replies; 16+ messages in thread
From: Thomas Zimmermann @ 2022-09-20 13:56 UTC (permalink / raw)
  To: airlied, daniel, maarten.lankhorst, mripard, robdclark, drawat.floss
  Cc: Thomas Zimmermann, dri-devel

DRM Drivers can minimize a plane update by looking at damage clipping
information provided by userspace. So far, not having damage information
starts a full-plane update. Improve the heuristics for detecting partial
and full-plane updates by looking at the various state variables of a
plane update.

The current scheme of interpreting 'no damage information' as 'do full
update' works for hardware with a single primary plane. For hardware with
multiple planes, missing damage information can generate significant
overhead. For example, ast supports a primary plane and a cursor plane.
DRM performs an atomic update when the cursor plane is being updated in
some way (e.g., moved). The lack of damage information on the primary
plane results in a full-plane update of the primary plane as well. Using
shadow planes that need to be memcpy'd to video memory creates a full
redraw of the entire primary plane whenever the user moves the mouse
cursor.

The patchset improves the current heuristics by looking at various
state variables to detect whether a full update is necessary.

Patch #2 decouples full-plane updates from the (non-)existence of
damage information. Full-plane updates are still the default, but
the dedicated flag in the plane state allows for more fine-grained
control.

Patches #3 to #5 enable partial plane updates on various conditions.

The patchset has been tested by converting ast to SHMEM and running
Gnome on X11, Gnome in Wayland mode, and Weston. The new heuristics
reduce each environment's unnecessary updates of the primary plane to
no-ops: DRM still invokes the primary plane's atomic_update, but the
costly memcpy to video memory is being avoided.

Thomas Zimmermann (5):
  drm/damage-helper: Style changes
  drm/damage-helper: Decouple partial plane updates from damage clipping
  drm/damage-helper: Do partial updates on legacy cursor changes
  drm/damage-helper: Do partial updates if framebuffer has not been
    changed
  drm/damage-helper: Avoid partial updates for DIRTYFB without damage

 drivers/gpu/drm/drm_atomic_helper.c       |  3 +
 drivers/gpu/drm/drm_atomic_state_helper.c |  3 +
 drivers/gpu/drm/drm_damage_helper.c       | 99 +++++++++++++++++------
 include/drm/drm_plane.h                   | 23 ++++++
 4 files changed, 105 insertions(+), 23 deletions(-)


base-commit: d8deedaa0fcd8192715a052a0239bee3f74a8fb1
-- 
2.37.3


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2022-09-29 14:02 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-20 13:56 [PATCH 0/5] drm/damage-helper: Improve damage-clipping heuristics Thomas Zimmermann
2022-09-20 13:56 ` [PATCH 1/5] drm/damage-helper: Style changes Thomas Zimmermann
2022-09-20 13:56 ` [PATCH 2/5] drm/damage-helper: Decouple partial plane updates from damage clipping Thomas Zimmermann
2022-09-20 13:56 ` [PATCH 3/5] drm/damage-helper: Do partial updates on legacy cursor changes Thomas Zimmermann
2022-09-20 13:56 ` [PATCH 4/5] drm/damage-helper: Do partial updates if framebuffer has not been changed Thomas Zimmermann
2022-09-20 14:31   ` Ville Syrjälä
2022-09-20 14:47     ` Daniel Stone
2022-09-20 16:01       ` Ville Syrjälä
2022-09-29 14:02       ` Thomas Zimmermann
2022-09-21  7:59     ` Thomas Zimmermann
2022-09-21  8:37       ` Ville Syrjälä
2022-09-21  9:39         ` Thomas Zimmermann
2022-09-21 10:18           ` Ville Syrjälä
2022-09-21 10:49             ` Thomas Zimmermann
2022-09-26  6:54             ` Thomas Zimmermann
2022-09-20 13:56 ` [PATCH 5/5] drm/damage-helper: Avoid partial updates for DIRTYFB without damage Thomas Zimmermann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).