Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3133763pxj; Mon, 17 May 2021 18:40:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzk+Km8zyj01sfon0my6UxJgOIRA7jlWfnAcB9vMvy2TOH6DXL0W1aK3sbBX+Uk+SA84/+Y X-Received: by 2002:a5e:dc49:: with SMTP id s9mr2355265iop.202.1621302031032; Mon, 17 May 2021 18:40:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621302031; cv=none; d=google.com; s=arc-20160816; b=Ssg9ykpx+QehuMjvk2uLEbEIDH1CLuo7zk33MHLzalL0KaBCx+ZXzREuUSj+5zj1am nnyK+SwG59VUHGGxFIo/nEpdMsa1QFChtTurpbsFAKkzhuBELIaFHAX+dGaIdNRP4fbd Asc2wqkNAWri8c5dNwZJQEKdz2a6IvCTdT7eRecDikuSs5NHi1uDUdhAX6PWsEPViv4t klDRXq0+U5oV4y2NEMZI2ASQO9bMvPYE+xW4mdXSNexzouKXYBl3PFO4VbqYbF5aXaA1 62I4P64qGZCzzJ8gRR8EougEJ8W9P7ZMqU0u4oO4zeTpwZfvSgp+IY1ILvi0GhV8fpBy eZ8w== 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=xSa2gS4yHhaUr5+EsZ370z+nef7GtFk+rlGduAgxLpU=; b=fU5+DAw5s8fcA2xcJe+/EwIaCTVv3T7XYagUfumUQdm3lYhqR2wEztxSqH5TWf4PLP Q+VtoeZZ7YASsPeHK2H8UwokmfQQg/lZ1YNF+EFGw9h0seY8F4Kzcx9HIl/ckth+8Yr+ kafMp/V+cCckx0CT6IrEijUOKR4KLE7AQSMrz62ghBzFJYnMAfOQ3j3Kx+43UUN5kfiG LzK1QNm78WeRJ1KBRqxGtk4X/9OKsS+ypSuTG9WW9Q1vW1P+/kGtfW0gabidPfc8d1jP W/jFt5hgQKyr99zRgMeJb+o5magfjRWVzbQhHjXojizK338R/NEpevVKy8FkzUV2v70d HISg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cIYdudiq; 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 n2si18130143ilm.161.2021.05.17.18.40.17; Mon, 17 May 2021 18:40:31 -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=cIYdudiq; 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 S237711AbhEQOfm (ORCPT + 99 others); Mon, 17 May 2021 10:35:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:43250 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240157AbhEQObk (ORCPT ); Mon, 17 May 2021 10:31:40 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7801C6124C; Mon, 17 May 2021 14:15:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621260930; bh=KAg4y/Fb+2hnMeU+v2AxdQOk3YlzDNkTf31yqhiVJ8k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cIYdudiqXRY9tT04nel9FsowKiUoSraZMhuXZRDrykNbcHJ+SXMiwsZMvf3e1NqrK 6XA/pIJk/mGN46UiBrU0SRQ7EUYXhGOp6d4HiTHd8pK0CcAVpXcLx2DDaLR31TUYga moOMIPn07EFFiPAF6FcDVTwrwyI9IwELJ8YVNmLQ= 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.12 269/363] drm/radeon/dpm: Disable sclk switching on Oland when two 4K 60Hz monitors are connected Date: Mon, 17 May 2021 16:02:15 +0200 Message-Id: <20210517140311.705150656@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140302.508966430@linuxfoundation.org> References: <20210517140302.508966430@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 @@ -1558,6 +1558,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 @@ -1775,6 +1775,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; @@ -1784,6 +1785,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) { @@ -1791,6 +1793,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 @@ -2979,6 +2979,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) {