Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp326732pxb; Mon, 16 Aug 2021 06:23:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwDGMDLdRhGuNDmPqD3yT1kheTAB0XxYMPhvW99coZjlTLuDss1axgykMufHoCnsXaYviZX X-Received: by 2002:a05:6402:3589:: with SMTP id y9mr20261809edc.247.1629120228710; Mon, 16 Aug 2021 06:23:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629120228; cv=none; d=google.com; s=arc-20160816; b=kRd3FbZEUNZeRAOslW19H2CvUUvRzRpFrEj5FbKfvkLxCNu+xpjxja7F6VHhi3k43J ckQ6eN5xOjMe6d+msxSPzuW0U1nuTYlOJiRqPy875/gVqBADIky2RWD5T/BA1kxFnwA0 v7fAs5r5nQNMOHTI+NhbN9B+aorFgkMu588uSs6M1qRjNHbtkHoQF8OwX4lMJ6PcNUZc ZWgiAoGxF5XdDWvfi76AlPbKFTmtI/BXTfoCfNzADUSEQYQYcTOPuaQGJfIlDIDE7JCq 1GZCAItLNWVgDcwPutqGeBF6cIbIe2orrbs52QexpoWUsSQ0RyyQCUn7Uu5/h7vPU0oK W8oA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Uz2OxaL8bRTxA5vboWd7UoiFqc+P9FMonmM+721hg6U=; b=viCVYhDYEF/EpKqXMzLPVqd9tKC4fZvP7pzugCFzRQIkbBYl2Fuv31mg40hxoJW0WW Uumrd4cfhIzjI92eT0ChIf0IcAgsKWiNnz+w1NTap6OogOCl2TGXAB9wX46bn33rW0he uHdJEHyLu28Hh/64D8sfH30Iv6O1kwO0oa9QdoDnNVT1pU4H+vpKIZWBlFaER5tqumPu VRbg5ovXQ26EiAPSd7iVa9fAzAVvWnhlWZ+dbW1evBghTeAGEYjQe0s4xF+Ug4jBnfpu VDZPb/gbO7TQYBdYZgxZ3FW6ApSYa5nB0+uF4BobtwPZcA8YJlRJdhvQalYFqLl/SDK0 bkZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cFt0fcfS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f4si166727edr.11.2021.08.16.06.23.25; Mon, 16 Aug 2021 06:23:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cFt0fcfS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239807AbhHPNWG (ORCPT + 99 others); Mon, 16 Aug 2021 09:22:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:37454 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237488AbhHPNNS (ORCPT ); Mon, 16 Aug 2021 09:13:18 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D4F55604DC; Mon, 16 Aug 2021 13:11:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1629119462; bh=t5M0W33Z9fidm4K+RfV5V0u9R2V/XBTaDp/9IQYqB9s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cFt0fcfSmcPHjMVMnpJxIQl4lQV8k7lyH3cfb4rhI6WufetXUQtjzvBGdYpnR8NFd mM0OjF9xrEkAyqJTqCw7PI7wN9hUJeh5Y5F7yWs/xpAao4FcrAuSjWL4ha4pJ9OzoD CmHJJf5A+UwDnXVr0zyuAo4TBSM2lAq0FPQ1Gfvo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Solomon Chiu , Alex Deucher Subject: [PATCH 5.13 036/151] drm/amdgpu: Add preferred mode in modeset when freesync video modes enabled. Date: Mon, 16 Aug 2021 15:01:06 +0200 Message-Id: <20210816125445.276522814@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210816125444.082226187@linuxfoundation.org> References: <20210816125444.082226187@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Solomon Chiu commit 46dd2965bdd1c5a4f6499c73ff32e636fa8f9769 upstream. [Why] With kernel module parameter "freesync_video" is enabled, if the mode is changed to preferred mode(the mode with highest rate), then Freesync fails because the preferred mode is treated as one of freesync video mode, and then be configurated as freesync video mode(fixed refresh rate). [How] Skip freesync fixed rate configurating when modeset to preferred mode. Signed-off-by: Solomon Chiu Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -9410,7 +9410,12 @@ static int dm_update_crtc_state(struct a } else if (amdgpu_freesync_vid_mode && aconnector && is_freesync_video_mode(&new_crtc_state->mode, aconnector)) { - set_freesync_fixed_config(dm_new_crtc_state); + struct drm_display_mode *high_mode; + + high_mode = get_highest_refresh_rate_mode(aconnector, false); + if (!drm_mode_equal(&new_crtc_state->mode, high_mode)) { + set_freesync_fixed_config(dm_new_crtc_state); + } } ret = dm_atomic_get_state(state, &dm_state);