Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp571872pxj; Tue, 18 May 2021 09:28:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz5dKChis4YIaVnHfsk36kOisWnslDYmbTJ54NOq2J9cXSUL3VaZilf4dOMeTkA6SMyeQ2+ X-Received: by 2002:a50:cc0c:: with SMTP id m12mr8028765edi.141.1621355329052; Tue, 18 May 2021 09:28:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621355329; cv=none; d=google.com; s=arc-20160816; b=zwyPLzjly4TMRjno3ofj5gPMR2om1EYcVhVmKDG8YeWwNv+Syw09aRy1MK3HqGZNT/ wNS58I74zGLHJXnxJCVZnN2sAPHE68ON1l3dgr1g400wCkTtXdTPonm4xAlcXPLqhE9V XgCDF5S5l/4cdTpaYpUh9rOOv/1OIRVxD5RdG06b2TEIXMYmObJsGYsTHHIE72Zs/gmA TU4qPRieXIZvi6IFO+U4aiEaoTmF2o498vOHaB+6irt/RaTPE719hZ7wx2V18DwFz4+k Fy3mSjGQVCasppw4H/uaZGiOQPETv1lqAaw/9KEIL3Af0qGnOUMOMaPVq/XtqJwr06bt TeAA== 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=sqqfi+CeXTfib/Mg2ZnA3/aDDWRlHNKm2zV8EJwyuuE=; b=EaJgcKJBCeomLNpIht7muXArmesyg3nk0JHL9/5pcxBMkPcyeqW4l504uvA53fzc5R 6CUOGbhqztWKBIkBtwuqjVnpBflPx//YFVnC3SW5TuvgbbSkRg82p0dyerDt19E/oaxU wYmSOpYwr41mi4OLlszNXfr67APzWCmMr+OHO5MRRKLabeeyAqC6GljwS3zCeixRgW3p 6ftOlvKTVcE/qJlTY6ep6uhE8E4G4jv5Wvf+rNGoc1mTfGSfvFTFgSIkJ1HFOh1NYMdP bu76hC5i4kmoL6wOrD9HDd3KE4a7Ue55+OyubJvWh+6iVSfTKbiO3/4uDGAb1P+C1t4o tqag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FruGgeme; 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 c16si829501edw.162.2021.05.18.09.28.25; Tue, 18 May 2021 09:28:49 -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=FruGgeme; 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 S238694AbhEQQCb (ORCPT + 99 others); Mon, 17 May 2021 12:02:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:51450 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245447AbhEQPll (ORCPT ); Mon, 17 May 2021 11:41:41 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 652D261942; Mon, 17 May 2021 14:42:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621262531; bh=72K3lhGXCDwiFZ+MFFJn9q3H4xG5EiJWGeQbmCGojNg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FruGgemeGd+F1ISfmkCWGTTyMhTKNqqpSugb4qzq0Hp0LKxT7iAJeUjsHgGn9k9jq +/El1bwzYdAmwL26qXzvfm9rqdQMUYXJrQR2p+7I6MybPO0i5pxgoQZPOVkF686aDQ IKWnwEyDmnhXtZ7AOJQmxrtiQgM/jTV9ZIceqkJk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kai-Heng Feng , Alex Deucher Subject: [PATCH 5.10 208/289] drm/radeon/dpm: Disable sclk switching on Oland when two 4K 60Hz monitors are connected Date: Mon, 17 May 2021 16:02:13 +0200 Message-Id: <20210517140312.119995984@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140305.140529752@linuxfoundation.org> References: <20210517140305.140529752@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: Kai-Heng Feng commit 227545b9a08c68778ddd89428f99c351fc9315ac upstream. Screen flickers rapidly when two 4K 60Hz monitors are in use. This issue doesn't happen when one monitor is 4K 60Hz (pixelclock 594MHz) and another one is 4K 30Hz (pixelclock 297MHz). The issue is gone after setting "power_dpm_force_performance_level" to "high". Following the indication, we found that the issue occurs when sclk is too low. So resolve the issue by disabling sclk switching when there are two monitors requires high pixelclock (> 297MHz). v2: - Only apply the fix to Oland. Signed-off-by: Kai-Heng Feng Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/radeon/radeon.h | 1 + drivers/gpu/drm/radeon/radeon_pm.c | 8 ++++++++ drivers/gpu/drm/radeon/si_dpm.c | 3 +++ 3 files changed, 12 insertions(+) --- a/drivers/gpu/drm/radeon/radeon.h +++ b/drivers/gpu/drm/radeon/radeon.h @@ -1559,6 +1559,7 @@ struct radeon_dpm { void *priv; u32 new_active_crtcs; int new_active_crtc_count; + int high_pixelclock_count; u32 current_active_crtcs; int current_active_crtc_count; bool single_display; --- a/drivers/gpu/drm/radeon/radeon_pm.c +++ b/drivers/gpu/drm/radeon/radeon_pm.c @@ -1747,6 +1747,7 @@ static void radeon_pm_compute_clocks_dpm struct drm_device *ddev = rdev->ddev; struct drm_crtc *crtc; struct radeon_crtc *radeon_crtc; + struct radeon_connector *radeon_connector; if (!rdev->pm.dpm_enabled) return; @@ -1756,6 +1757,7 @@ static void radeon_pm_compute_clocks_dpm /* update active crtc counts */ rdev->pm.dpm.new_active_crtcs = 0; rdev->pm.dpm.new_active_crtc_count = 0; + rdev->pm.dpm.high_pixelclock_count = 0; if (rdev->num_crtc && rdev->mode_info.mode_config_initialized) { list_for_each_entry(crtc, &ddev->mode_config.crtc_list, head) { @@ -1763,6 +1765,12 @@ static void radeon_pm_compute_clocks_dpm if (crtc->enabled) { rdev->pm.dpm.new_active_crtcs |= (1 << radeon_crtc->crtc_id); rdev->pm.dpm.new_active_crtc_count++; + if (!radeon_crtc->connector) + continue; + + radeon_connector = to_radeon_connector(radeon_crtc->connector); + if (radeon_connector->pixelclock_for_modeset > 297000) + rdev->pm.dpm.high_pixelclock_count++; } } } --- a/drivers/gpu/drm/radeon/si_dpm.c +++ b/drivers/gpu/drm/radeon/si_dpm.c @@ -2982,6 +2982,9 @@ static void si_apply_state_adjust_rules( (rdev->pdev->device == 0x6605)) { max_sclk = 75000; } + + if (rdev->pm.dpm.high_pixelclock_count > 1) + disable_sclk_switching = true; } if (rps->vce_active) {