Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4854359pxj; Wed, 9 Jun 2021 03:37:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwk/oX/kfWP8pHbOEWkl8DDtX3ODw9I4UJDP81RkbI6CVBIzfBm1jpAKPLKryq+6+6iW6xv X-Received: by 2002:a17:906:b19:: with SMTP id u25mr27424920ejg.238.1623235060131; Wed, 09 Jun 2021 03:37:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623235060; cv=none; d=google.com; s=arc-20160816; b=VQ6cMoHuvp+AKdpJryTH6HivmBYZj4NcWNgq7CbGE4vB8R15nx2nY18AIln9gj3ziV cSc24ksMjJ57fivgZBwy4umQLlYFt5+FJ8/B3lDug6BowEH+MwFdLz0RGBo78tsfjQpw Dd5nhShUwGThuwkLXRZ3UVQR1zrDE5xPlQP/L3kIRhSGlTb8endFcNybNY+7/8kcBezZ SpnsvRD092ydtu82Y8VefOo/nUzvbAvALQF2xv2JRf0LDa0kMiwt8rdPs9dT26bSKV0F ekcYIZ4bl21BPOxa4u2zVBsnV4zBcHn3RcZ73hr5/5lEM8XPjiZgjYVlumPkpO4lu1KX HdPg== 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=E8qMV421qE0aUfnhknn/wXG8gL/N1J/Bo122STMJ0FI=; b=NdcoRR7gbuzcrbzwo1T/84AZ/QZa9Fe2voQkXBsbyxCmFhNNziU/cfCJR7Sow+XyIH vmEsnythuvvqkOzA12XOAuZUSjnSKuq+16bRk0VDz4EK/FzJ4V8QlK2yRGJVKWmCKNCh H2mwBG+vtbfuT8YE+3+Cjx8BSy4sUC/51a9sA+urfXubwdEFkXyuBaFroNBYRZGVuSqb KkzT47JhBwPtQUKs4ZbF+DIsWL0lPxvGsgeUpeGKZJ/TbkD162/eTWnwAgq7I94vAb/b DIrNdnKosE1CHqcvodxwCMXiCTJeyjdV0ghhj9UJ6P3y2UcZaPyIkJI8YreE2/LStdea QCgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="fsz/0tHt"; 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 g14si2020140edp.611.2021.06.09.03.37.16; Wed, 09 Jun 2021 03:37:40 -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="fsz/0tHt"; 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 S238019AbhFHTKi (ORCPT + 99 others); Tue, 8 Jun 2021 15:10:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:40012 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237542AbhFHTAt (ORCPT ); Tue, 8 Jun 2021 15:00:49 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 75F646188B; Tue, 8 Jun 2021 18:44:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623177857; bh=Yn8x+ox1llSa/5vVQRwNZ/ZKyQ0hmAM9L+vPNLJFqEk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fsz/0tHtkbaIrWTVWF0V2U9QewcdeXhYnjTQ2RpBi7Gv2EfIFcwrS558xE/r8Gx7N qH8ZrtDQxGOCoCGxX+CzCVs+8E3moQTmNYhNTuweSwoJw28QHIHkff8/R2LN53hPU6 wBWi2Lr2ovl50DyAp4yP6dqx8L6x5cJnHvlitK9A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dmitry Baryshkov , Rob Clark , Amit Pundir Subject: [PATCH 5.10 126/137] drm/msm/dpu: always use mdp device to scale bandwidth Date: Tue, 8 Jun 2021 20:27:46 +0200 Message-Id: <20210608175946.646140133@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210608175942.377073879@linuxfoundation.org> References: <20210608175942.377073879@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 commit a670ff578f1fb855fedc7931fa5bbc06b567af22 upstream. Currently DPU driver scales bandwidth and core clock for sc7180 only, while the rest of chips get static bandwidth votes. Make all chipsets scale bandwidth and clock per composition requirements like sc7180 does. Drop old voting path completely. Tested on RB3 (SDM845) and RB5 (SM8250). Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20210401020533.3956787-2-dmitry.baryshkov@linaro.org Signed-off-by: Rob Clark Signed-off-by: Amit Pundir Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 3 - drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c | 51 ------------------------------- 2 files changed, 2 insertions(+), 52 deletions(-) --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c @@ -931,8 +931,7 @@ static int dpu_kms_hw_init(struct msm_km DPU_DEBUG("REG_DMA is not defined"); } - if (of_device_is_compatible(dev->dev->of_node, "qcom,sc7180-mdss")) - dpu_kms_parse_data_bus_icc_path(dpu_kms); + dpu_kms_parse_data_bus_icc_path(dpu_kms); pm_runtime_get_sync(&dpu_kms->pdev->dev); --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c @@ -31,40 +31,8 @@ struct dpu_mdss { void __iomem *mmio; struct dss_module_power mp; struct dpu_irq_controller irq_controller; - struct icc_path *path[2]; - u32 num_paths; }; -static int dpu_mdss_parse_data_bus_icc_path(struct drm_device *dev, - struct dpu_mdss *dpu_mdss) -{ - struct icc_path *path0 = of_icc_get(dev->dev, "mdp0-mem"); - struct icc_path *path1 = of_icc_get(dev->dev, "mdp1-mem"); - - if (IS_ERR_OR_NULL(path0)) - return PTR_ERR_OR_ZERO(path0); - - dpu_mdss->path[0] = path0; - dpu_mdss->num_paths = 1; - - if (!IS_ERR_OR_NULL(path1)) { - dpu_mdss->path[1] = path1; - dpu_mdss->num_paths++; - } - - return 0; -} - -static void dpu_mdss_icc_request_bw(struct msm_mdss *mdss) -{ - struct dpu_mdss *dpu_mdss = to_dpu_mdss(mdss); - int i; - u64 avg_bw = dpu_mdss->num_paths ? MAX_BW / dpu_mdss->num_paths : 0; - - for (i = 0; i < dpu_mdss->num_paths; i++) - icc_set_bw(dpu_mdss->path[i], avg_bw, kBps_to_icc(MAX_BW)); -} - static void dpu_mdss_irq(struct irq_desc *desc) { struct dpu_mdss *dpu_mdss = irq_desc_get_handler_data(desc); @@ -178,8 +146,6 @@ static int dpu_mdss_enable(struct msm_md struct dss_module_power *mp = &dpu_mdss->mp; int ret; - dpu_mdss_icc_request_bw(mdss); - ret = msm_dss_enable_clk(mp->clk_config, mp->num_clk, true); if (ret) { DPU_ERROR("clock enable failed, ret:%d\n", ret); @@ -213,15 +179,12 @@ static int dpu_mdss_disable(struct msm_m { struct dpu_mdss *dpu_mdss = to_dpu_mdss(mdss); struct dss_module_power *mp = &dpu_mdss->mp; - int ret, i; + int ret; ret = msm_dss_enable_clk(mp->clk_config, mp->num_clk, false); if (ret) DPU_ERROR("clock disable failed, ret:%d\n", ret); - for (i = 0; i < dpu_mdss->num_paths; i++) - icc_set_bw(dpu_mdss->path[i], 0, 0); - return ret; } @@ -232,7 +195,6 @@ static void dpu_mdss_destroy(struct drm_ struct dpu_mdss *dpu_mdss = to_dpu_mdss(priv->mdss); struct dss_module_power *mp = &dpu_mdss->mp; int irq; - int i; pm_runtime_suspend(dev->dev); pm_runtime_disable(dev->dev); @@ -242,9 +204,6 @@ static void dpu_mdss_destroy(struct drm_ msm_dss_put_clk(mp->clk_config, mp->num_clk); devm_kfree(&pdev->dev, mp->clk_config); - for (i = 0; i < dpu_mdss->num_paths; i++) - icc_put(dpu_mdss->path[i]); - if (dpu_mdss->mmio) devm_iounmap(&pdev->dev, dpu_mdss->mmio); dpu_mdss->mmio = NULL; @@ -276,12 +235,6 @@ int dpu_mdss_init(struct drm_device *dev DRM_DEBUG("mapped mdss address space @%pK\n", dpu_mdss->mmio); - if (!of_device_is_compatible(dev->dev->of_node, "qcom,sc7180-mdss")) { - ret = dpu_mdss_parse_data_bus_icc_path(dev, dpu_mdss); - if (ret) - return ret; - } - mp = &dpu_mdss->mp; ret = msm_dss_parse_clock(pdev, mp); if (ret) { @@ -307,8 +260,6 @@ int dpu_mdss_init(struct drm_device *dev pm_runtime_enable(dev->dev); - dpu_mdss_icc_request_bw(priv->mdss); - return ret; irq_error: