Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1863062rwb; Fri, 19 Aug 2022 10:37:59 -0700 (PDT) X-Google-Smtp-Source: AA6agR5ZDNdDoVvzqSSXT9ESLrzx4OcjRSzgCpC+yW3phPHZV3MASpDu2MBmbfLtCM8c1ffBjwDR X-Received: by 2002:a17:907:1b12:b0:72f:9b44:f9e with SMTP id mp18-20020a1709071b1200b0072f9b440f9emr5528783ejc.653.1660930678886; Fri, 19 Aug 2022 10:37:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660930678; cv=none; d=google.com; s=arc-20160816; b=hWk4fdbY3ImXZhh629eEHsfj0H2ECXkaVXowh08+SFA7ST0LR4AhZMy7iNDsgKxk3p 5GvzK+MqgWFmFGBmkhxNWqoY9kQugaPtJkCbxgOMhfO208rpFjY5hW3Ab1i8dSqnwYo4 NKSw/GTB6rAPDlufsJgNiu8lDr60ex5A9gKeN35634gmAWNKHrKc90ht+3GWLsi1vbob M2gmURjbFzWww0fM+TXUeYTRGt6qjAjGoctvri6wgUylV6OxBeSXaBhA2RBGKh4Tlfwi UJsOU+cj9t9N3uNerwI1P8k5wFVAV1lEelOCDOo/04FRgw6fkC2OQB5SpAJdVsc1KIpz Zf6g== 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=nn6h1Oc0Y6Umye1+pcU7h2ZRz6LkjaykIV6B8VGP3oE=; b=G82j2eDdfO8ez0F2TosY0n/hdRCzF2XGngDcJ53+mEW9PII2YWtknedU0q1GTXZ5Cf 0E2vmBQrXVWpmJnyacSW2FCYm897pDdb4AwzePV/QozpuMLz/p3z8bOGVttVzr9SRbfG /+ervDpGsWgjgMs8FBkJVTGCMhT9oqv8SaO13lYyLhOn9tY74nYw1S35UhxjxXC8QdlQ WatK+Xy68Q81ELv6oNIIdnkrz9Eln431XeUDKSku4A11r2Mh4XuY5WOUBYHUBYP0mdS6 Mk7IL0vJdZ74TVsq1HYvgml2a+0a3HdS5vPbF00bUVK0gr28Y1/jiJdGSwjIfsZ6pgNE yRUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lpChL0Su; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id eh1-20020a0564020f8100b0043e33c1d5eesi3009985edb.230.2022.08.19.10.37.33; Fri, 19 Aug 2022 10:37:58 -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=lpChL0Su; 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 S1353740AbiHSQnh (ORCPT + 99 others); Fri, 19 Aug 2022 12:43:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353848AbiHSQlI (ORCPT ); Fri, 19 Aug 2022 12:41:08 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 026A9124229; Fri, 19 Aug 2022 09:09:31 -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 ams.source.kernel.org (Postfix) with ESMTPS id EE996B82824; Fri, 19 Aug 2022 16:08:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 59EEDC433C1; Fri, 19 Aug 2022 16:08:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660925328; bh=8kUpbkMwLPfjZaP/tQk/YlBKuvxAlceCaVIlCRD3mqw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lpChL0SuU6jSSYERKfpNQExCm8Ss29uKB7Zp4Oh9ZG8VN9bEfxoNwDFNnstIr1wGR i1Yj+OGogoVlbsJQ8mwmARqxemY15iISaUzB1DtHHdiNFdHhJFqqpcwesC9PMoyBck v4nrRdY50BdswOju03xr9aEyWlcO/Pi0Hw0wtYAI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dave Stevenson , Maxime Ripard , Sasha Levin Subject: [PATCH 5.10 457/545] drm/vc4: drv: Adopt the dma configuration from the HVS or V3D component Date: Fri, 19 Aug 2022 17:43:47 +0200 Message-Id: <20220819153849.836678563@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220819153829.135562864@linuxfoundation.org> References: <20220819153829.135562864@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 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,T_SCC_BODY_TEXT_LINE 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 From: Dave Stevenson [ Upstream commit da8e393e23efb60eba8959856c7df88f9859f6eb ] vc4_drv isn't necessarily under the /soc node in DT as it is a virtual device, but it is the one that does the allocations. The DMA addresses are consumed by primarily the HVS or V3D, and those require VideoCore cache alias address mapping, and so will be under /soc. During probe find the a suitable device node for HVS or V3D, and adopt the DMA configuration of that node. Cc: Signed-off-by: Dave Stevenson Link: https://lore.kernel.org/r/20220613144800.326124-2-maxime@cerno.tech Signed-off-by: Maxime Ripard Signed-off-by: Sasha Levin --- drivers/gpu/drm/vc4/vc4_drv.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c index 839610f8092a..4bed62916b64 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.c +++ b/drivers/gpu/drm/vc4/vc4_drv.c @@ -246,6 +246,15 @@ static void vc4_match_add_drivers(struct device *dev, } } +const struct of_device_id vc4_dma_range_matches[] = { + { .compatible = "brcm,bcm2711-hvs" }, + { .compatible = "brcm,bcm2835-hvs" }, + { .compatible = "brcm,bcm2835-v3d" }, + { .compatible = "brcm,cygnus-v3d" }, + { .compatible = "brcm,vc4-v3d" }, + {} +}; + static int vc4_drm_bind(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); @@ -263,6 +272,16 @@ static int vc4_drm_bind(struct device *dev) vc4_drm_driver.driver_features &= ~DRIVER_RENDER; of_node_put(node); + node = of_find_matching_node_and_match(NULL, vc4_dma_range_matches, + NULL); + if (node) { + ret = of_dma_configure(dev, node, true); + of_node_put(node); + + if (ret) + return ret; + } + vc4 = devm_drm_dev_alloc(dev, &vc4_drm_driver, struct vc4_dev, base); if (IS_ERR(vc4)) return PTR_ERR(vc4); -- 2.35.1