From mboxrd@z Thu Jan 1 00:00:00 1970 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 03A24C636CC for ; Tue, 31 Jan 2023 15:00:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 882EC10E364; Tue, 31 Jan 2023 15:00:27 +0000 (UTC) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7A60910E366; Tue, 31 Jan 2023 15:00:25 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id DFEA861557; Tue, 31 Jan 2023 15:00:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AA279C433EF; Tue, 31 Jan 2023 15:00:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1675177223; bh=oCVM42IRNyag+dX2TI9jas4V2944v2wF4/babOP+wLw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b3NXkvUlOp1xRpOl8ddZijHUODPbclF0QgPURKg77dPAjzd5+9HoV21oUupyL8Iuv +UGbT+OMsKuWx5G5OlPUAnIp8O+FFizkPGzVIX3Wtas66JYFKwPM2yD2s8rWIucNJc 0Gk6Ikv6ARivYjBE/7p9zRtNmF1kTPWFKESDa7opNOjlh513WfMzg1zJ65eWAli2UB veaYRR3FqgajBaUoRyjEkUuc2ZoY4uJ2bW0MXtRKSPmlKrMVAvzuRd7PsyzCKMI50s 85c+vNST/6H6VF+GR5zJHVHc/jb3H5LzxRiKuZTP9H4OY0WtV8pN90wl3TYvRe9gto zLYBTwS30YcuA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH AUTOSEL 6.1 18/20] drm/amd/display: Fix timing not changning when freesync video is enabled Date: Tue, 31 Jan 2023 09:59:44 -0500 Message-Id: <20230131145946.1249850-18-sashal@kernel.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230131145946.1249850-1-sashal@kernel.org> References: <20230131145946.1249850-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alan Liu , Sasha Levin , stylon.wang@amd.com, sunpeng.li@amd.com, airlied@gmail.com, Xinhui.Pan@amd.com, Rodrigo.Siqueira@amd.com, roman.li@amd.com, amd-gfx@lists.freedesktop.org, christian.koenig@amd.com, Daniel Wheeler , Aurabindo Pillai , dri-devel@lists.freedesktop.org, daniel@ffwll.ch, Jerry.Zuo@amd.com, Alex Deucher , harry.wentland@amd.com, Nicholas Kazlauskas Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" From: Aurabindo Pillai [ Upstream commit 4b069553246f993c4221e382d0d0ae34f5ba730e ] [Why&How] Switching between certain modes that are freesync video modes and those are not freesync video modes result in timing not changing as seen by the monitor due to incorrect timing being driven. The issue is fixed by ensuring that when a non freesync video mode is set, we reset the freesync status on the crtc. Reviewed-by: Nicholas Kazlauskas Acked-by: Alan Liu Signed-off-by: Aurabindo Pillai Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index e10f1f15c9c4..15b408e3a705 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -8788,6 +8788,13 @@ static int dm_update_crtc_state(struct amdgpu_display_manager *dm, if (!dm_old_crtc_state->stream) goto skip_modeset; + /* Unset freesync video if it was active before */ + if (dm_old_crtc_state->freesync_config.state == VRR_STATE_ACTIVE_FIXED) { + dm_new_crtc_state->freesync_config.state = VRR_STATE_INACTIVE; + dm_new_crtc_state->freesync_config.fixed_refresh_in_uhz = 0; + } + + /* Now check if we should set freesync video mode */ if (amdgpu_freesync_vid_mode && dm_new_crtc_state->stream && is_timing_unchanged_for_freesync(new_crtc_state, old_crtc_state)) { -- 2.39.0