Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 15AB0C83F1A for ; Fri, 11 Jul 2025 09:09:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AAFA910E9EB; Fri, 11 Jul 2025 09:09:21 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="ZgUPcpcR"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1888010E9EA; Fri, 11 Jul 2025 09:09:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1752224960; x=1783760960; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=MB+SW1yh5ERBLZVApnig/mPSaea7by+CBNh2xevUTkM=; b=ZgUPcpcRG4w03J7kQV15r33GDZLmqMNgQ3AWVUbf1+6uTUthgS/OFm/a 3/9Iv1iIAXgB+z15GeTLOOwmz9yiJJNCzobXjDmtNcQJ6ZAR4F4ChapBd 9kcXKj7CaNrqw4qA/yUuI2k3QLAOWKkIh6YgnItoEOS1Op/WWr45EK9Cf ElGqfFLRln77OJWFCZ0mkF5Mrty+6KMJJse7v9l6mlzCGRUfXoR0bijCh 0WR1fadKuT+C5aC0qOlBtu3Dx8XyZZhH6Sz8cQW9gArFZeVdgEvYju1kZ q+5QYstgas0lVQ2af3ATeDgt8NyZIOEvgQ33Kqccrku/Co8FLbV3u1wDB w==; X-CSE-ConnectionGUID: liZprmXMSNCqFNB8d92z+Q== X-CSE-MsgGUID: GLgDXPI8SqisQVzFRVOcuw== X-IronPort-AV: E=McAfee;i="6800,10657,11490"; a="53627676" X-IronPort-AV: E=Sophos;i="6.16,303,1744095600"; d="scan'208";a="53627676" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jul 2025 02:09:20 -0700 X-CSE-ConnectionGUID: XghStvwkS1Cgapvia7wWHA== X-CSE-MsgGUID: GI970aX3R6WBRnDY7r95Fw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.16,303,1744095600"; d="scan'208";a="160655336" Received: from abityuts-desk.ger.corp.intel.com (HELO jhogande-mobl1..) ([10.245.245.32]) by ORVIESA003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jul 2025 02:09:18 -0700 From: =?UTF-8?q?Jouni=20H=C3=B6gander?= To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Cc: =?UTF-8?q?Jouni=20H=C3=B6gander?= Subject: [PATCH v4 6/6] drm/i915/display: Wait for vblank in case of PSR is using trans push Date: Fri, 11 Jul 2025 12:08:58 +0300 Message-ID: <20250711090858.3297380-7-jouni.hogander@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250711090858.3297380-1-jouni.hogander@intel.com> References: <20250711090858.3297380-1-jouni.hogander@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Content-Transfer-Encoding: 8bit X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" In case PSR uses trans push as a "frame change" event and we need to wait vblank after triggering PSR "frame change" event. Othervise we may miss selective updates. DSB skips all waits while PSR is active. Check push send is skipped as well because trans push send bit is not clearn by the HW if VRR is not enabled -> we may start configuring new selective update while previous is not complete. Avoid this by waiting for vblank after sending trans push. Signed-off-by: Jouni Högander --- drivers/gpu/drm/i915/display/intel_display.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 456fc4b04cda..ebbead447eca 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -7294,9 +7294,27 @@ static void intel_atomic_dsb_finish(struct intel_atomic_state *state, new_crtc_state->dsb_color); if (new_crtc_state->use_dsb && !intel_color_uses_chained_dsb(new_crtc_state)) { - intel_dsb_wait_vblanks(new_crtc_state->dsb_commit, 1); + /* + * Dsb wait vblank may or may not skip. Let's remove it for PSR + * trans push case to ensure we are not waiting two vblanks + */ + if (!intel_psr_use_trans_push(new_crtc_state)) + intel_dsb_wait_vblanks(new_crtc_state->dsb_commit, 1); intel_vrr_send_push(new_crtc_state->dsb_commit, new_crtc_state); + + /* + * In case PSR uses trans push as a "frame change" event and + * VRR is not in use we need to wait vblank. Othervise we may + * miss selective updates. DSB skips all waits while PSR is + * active. Check push send is skipped as well because trans push + * send bit is not clearn by the HW if VRR is not enabled -> we + * may start configuring new selective update while previous is + * not complete. + */ + if (intel_psr_use_trans_push(new_crtc_state)) + intel_dsb_wait_vblanks(new_crtc_state->dsb_commit, 1); + intel_dsb_wait_vblank_delay(state, new_crtc_state->dsb_commit); intel_vrr_check_push_sent(new_crtc_state->dsb_commit, new_crtc_state); -- 2.43.0