Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2886964rwb; Mon, 15 Aug 2022 13:19:50 -0700 (PDT) X-Google-Smtp-Source: AA6agR7jDaRHEdhDQP5FMusTqRzv6+Bur/KwPcEVTPaP5uTihePOvs/JkkAR4ahi5RyvRqrqRKfb X-Received: by 2002:a17:907:3f11:b0:731:57ed:3aea with SMTP id hq17-20020a1709073f1100b0073157ed3aeamr11168071ejc.432.1660594790477; Mon, 15 Aug 2022 13:19:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660594790; cv=none; d=google.com; s=arc-20160816; b=KV0hV+S/u3I44qYH+uU0ySkVd2pchHu58vQqHms17B+1nUOAHRhbBQdjiyligFh1jr wlrZXwxBsGRKR2t+U/7gE76+SuFEWfE/JnuDHYhM+PNtkQrGc+eN/0NwDMTfVEtddxNX MGKMuaULmezObdlvqus0CE2Claoz2lt9ku/97kjyWqpEP2Xzpd1mLO0bYpeh+DcVgTg5 UWp+hsbhcUTjHvcUHSeIn1cAsuQMcXMejGTPxnKKgf9NEUdftxVLmkWfe3mXEa9ASEKK j1iavwdlEIGn6pFWAcCJ99JJa5PnAhczoUvjfbapan0l+dAJr0SB500v/mlFA5PCXQ62 CaRA== 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=EsxGD7zMnkXAlgYNmeZiSVl9truU84qAzRbPZddApac=; b=w05g3zWdiUcobgHd89UpnXh8OgE0TOKD41gNMri07/37HcbQsyD3nTvN2+81lhz/TR 8PAiXlT3dAeag6TaXyOlcFXV+fkPKZvhBqzz/+jYM0jX8qNDHJBdGGg/obNdnRh0awZc QOoo2JEQoz4ReI+KoaNjr5PIGLEQU2P5QNcijHx5CwtiZet7PnLow7yJBcTJtkVh3Sxe awbMI0cFAV63I9iOoy9iXkf1EA9tZ9HMOT/okFS2fDJdFi1hC8l8tZQrvNasdtj5IpSb 0hWpkRf216NcUQM5+VMQCfDWdgKVwrgFqrARIVJJd89U7+A73e1+wS4I+6VcXfyAo8fW 0DuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GSUty2vh; 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 a20-20020a170906469400b007308b971d64si7047939ejr.571.2022.08.15.13.19.24; Mon, 15 Aug 2022 13:19:50 -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=GSUty2vh; 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 S1345631AbiHOTzG (ORCPT + 99 others); Mon, 15 Aug 2022 15:55:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244436AbiHOTx1 (ORCPT ); Mon, 15 Aug 2022 15:53:27 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 744B845076; Mon, 15 Aug 2022 11:51:33 -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 144BCB810A3; Mon, 15 Aug 2022 18:51:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5A079C433C1; Mon, 15 Aug 2022 18:51:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660589490; bh=45uz+rwgHCBS0lVdD6UyCB1stwIcWm/PdZp4hRTGTfU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GSUty2vh5Mz57dXMcLPPrWswexZXt2DyswWsQF8ij+kITsfCnesPNjfrQl9rtQc9t sWq+ch/bsSxxKDgFaFIaITuONxcq+LdxdJ9WXKKe5oe+at1QfhXTbV3XpffYbQm5d/ aPQuGTU7f6t5/usxzc11UjCIvn9rgx6F9Zi5eQzY= 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.15 694/779] drm/vc4: drv: Adopt the dma configuration from the HVS or V3D component Date: Mon, 15 Aug 2022 20:05:38 +0200 Message-Id: <20220815180407.009803481@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@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 f6c16c5aee68..6e52801e2d99 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.c +++ b/drivers/gpu/drm/vc4/vc4_drv.c @@ -214,6 +214,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); @@ -231,6 +240,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