From patchwork Sat Oct 22 07:23:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7430 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1097885wrr; Sat, 22 Oct 2022 01:09:04 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6c/GDvej5sDT735OX/tvkq+BpW6uofTIisQ0wByMQCSxMnG/5RFhAP9en8blKz3tNkTxdn X-Received: by 2002:a63:2a86:0:b0:46a:eaba:f1f3 with SMTP id q128-20020a632a86000000b0046aeabaf1f3mr19382648pgq.79.1666426143779; Sat, 22 Oct 2022 01:09:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666426143; cv=none; d=google.com; s=arc-20160816; b=IS9ekA8DoIElaxbsp3cA7BN2kCKbkmGDyFKNdFugK5IAZMoisyKwxBwwk0vvJmU4mE CYcq7nUKACugpB739WVrxw5glX30a7kEUGRniKkihNsMvmM3gxw5fj6p4flsRSJUgIjs L3tNY/5inU0ht9OI3YMWORsQnsy4+meW29FTiMYlgLfWWEE4BCGnOUSaQS0bcbb8CZ+R djy9bgK7KTH64Fe79E24p7Ithm94LQjK8rcGB9aig+lYUyAA55ugOcaQRcOgrm0BLeIz JU7Fhw6iN/Nwbqwpm205TIgx/+pwaiScBLrtC6BubSwyvu0StegHLke0ZXVQkWF5FezN vCaw== 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=e3AuUzPe4EUkZ2qxQflwwEBZZqbX2opKgSxdQqKBj1M=; b=QA01b361+hjPEaydsAQggbtGnQoLENkT7LL98bE33OcRtLIRm7/5hMq8XKG6MJwcKB 49ihHL5PmAvTqiHu6s5OL8G/BrDQ/GN6P+DJsAEo5zPwEoyXvcJhGIAdotbUtpmzowVN bIvPT7aLdpIXyWnXGsSNAYO0xCJ+etPuC/T6kl200Qn5r0CIw8YmkVqDRFv2Lj2QT/bQ W8VD+Uv3tuoA8DPWvSwemv22C017Btok9nqQFJBL8hyU8C47sL1t+DjLyER5ypCPE9IZ g4fr2ipWi2ApvLgsfoIK0G572SMEUFNYH4LfilojPYSbunrHwkiVkJ4ucpWH/8fQ6QdS i6VQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=abH4jQAp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q4-20020a056a00150400b00565cb1ebdb2si29291366pfu.267.2022.10.22.01.08.49; Sat, 22 Oct 2022 01:09:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=abH4jQAp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S232871AbiJVIIb (ORCPT + 99 others); Sat, 22 Oct 2022 04:08:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232996AbiJVIEg (ORCPT ); Sat, 22 Oct 2022 04:04:36 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 212532C56A4; Sat, 22 Oct 2022 00:52:03 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9828160B39; Sat, 22 Oct 2022 07:50:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A85A6C433C1; Sat, 22 Oct 2022 07:50:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666425015; bh=UJm+gn1TcHPDC6D7HJCQhNP5qveQ9yG2fJZsrvDSvBA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=abH4jQApVUH57BNHX5aIDuO8sXvXv43H0Fq7F4mfty4WVnMgLqlu9FWesu/jhvgyv a7XqrsBrCmNuffStRA9ik/jrEZuVrkkF2PsvcxLrNe7BZOsuyGK9j1P/yVm0dKQ0yB n9lKV1EeO/sbfThbTKGdCpczRMUUw8h5TPA+PFvs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marijn Suijten , Yassine Oudjana , Dmitry Baryshkov , Rob Clark , Sasha Levin Subject: [PATCH 5.19 330/717] drm/msm: lookup the ICC paths in both mdp5/dpu and mdss devices Date: Sat, 22 Oct 2022 09:23:29 +0200 Message-Id: <20221022072509.522131513@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747374460120623116?= X-GMAIL-MSGID: =?utf-8?q?1747374460120623116?= From: Dmitry Baryshkov [ Upstream commit 5ccdcecaf8f732f593e359ebfb65de96b11bae66 ] The commit 6874f48bb8b0 ("drm/msm: make mdp5/dpu devices master components") changed the MDP5 driver to look for the interconnect paths in the MDSS device rather than in the MDP5 device itself. This was left unnoticed since on my testing devices the interconnects probably didn't reach the sync state. Rather than just using the MDP5 device for ICC path lookups for the MDP5 devices, introduce an additional helper to check both MDP5/DPU and MDSS nodes. This will be helpful for the MDP5->DPU conversion, since the driver will have to check both nodes. Fixes: 6874f48bb8b0 ("drm/msm: make mdp5/dpu devices master components") Reported-by: Marijn Suijten Reported-by: Yassine Oudjana Signed-off-by: Dmitry Baryshkov Tested-by: Marijn Suijten # On sdm630 Tested-by: Yassine Oudjana # msm8996 Patchwork: https://patchwork.freedesktop.org/patch/496488/ Link: https://lore.kernel.org/r/20220805115630.506391-1-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark Signed-off-by: Sasha Levin --- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 7 ++----- drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c | 9 +++------ drivers/gpu/drm/msm/msm_drv.h | 2 ++ drivers/gpu/drm/msm/msm_io_utils.c | 22 ++++++++++++++++++++++ 4 files changed, 29 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c index e23e2552e802..9eff6c2b1917 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c @@ -383,12 +383,9 @@ static int dpu_kms_parse_data_bus_icc_path(struct dpu_kms *dpu_kms) struct icc_path *path1; struct drm_device *dev = dpu_kms->dev; struct device *dpu_dev = dev->dev; - struct device *mdss_dev = dpu_dev->parent; - /* Interconnects are a part of MDSS device tree binding, not the - * MDP/DPU device. */ - path0 = of_icc_get(mdss_dev, "mdp0-mem"); - path1 = of_icc_get(mdss_dev, "mdp1-mem"); + path0 = msm_icc_get(dpu_dev, "mdp0-mem"); + path1 = msm_icc_get(dpu_dev, "mdp1-mem"); if (IS_ERR_OR_NULL(path0)) return PTR_ERR_OR_ZERO(path0); diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c index 3d5621a68f85..b0c372fef5d5 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c @@ -921,12 +921,9 @@ static int mdp5_init(struct platform_device *pdev, struct drm_device *dev) static int mdp5_setup_interconnect(struct platform_device *pdev) { - /* Interconnects are a part of MDSS device tree binding, not the - * MDP5 device. */ - struct device *mdss_dev = pdev->dev.parent; - struct icc_path *path0 = of_icc_get(mdss_dev, "mdp0-mem"); - struct icc_path *path1 = of_icc_get(mdss_dev, "mdp1-mem"); - struct icc_path *path_rot = of_icc_get(mdss_dev, "rotator-mem"); + struct icc_path *path0 = msm_icc_get(&pdev->dev, "mdp0-mem"); + struct icc_path *path1 = msm_icc_get(&pdev->dev, "mdp1-mem"); + struct icc_path *path_rot = msm_icc_get(&pdev->dev, "rotator-mem"); if (IS_ERR(path0)) return PTR_ERR(path0); diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h index 099a67d10c3a..17e8b6571f6f 100644 --- a/drivers/gpu/drm/msm/msm_drv.h +++ b/drivers/gpu/drm/msm/msm_drv.h @@ -442,6 +442,8 @@ void __iomem *msm_ioremap_size(struct platform_device *pdev, const char *name, phys_addr_t *size); void __iomem *msm_ioremap_quiet(struct platform_device *pdev, const char *name); +struct icc_path *msm_icc_get(struct device *dev, const char *name); + #define msm_writel(data, addr) writel((data), (addr)) #define msm_readl(addr) readl((addr)) diff --git a/drivers/gpu/drm/msm/msm_io_utils.c b/drivers/gpu/drm/msm/msm_io_utils.c index 7b504617833a..d02cd29ce829 100644 --- a/drivers/gpu/drm/msm/msm_io_utils.c +++ b/drivers/gpu/drm/msm/msm_io_utils.c @@ -5,6 +5,8 @@ * Author: Rob Clark */ +#include + #include "msm_drv.h" /* @@ -124,3 +126,23 @@ void msm_hrtimer_work_init(struct msm_hrtimer_work *work, work->worker = worker; kthread_init_work(&work->work, fn); } + +struct icc_path *msm_icc_get(struct device *dev, const char *name) +{ + struct device *mdss_dev = dev->parent; + struct icc_path *path; + + path = of_icc_get(dev, name); + if (path) + return path; + + /* + * If there are no interconnects attached to the corresponding device + * node, of_icc_get() will return NULL. + * + * If the MDP5/DPU device node doesn't have interconnects, lookup the + * path in the parent (MDSS) device. + */ + return of_icc_get(mdss_dev, name); + +}