From: Mark Kettenis Subject: Re: apldrm: switch to drm_atomic_helper_commit_tail_rpm() To: Tobias Heider Cc: tech@openbsd.org, kettenis@openbsd.org, jsg@openbsd.org Date: Tue, 25 Aug 2026 15:50:37 +0200 > Date: Tue, 25 Aug 2026 13:29:03 +0200 > From: Tobias Heider > > Hi, > > I was investigating high latency for the display on my m2 macbook air > and traced it back to drm_atomic_helper_wait_for_flip_done() in our > custom dcp_atomic_commit_tail(). > > Looking closer at the asahi tree it turns out they switched back to > the generic drm_atomic_helper_commit_tail_rpm() in > https://github.com/AsahiLinux/linux/commit/bd8ce96f6e76b98940352b18fe735a7943471ed7 > > I propose we do the same. With this the graphical interface feels noticably > snappier. > > ok? ok kettenis@ > diff /usr/src > path + /usr/src > commit - c9c6a4136a24cbff385a3cfe930ee8cf183d41a5 > blob - ffe2d92a4994103f8db5afe7bcd395ea70067d2b > file + sys/dev/pci/drm/apple/apple_drv.c > --- sys/dev/pci/drm/apple/apple_drv.c > +++ sys/dev/pci/drm/apple/apple_drv.c > @@ -237,26 +237,6 @@ static void apple_crtc_atomic_begin(struct drm_crtc *c > } > } > > -static void dcp_atomic_commit_tail(struct drm_atomic_state *old_state) > -{ > - struct drm_device *dev = old_state->dev; > - > - drm_atomic_helper_commit_modeset_disables(dev, old_state); > - > - drm_atomic_helper_commit_modeset_enables(dev, old_state); > - > - drm_atomic_helper_commit_planes(dev, old_state, > - DRM_PLANE_COMMIT_ACTIVE_ONLY); > - > - drm_atomic_helper_fake_vblank(old_state); > - > - drm_atomic_helper_commit_hw_done(old_state); > - > - drm_atomic_helper_wait_for_flip_done(dev, old_state); > - > - drm_atomic_helper_cleanup_planes(dev, old_state); > -} > - > static void apple_crtc_cleanup(struct drm_crtc *crtc) > { > drm_crtc_cleanup(crtc); > @@ -279,7 +259,7 @@ static const struct drm_mode_config_funcs apple_mode_c > }; > > static const struct drm_mode_config_helper_funcs apple_mode_config_helpers = { > - .atomic_commit_tail = dcp_atomic_commit_tail, > + .atomic_commit_tail = drm_atomic_helper_commit_tail_rpm, > }; > > static void appledrm_connector_cleanup(struct drm_connector *connector) > >