All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC 0/8] drm: Add DRM_MODE_ATOMIC_RESET flag
@ 2026-07-08 16:08 Maxime Ripard
  2026-07-08 16:08 ` [PATCH RFC 1/8] drm/atomic: colorop: Rename state to state_to_destroy Maxime Ripard
                   ` (9 more replies)
  0 siblings, 10 replies; 15+ messages in thread
From: Maxime Ripard @ 2026-07-08 16:08 UTC (permalink / raw)
  To: Maarten Lankhorst, Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: Daniel Stone, Harry Wentland, Jonas Ådahl,
	Michel Dänzer, Pekka Paalanen, Sebastian Wick, Simon Ser,
	Victoria Brekenfeld, Xaver Hugl, dri-devel, linux-kernel,
	Maxime Ripard

Hi,

Userspace currently has no atomic way to bring a display pipeline back
to a pristine state. A compositor that wants to start from a known
baseline must explicitly set every property on every KMS object to its
default value, which requires tracking which properties exist and what
their defaults are. This is fragile and must be updated every time a
new property is added to the kernel.

This series introduces a new DRM_MODE_ATOMIC_RESET flag for the
atomic ioctl. When set, the kernel fills the commit with default
states for all KMS objects before applying the properties supplied in
the request. Properties not explicitly included remain at their
defaults (CRTCs inactive, planes disabled, connectors unbound, and so
on). This allows userspace to describe the desired end state
declaratively, without having to care about the current state or the
full set of properties.

The first patch is a small cleanup aligning __drm_colorops_state with
the naming convention used by the other atomic state tracking
structures.

Patches 2 through 6 extract the state insertion logic from each
drm_atomic_get_*_state() function into standalone helpers. This is
needed because the new fill_with_defaults path creates states through
atomic_create_state() rather than atomic_duplicate_state(), so it
cannot go through the existing drm_atomic_get_*_state() functions.

Patch 7 adds drm_atomic_commit_fill_with_defaults(), which uses those
helpers to populate a commit with pristine states for every object in
the device.

Patch 8 wires it all up by adding DRM_MODE_ATOMIC_RESET to the atomic
ioctl.

Open question: should DRM_MODE_ATOMIC_RESET require
DRM_MODE_ATOMIC_ALLOW_MODESET? A full state reset will change CRTC
active states, which is effectively a modeset. Without requiring it,
a reset could pass flag validation but fail later at atomic_check in
a confusing way.

This series is untested and relies on all drivers implementing the
atomic_create_state hook, which is not yet the case. The conversion
is actively in progress but not complete, so this will not work as-is
today. Sending it now to get early feedback on the approach.

Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
Maxime Ripard (7):
      drm/atomic: colorop: Rename state to state_to_destroy
      drm/atomic: Create function to insert CRTC state into a commit
      drm/atomic: Create function to insert plane state into a commit
      drm/atomic: Create function to insert colorop state into a commit
      drm/atomic: Create function to insert private obj state into a commit
      drm/atomic: Create function to insert connector state into a commit
      drm/atomic: Allow filling a commit with pristine object states

Sebastian Wick (1):
      drm/atomic-uapi: Add DRM_MODE_ATOMIC_RESET flag

 drivers/gpu/drm/drm_atomic.c        | 327 +++++++++++++++++++++++++++++-------
 drivers/gpu/drm/drm_atomic_helper.c |   2 +-
 drivers/gpu/drm/drm_atomic_uapi.c   |  13 ++
 include/drm/drm_atomic.h            |  19 ++-
 include/uapi/drm/drm_mode.h         |  14 +-
 5 files changed, 307 insertions(+), 68 deletions(-)
---
base-commit: cff96362794a5c1f3adb013b4a46c7233149a629
change-id: 20260708-drm-reset-state-flag-2fb2b5711f97

Best regards,
-- 
Maxime Ripard <mripard@kernel.org>


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

end of thread, other threads:[~2026-07-13  7:16 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-08 16:08 [PATCH RFC 0/8] drm: Add DRM_MODE_ATOMIC_RESET flag Maxime Ripard
2026-07-08 16:08 ` [PATCH RFC 1/8] drm/atomic: colorop: Rename state to state_to_destroy Maxime Ripard
2026-07-08 16:16   ` sashiko-bot
2026-07-08 16:08 ` [PATCH RFC 2/8] drm/atomic: Create function to insert CRTC state into a commit Maxime Ripard
2026-07-08 16:08 ` [PATCH RFC 3/8] drm/atomic: Create function to insert plane " Maxime Ripard
2026-07-08 16:08 ` [PATCH RFC 4/8] drm/atomic: Create function to insert colorop " Maxime Ripard
2026-07-08 16:08 ` [PATCH RFC 5/8] drm/atomic: Create function to insert private obj " Maxime Ripard
2026-07-08 16:08 ` [PATCH RFC 6/8] drm/atomic: Create function to insert connector " Maxime Ripard
2026-07-08 16:08 ` [PATCH RFC 7/8] drm/atomic: Allow filling a commit with pristine object states Maxime Ripard
2026-07-08 16:24   ` sashiko-bot
2026-07-08 16:08 ` [PATCH RFC 8/8] drm/atomic-uapi: Add DRM_MODE_ATOMIC_RESET flag Maxime Ripard
2026-07-08 16:26   ` sashiko-bot
2026-07-08 18:25 ` [PATCH RFC 0/8] drm: " Xaver Hugl
2026-07-10 17:01 ` Michel Dänzer
2026-07-13  7:11   ` Maxime Ripard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.