From patchwork Wed Apr 7 15:01:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 416723 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp545992jai; Wed, 7 Apr 2021 08:02:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVF1JlEEqCJSoekNJIENmweAEYkm3dT3yIkatxChaUDnYUZEauWzEkHxV2vC3neRHWSuwB X-Received: by 2002:aa7:860f:0:b029:200:851:1bff with SMTP id p15-20020aa7860f0000b029020008511bffmr3236251pfn.64.1617807738171; Wed, 07 Apr 2021 08:02:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617807738; cv=none; d=google.com; s=arc-20160816; b=SbBqQFGhlkD34rfxw8my1uBWail1Wy+sqsbQ5hkJtyLv+EvzvwFxyqxAV5oaoKhFvu 2pNp50gw1igdtYsv5/ZrodZq1d8lOihcRrO9oVsagdDZuSwyEP+tVz8+bGwgs9ttqRmX Rkm8Yqe5tR7Uh5vCCtRxA90Jdv7tLnFDqegDrkMpEX3WED/FXNBtL3aY3AA+H0lm0Soy 7CwgyVvSPZlquL/bOvvTaQZUIoYV/iZFu4VL/lqlC7a5kxUDWw4yq57DUOyzdhRZVAy5 Rk7p/uGfOE3H/7C4IZ2qzYF22n5dHMSLdepHL7p452YUoLAji9ZmXgxRK9qJ85QWs1qE 6Pnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:dkim-signature:delivered-to; bh=my39rbhtMIBpIpsG7I1bpcvjCOHq4j0yQ2aO5cgfzXs=; b=JlhPBdSj0cgX4yk9DeQ45+FxoLqa9iRJfTbqZbRgLpwInnXXTo/LRum/les7viM3uK 1RReuf/u2CYHDgsegpdTictZafhUubpCDOuHaAOheT0A6Zt52/1B5Z228k/TKUwbHbVf BO1GCL2JO1ADGVcP1iF6MeXaqfxBkktt0oJ8GATFAzGDHmw0xy/YyuVLUQvDSt9Jqu/N K/UwvIaB4oYsDVWgStQb9HCcQwYFJ/HPb4DIm4n5H6y0cOPWY7IqHf63k5+PwmPCRgSy EHbdtDD34GwJufZe0wpgmqB4xsuUWYmyiB6BzD6Ab8CemJrKVluDPxnKcaztO9jg0kq0 tEzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=PLlouWWs; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id x15si6182244pjd.23.2021.04.07.08.02.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Apr 2021 08:02:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=PLlouWWs; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 402B06E93E; Wed, 7 Apr 2021 15:02:07 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1B7836E938 for ; Wed, 7 Apr 2021 15:02:06 +0000 (UTC) Received: by mail-lj1-x230.google.com with SMTP id u9so21070997ljd.11 for ; Wed, 07 Apr 2021 08:02:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=npIx+syRqPHuDl3yS1YmnkoXjeuuW+FJx46iC8knyUQ=; b=PLlouWWstvHPcpFJi8ouQdP48V1XRbm8uFdRM/nzfzPychq9/0I2i1lTGLN3qA/mc0 7XCy3VGp794UicMCHl6oriF3kLNA+gdm2GCrvKGA0/CGwSWVrhkdZCxmQ/PPAfpNPtDY 3zYj0bzlw8Pilj1rjt/Yy29C17xiMimA4zwGbjxrvq/w7dJ+JwFTE4nifE2r1fW9bPmS qAmfVLsnPE0xhnKRSPhkjr+1mrcOk6GxHSzqxdTcrSuKJyiedMiMB1Pqj0gVI8T7MIwl Xjp3vqcjNlDrx9/QuBP5V1lGZx9MxZBoj0i2/b0Su5NIy7ZAaMWee0DVDFyDs0ebrkyA vHnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=npIx+syRqPHuDl3yS1YmnkoXjeuuW+FJx46iC8knyUQ=; b=gTiVd8CXgSW8tuv0m9SZZWHl0ZJtqIQ1auKOVaj+NWJW21C+ZfvIbFpLlaCdC/5at7 9Tcy+az576/rwLxsifqAcXXcJlzcyJuFZ7iOp9HDaBxRv3axLMNblNrG38ejWVBojSI0 qZS6Kxjfwy4+pC3vdSBYNnKtLqqyRyZuv+QzgYduxBxWIy1HFCc39UcSVbXDhbS3j27D THsyeujMbhXJghi7QnQAWfOP6LeAM9+CFIujW6bKJZFqi28QDXM6g18AE1qg/s4/2xjt 7yTRgINPuCUbYQTmgvWnTjHAAprYoAtKSamKsGKDQJzBIiN1bWWr2SK6zUeUGPa7QAf9 rEJQ== X-Gm-Message-State: AOAM531aBcnRrRjuLHvOTqTD50VVyhVzHSFW7xR9LfB+a4eMcbHXwZ+U 3A3CXyILHwcBxXWMKDzdsTjM6w== X-Received: by 2002:a2e:9156:: with SMTP id q22mr2476090ljg.274.1617807722963; Wed, 07 Apr 2021 08:02:02 -0700 (PDT) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id o11sm2552142ljg.42.2021.04.07.08.02.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Apr 2021 08:02:02 -0700 (PDT) From: Dmitry Baryshkov To: Andy Gross , Bjorn Andersson , Rob Clark , Sean Paul , Rob Herring Subject: [PATCH v2 2/4] drm/msm/dpu: always use mdp device to scale bandwidth Date: Wed, 7 Apr 2021 18:01:55 +0300 Message-Id: <20210407150157.801210-3-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210407150157.801210-1-dmitry.baryshkov@linaro.org> References: <20210407150157.801210-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Jonathan Marek , David Airlie , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 --- 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(-) -- 2.30.2 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c index 85f2c3564c96..fb061e666faa 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c @@ -933,8 +933,7 @@ static int dpu_kms_hw_init(struct msm_kms *kms) 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); diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c index cd4078807db1..3416e9617ee9 100644 --- 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_mdss *mdss) 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_mdss *mdss) { 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_device *dev) 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_device *dev) 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: