Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp485628pxj; Thu, 20 May 2021 14:09:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMiOpN+rD+imNqyL+J8UxphFF3n8UFj3H4+0ZDDCzq5ELlZtoFGJaKF6ia63/DL5cHOGP4 X-Received: by 2002:a05:6638:2181:: with SMTP id s1mr8868178jaj.66.1621544942007; Thu, 20 May 2021 14:09:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621544942; cv=none; d=google.com; s=arc-20160816; b=sFRD+4UF3VHNwq/WrOx0DzHiYy6AqG08BT0EXk6SALoXRoXGJHnG+J+3rSq7HS3n3f K5W0QJhER2i6L2mnAIlF7SGyGP5kl6WTgD6329a++50uzG9lDSxycOBUN+poAfVb1qtJ 6Vg5jg0YpWQ/SazTHHqXGM9LwXhVYyjY9ld20pT9Yhw9fkpbUJBD0Fn0S0Is6Tfe53I6 hY0vZM3rlZxehxaPkbYG6hIH3QwFjI+CclMrxnNM2iN9ZwBO5b4P/J1zk3E6Qs0TvnD/ 6/PDWFNuho+gEzUezI9kLGsoESvnTrOdSHgB/3opQdRgLD2Nnqyo8epSj0SA95ebK8Bn ZSpQ== 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=y8GzkG6ZTuIPsJw1M3XZwe+e4w/BwNKRIklvkAu4ZNQ=; b=Tb8L/g+A4oCyh0GqKEL5szYQXcbfVMk2AH+M6Dm3jIXi80nh+5X3Ud81Il3lKHJ7h7 r5GtvQBpCvwI+X6YEhkZMlYraaiRvrZHAK8M1MbkG2oVJnyt0tJj1Ac7HxQv1GFRzoAn T053tzl6ZfKBMdgk2xuVXA0ubTr7keBJ0nihl2Rz4wc5csk4e1uTR7AO1mrx+vycGnkj NNRA16/QBB+UOMQDhUwhOs+Y2uDpQ7ypWKz7RQDtOAeRczER11wJ++BXN48XXdt8Xkpj sHOAgJdMBt4K3nCNCn5GL5ht5bX8mAKSAwGqjZfTjDERD3LRFxuyGTNe2JAn2woCzp7N MjZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=H7vNYBZj; 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 x17si3558475jan.4.2021.05.20.14.08.49; Thu, 20 May 2021 14:09:01 -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=H7vNYBZj; 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 S236460AbhETLA3 (ORCPT + 99 others); Thu, 20 May 2021 07:00:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:43962 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237713AbhETKmr (ORCPT ); Thu, 20 May 2021 06:42:47 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 30EEF613B4; Thu, 20 May 2021 09:56:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621504591; bh=siMQh9KxEYosgc3IrSH7ZlT7+7Fs4cFDA0EMOw0FvLw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H7vNYBZjSSJO3I2db4bTGtEi2SI0I9bm6TNlB52mlDHJzF+Ifvg18lVCiD6jOHmLN snKMAXV/jNChZt9/9mx2jS/zgV98DFEs7j4jFIrMghoJeG6E3qW+yxQQsF+U1MKgNF Scf/XWqwiF4CNc3ln3RLfBBzjJzzYWwROWNXBAzg= 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 4.14 281/323] drm/radeon/dpm: Disable sclk switching on Oland when two 4K 60Hz monitors are connected Date: Thu, 20 May 2021 11:22:53 +0200 Message-Id: <20210520092129.847183736@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092120.115153432@linuxfoundation.org> References: <20210520092120.115153432@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 @@ -1562,6 +1562,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 @@ -1715,6 +1715,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; @@ -1724,6 +1725,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) { @@ -1731,6 +1733,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 @@ -3000,6 +3000,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) {