From patchwork Mon Dec 28 12:40:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 352710 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp9826014jai; Mon, 28 Dec 2020 07:22:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJzHjUg9JAlFmFaTpv1bDVuL4n6RVi5rCTpP9h6b4VhEM533xV+HQPgcMC4B0q84rTxcOSe0 X-Received: by 2002:a05:6402:c83:: with SMTP id cm3mr42461602edb.189.1609168942132; Mon, 28 Dec 2020 07:22:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609168942; cv=none; d=google.com; s=arc-20160816; b=DU7P0iFPig9uOqg/2QU26dRE/ICqzbhSYyMsC+Hxd1PP83ua5rf5kM7D3xZf/aveU4 wrYsl5YiYKUFjKDG8Lxc51Cie58K2wR7j6ZVQnapFTNFKnxNeHARWCE37TQZCgrce52S F3MeJCvn8kdmji7Uk9nMK6jB6J7DZhfpSXBM054gf7qoK/z/QOqNfv2mRb0fHD1QaygH OUsOnCPPTyivwitZtntKXZql6o7qNASqeW2ahRID9+wxkCO68KNXBtN38Gp/iPEIa1qV FDrmHgxVYwEH1Pc3j7AqIIeXGm2IvtZ9Vt7lDvYXBJgjE8dr0gcw/e9PppnAnwJtyU1W TW1Q== 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=zIz3rZOxiEmXjwSUj7wNPj07bjHcevurhJxp2NQXRGE=; b=PlnS2nLpkdeBPZzs9JTHHbctIOEozsDFRRUNaFFmszMIhScgR25rbKJmIvaYzq6Nyf OttJMlXBo95qKBic/Dgy83iNEwWi9FK+tHxoRlY0bWJ9p53PsNGwKCrTKBtH+NU8+Lp1 hGU9j+G9bmfOF3ALwVVEibMAjGnMEAeX+xkeTNLG+cFA+ZSUrLMbVDKu8mHdWaAjm6AA /JDraxAjfQaFmQYyTfBNLCyD0o1jvT+g22Hxtkba2cE+zP7BNFufv7yUROAd41ACA/0A RcgHoP8H6vmHpgtCNP71Gx+c8sxHSD0hGv36VkMiDdOJrM+3QDsGqoQLAqnG9YKZ49a/ G5fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RpuSyaYm; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 gy15si18300609ejb.752.2020.12.28.07.22.21; Mon, 28 Dec 2020 07:22:22 -0800 (PST) Received-SPF: pass (google.com: domain of stable-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=RpuSyaYm; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 S2436977AbgL1OCt (ORCPT + 14 others); Mon, 28 Dec 2020 09:02:49 -0500 Received: from mail.kernel.org ([198.145.29.99]:36296 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2436986AbgL1OCr (ORCPT ); Mon, 28 Dec 2020 09:02:47 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id A6F0A205CB; Mon, 28 Dec 2020 14:02:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164152; bh=XR9cIeqq/RFKUEc4fpvdJ82X3kRBbJhJ1vrZ4LhHatc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RpuSyaYmJdR4Pj7w+XuRnMFmLyZQed+kQt4XIlAZvN+zy8YYpFmY1CYIxbJyhDwl0 NY9DIXlboj8PPDNjoajQWlZ/QR8grutTUpHERti6Xk0OtSFXW2Pv9GGRK9w22qlT3q CiuQs28H0iBXbPJeMvjgoxUACqkyILe3dANOAjfg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dmitry Baryshkov , Abhinav Kumar , Rob Clark , Sasha Levin Subject: [PATCH 5.10 049/717] drm/msm/dpu: fix clock scaling on non-sc7180 board Date: Mon, 28 Dec 2020 13:40:47 +0100 Message-Id: <20201228125023.340705799@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Dmitry Baryshkov [ Upstream commit cccdeda362fafd0613b571affe7199eb7d8f3fba ] c33b7c0389e1 ("drm/msm/dpu: add support for clk and bw scaling for display") has added support for handling bandwidth voting in kms path in addition to old mdss path. However this broke all other platforms since _dpu_core_perf_crtc_update_bus() will now error out instead of properly calculating bandwidth and core clocks. Fix _dpu_core_perf_crtc_update_bus() to just skip bandwidth setting instead of returning an error in case kms->num_paths == 0 (MDSS is used for bandwidth management). Signed-off-by: Dmitry Baryshkov Fixes: c33b7c0389e1 ("drm/msm/dpu: add support for clk and bw scaling for display") Reviewed-by: Abhinav Kumar Signed-off-by: Rob Clark Signed-off-by: Sasha Levin --- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.27.0 diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c index 393858ef8a832..37c8270681c23 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c @@ -219,9 +219,6 @@ static int _dpu_core_perf_crtc_update_bus(struct dpu_kms *kms, int i, ret = 0; u64 avg_bw; - if (!kms->num_paths) - return -EINVAL; - drm_for_each_crtc(tmp_crtc, crtc->dev) { if (tmp_crtc->enabled && curr_client_type == @@ -239,6 +236,9 @@ static int _dpu_core_perf_crtc_update_bus(struct dpu_kms *kms, } } + if (!kms->num_paths) + return 0; + avg_bw = perf.bw_ctl; do_div(avg_bw, (kms->num_paths * 1000)); /*Bps_to_icc*/