Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9132106pxu; Mon, 28 Dec 2020 07:24:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJyMKqqzE2BiiHYJ+cnX/LjutjPNuTUARqJ3xzygfxOGR34TkPxLSvZ/X2kDFb0i9ztzuLjw X-Received: by 2002:a17:906:b082:: with SMTP id x2mr38946558ejy.100.1609169091523; Mon, 28 Dec 2020 07:24:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609169091; cv=none; d=google.com; s=arc-20160816; b=lN3FlMVQw0ZsAQRzrCbbE/s+5jMRKvmnbjhaZE1XnqWvHawj8RIB8R+N7E0L3KgNck RcsRol4ayWBRLI7OQQVLuSLO/SwrODv/xyYSz2qWPcIj4Yt0zkC3wWqMDtuJrGpn8SDR pDEUCerG0o152421VWDFaTc907hdU1kWxCS1RwFCBH6d6YGiqzThgdOx1gJqgrlnUULl hjiYy57wpqCkx4k0FEzoLh9KSjeTVSW9YsCdov6hDK0VRU51DLVPpaYsqSg37UUKESS4 52/+WpDuZ5dO/u9TZrRsgMesZ4xXYqwfOXHaCLhw+lMCPIrMb+bhhP5omoAKHnf+b8jI jXJw== 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=Pc1j9/WqcHf4NZDj/0XEKN1ZIdL4u29Wb8LGE2+2Xr0m4yGwSAOVtuyoeX/z+DzsxB 3xch36nE0eYH7dv4EzYUXRcLHtdxValdpP8umY7ywvL/PkCAO86MT4jeBq1vAUQBuAVh VoIv/xAF6b3tarKIApaYVdaPiOXzFrv1qWFQBJLHM7Dkgq0zuPj8n6gtulh3jd3LIHTk ejwMxcZ6DNJjwSkKL0T0BhZkMrAJGISDQJIa/b/NfbJ3m+BEReDvVbBgHQMBp4kQQ2ZE Bpc9ictDyShoDQmJTkda3yHzogVVLqNe53BTUOB6I1/8M7LwcBDFt8egdlcMzQM2F1/S 3TfA== 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 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 o14si17543552eja.222.2020.12.28.07.24.26; Mon, 28 Dec 2020 07:24:51 -0800 (PST) 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=RpuSyaYm; 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 S2437003AbgL1OCt (ORCPT + 99 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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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(-) 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*/ -- 2.27.0