[PATCH] drm/atomic: Filter out redundant DPMS calls
Ville Syrjälä
ville.syrjala at linux.intel.com
Wed Feb 19 19:10:42 UTC 2025
On Wed, Feb 19, 2025 at 12:06:20PM -0500, Hamza Mahfooz wrote:
> On Wed, Feb 19, 2025 at 06:02:39PM +0200, Ville Syrjala wrote:
> > From: Ville Syrjälä <ville.syrjala at linux.intel.com>
> >
> > Video players (eg. mpv) do periodic XResetScreenSaver() calls to
> > keep the screen on while the video playing. The modesetting ddx
> > plumbs these straight through into the kernel as DPMS setproperty
> > ioctls, without any filtering whatsoever. When implemented via
> > atomic these end up as full commits on the crtc, which leads to a
> > dropped frame every time XResetScreenSaver() is called.
> >
> > Let's just filter out redundant DPMS property changes in the
> > kernel to avoid this issue.
>
> Do you know if this has any impact on the DPMS timeout (as set by
> DPMSSetTimeouts())?
That's all in userspace.
>
> >
> > Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> > ---
> > drivers/gpu/drm/drm_atomic_uapi.c | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c
> > index 2765ba90ad8f..c2726af6698e 100644
> > --- a/drivers/gpu/drm/drm_atomic_uapi.c
> > +++ b/drivers/gpu/drm/drm_atomic_uapi.c
> > @@ -957,6 +957,10 @@ int drm_atomic_connector_commit_dpms(struct drm_atomic_state *state,
> >
> > if (mode != DRM_MODE_DPMS_ON)
> > mode = DRM_MODE_DPMS_OFF;
> > +
> > + if (connector->dpms == mode)
> > + goto out;
> > +
> > connector->dpms = mode;
> >
> > crtc = connector->state->crtc;
> > --
> > 2.45.3
--
Ville Syrjälä
Intel
More information about the Intel-gfx
mailing list