From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796383015; b=eYzeNHKAOihGxvuk/bpUZ8EaNvUKXSL9WTD831i6eghVGT9iopEuWqF9Cwk2+VoDuJla 0OWz7LY6X6aGVahDQwiNeKChwaseNn9+cd0pmqipratl/0HSIh+0/5oDh2XBiyr32jqPa 7jRJpcmB7FkLX//F//sjRxHNCwQjZig0E41/9SeV3TjsNySUhzhoyscZqELmvZ/ys7PtZ EQmYOfhN54qJGg8j0DlOuK8bSgv4l5QO3nMWYu2Zjw0Jcb/8zROzyxqpRWU7QxWcKHfj7 LumtQtwev3xVofzcaC02wE/GjFzSdFjzfFCyN4Ya+Rs66JTeGR1lNLcPZpP8eG4ahbA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796383015; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Type:Content-Transfer-Encoding; bh=13+RayB8WE+VFC6MifIFlRN461bK58rMHSaRtoIuXbE=; b=LePMCXKgDkgcd/ChWoY/hnXmXvO3UgEdwl6PCTCQztkJ7btsGmAfyAlTbj3OOkGo0rNi NTARDJiaoTdvgGKObXiYYWFhKdCqIaSsVq6k35z9tqSDOEy6mVgbKrJu0jtZjLBVIKVLD pjpGd9Uc9hWHLiLqcqcY5Sp0eBFFnahWIzRwV5kdhfREihMKnIBKZAN0EMGN0kGgxHHE1 8a3r+oKl21xavpuCXd2d2/VmLrT1RqAN0OPBL17Jn8tRZFX8YSHkykj9Xd03xOz8PhUk7 S+J+h7MkN0zOXlCcjm4YyFjvZBrMw3qDCmovn8EZQ5ZBFfAGLtARe+eIqazGI5+ixBg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=Z8Eq3MtF; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BB824606A333; Fri, 4 Dec 2026 11:16:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=Z8Eq3MtF Received: by smtp.kernel.org (Postfix) with ESMTPSA id 056591F0092C; Fri, 4 Dec 2026 11:16:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796383015; bh=13+RayB8WE+VFC6MifIFlRN461bK58rMHSaRtoIuXbE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Z8Eq3MtFdHSZvKWccDIDj2tAsFfjWkQ+zzL7097kd25nnQzjtuUo0804flJnez+bL J7ROYnUPaJvFiwCyrzq4MxRLLYo94Nr35LY62WGL63hbdYEsKxhp1XtTfXCRwUXPzC OO8fFuAtm70DgynSqIvh9gqmH6yKsZfTNEHAaVYg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, =?UTF-8?q?Jouni=20H=C3=B6gander?= , Mika Kahola , Joonas Lahtinen , Sasha Levin Subject: [PATCH 6.18 691/703] drm/i915/psr: Clear CFF state on flip flush Date: Fri, 4 Dec 2026 19:09:50 +0900 Message-ID: <20261204100646.220148794@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100627.522266145@linuxfoundation.org> References: <20261204100627.522266145@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jouni Högander [ Upstream commit 9bf9ced37e60a6c947a481385cd9ed919f14cf36 ] An ORIGIN_FLIP flush can clear the last busy frontbuffer bits without running _psr_flush_handle(), leaving the CFF state flag set. Clear CFF state when no frontbuffer bits remain busy, and queue PSR work only when inactive and not paused. Fixes: 805f04d42a6b ("drm/i915/display/psr: Use continuos full frame to handle frontbuffer invalidations") Cc: # v5.19+ Signed-off-by: Jouni Högander Reviewed-by: Mika Kahola Link: https://patch.msgid.link/20261102100051.272137-4-jouni.hogander@intel.com (cherry picked from commit 233e3453eb705c0434f6f8467f211f0250c5832b) Signed-off-by: Joonas Lahtinen [ sashal: Adapted the flush path to this tree's older layout by adding a rearm: label and moving the queue_work there, with flip and cursor branches jumping to it only when the flush touches this encoder's pipe. ] Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/i915/display/intel_psr.c | 34 +++++++++++++++++-------------- 1 file changed, 19 insertions(+), 15 deletions(-) --- a/drivers/gpu/drm/i915/display/intel_psr.c +++ b/drivers/gpu/drm/i915/display/intel_psr.c @@ -3502,12 +3502,6 @@ static void _psr_flush_handle(struct int if (DISPLAY_VER(display) < 20 && intel_dp->psr.psr2_sel_fetch_enabled) { /* Selective fetch prior LNL */ - if (intel_dp->psr.psr2_sel_fetch_cff_enabled) { - /* can we turn CFF off? */ - if (intel_dp->psr.busy_frontbuffer_bits == 0) - intel_dp->psr.psr2_sel_fetch_cff_enabled = false; - } - /* * Still keep cff bit enabled as we don't have proper SU * configuration in case update is sent for any reason after @@ -3531,9 +3525,6 @@ static void _psr_flush_handle(struct int /* Selective update LNL onwards */ intel_psr_exit(intel_dp); } - - if (!intel_dp->psr.active && !intel_dp->psr.busy_frontbuffer_bits) - queue_work(display->wq.unordered, &intel_dp->psr.work); } /** @@ -3568,18 +3559,15 @@ void intel_psr_flush(struct intel_displa INTEL_FRONTBUFFER_ALL_MASK(intel_dp->psr.pipe); intel_dp->psr.busy_frontbuffer_bits &= ~pipe_frontbuffer_bits; - /* - * If the PSR is paused by an explicit intel_psr_paused() call, - * we have to ensure that the PSR is not activated until - * intel_psr_resume() is called. - */ if (intel_dp->psr.pause_counter) - goto unlock; + goto rearm; if (origin == ORIGIN_FLIP || (origin == ORIGIN_CURSOR_UPDATE && !intel_dp->psr.psr2_sel_fetch_enabled)) { tgl_dc3co_flush_locked(intel_dp, frontbuffer_bits, origin); + if (pipe_frontbuffer_bits) + goto rearm; goto unlock; } @@ -3588,6 +3576,22 @@ void intel_psr_flush(struct intel_displa /* By definition flush = invalidate + flush */ _psr_flush_handle(intel_dp); + +rearm: + if (!intel_dp->psr.busy_frontbuffer_bits) { + if (intel_dp->psr.psr2_sel_fetch_cff_enabled) + intel_dp->psr.psr2_sel_fetch_cff_enabled = false; + + /* + * If the PSR is paused by an explicit + * intel_psr_paused() call, we have to ensure that the + * PSR is not activated until intel_psr_resume() is + * called. + */ + if (!intel_dp->psr.active && !intel_dp->psr.pause_counter) + queue_work(display->wq.unordered, &intel_dp->psr.work); + } + unlock: mutex_unlock(&intel_dp->psr.lock); }