From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 60D7C1DF269; Wed, 19 Mar 2025 14:41:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742395271; cv=none; b=XDoTGrF7oyS4bEUksB2knpBJxok/RjGWlGLWUPjpp3931SGDdYGqq0oJUJlOT8cFSjnxqGeaDoGuybexzBBFZ19SSBW3B173BGOpLhWPiw5xJLzBKvYmY529Lrwrd6lIhFZ1MBPVZzvYTPxyBONiAl5L3Nt/uFRcgov/lc5K+Ig= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742395271; c=relaxed/simple; bh=6QuCcMRv6w3pcgzB74/TEi8TDgothy7lOTa8U/hwnaQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=kAt3v8zXxCm+DL43YOqEzGFvf/qpZxFXdmUn2UrEwCZhMNX9LVLrpNCUOe1/lAH981llHO2WTcnifJymoo1GMvBw5BcSgU/k51vOv9892c1tXL02kBPDcZioX5glAdX3HY/g8FIE4dIkfnzqMs22/GfoHOTOGq3c2Ulfw/af4iY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=QZz4ImXr; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="QZz4ImXr" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3694CC4CEE4; Wed, 19 Mar 2025 14:41:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1742395271; bh=6QuCcMRv6w3pcgzB74/TEi8TDgothy7lOTa8U/hwnaQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QZz4ImXrmJJraVf73H2h7AaxOnSBnq9qRwp7LWLmOtLMXy82vminot7qevYuuenHz NGcp57oZ3R8hNLUdhhL0MYOIzu2dYVvf/j+y0immHZxA5QLbm8RnkPRrknq1aingrv jJ+C/RgiV+VXNwqVmfdXcFFFveDg2Xni8dtAdx1o= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Simona Vetter , =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= Subject: [PATCH 6.6 121/166] drm/atomic: Filter out redundant DPMS calls Date: Wed, 19 Mar 2025 07:31:32 -0700 Message-ID: <20250319143023.293639145@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250319143019.983527953@linuxfoundation.org> References: <20250319143019.983527953@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ville Syrjälä commit de93ddf88088f7624b589d0ff3af9effb87e8f3b upstream. 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 empty commits on the crtc (which will nonetheless take one full frame), 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. v2: Explain the resulting commits a bit better (Sima) Document the behaviour in uapi docs (Sima) Cc: stable@vger.kernel.org Testcase: igt/kms_flip/flip-vs-dpms-on-nop Reviewed-by: Simona Vetter Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20250219160239.17502-1-ville.syrjala@linux.intel.com Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/drm_atomic_uapi.c | 4 ++++ drivers/gpu/drm/drm_connector.c | 4 ++++ 2 files changed, 8 insertions(+) --- a/drivers/gpu/drm/drm_atomic_uapi.c +++ b/drivers/gpu/drm/drm_atomic_uapi.c @@ -974,6 +974,10 @@ int drm_atomic_connector_commit_dpms(str if (mode != DRM_MODE_DPMS_ON) mode = DRM_MODE_DPMS_OFF; + + if (connector->dpms == mode) + goto out; + connector->dpms = mode; crtc = connector->state->crtc; --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -1162,6 +1162,10 @@ static const u32 dp_colorspaces = * callback. For atomic drivers the remapping to the "ACTIVE" property is * implemented in the DRM core. * + * On atomic drivers any DPMS setproperty ioctl where the value does not + * change is completely skipped, otherwise a full atomic commit will occur. + * On legacy drivers the exact behavior is driver specific. + * * Note that this property cannot be set through the MODE_ATOMIC ioctl, * userspace must use "ACTIVE" on the CRTC instead. *