Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3029199rwb; Mon, 15 Aug 2022 16:27:58 -0700 (PDT) X-Google-Smtp-Source: AA6agR49QTYdwdwl2g4AplBJRHmWV0yW/7Dv7oBaPGMo7QKDpRaJZqqmGG0GY+bgxAVO13AcsIsv X-Received: by 2002:a05:6402:2b88:b0:43a:6c58:6c64 with SMTP id fj8-20020a0564022b8800b0043a6c586c64mr16584136edb.348.1660605989190; Mon, 15 Aug 2022 16:26:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660605989; cv=none; d=google.com; s=arc-20160816; b=DT2vLPr8OZL6xzPhNEDgNxiTxp4jg9Kv3yQKKwsKxqrj7Sj8omCHaYes5Qcc9+YWO4 OAhyRsaPvRWwRZuR8zSqZFUI85zcxtnW0I6AevrxH5ETvecz/caEdgs59IjnwBYQJ8J1 fXOAk0UGGObu9y3pQpSdPWcAJRWGzvEUZM3bLvJrG8LPEu+mW0pAcoshqXJBeGHbvXtd dq5EmWl6b7Q7PlBhd6sP5yuefnuUpexROyGPnoMRUbV+JUMSN1soeGpH2n3jDXXTS4sy hog5TBr9+T391sNybFkLJKp8h3w//DS3zIQr3OsedhnkbWxXzWVw8w+8nLVrR3nfKczV fx7g== 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=sHOA+s0RByZRXgznPLCZB1yoF23pjf9NQxnQamEwHnQ=; b=s9RKpz9EcFYR8mnJs1ko36TTKsOw8NS5EQyjbbLN+vGkyh3iiaPZnU6nee6/RGZgNp YHWkK0TXA4JSpiU73NNOOxkFdoVdKdYZttR9+muHY1KXHASE/TAdkrw+zaN13ZItWy7+ xDsmGn+N+1A1VjB/vHv+weTFm7H2FN1ukRx/vtF3vgs5uMw11IPx2eHzqq8AxR0Kd+Q6 H8vgX0ZQfgDE0d39P4RTrgxbSWj+ZbtVLZ28RNZQYyquAMx2o5/X7ZUXiIfbSqNtc0f/ 0P/3+eMwm+LyAbFGC090jJbEiSgpZUl6VXVqnGp4S1h1senImHLPsBAJeZcJIaKGVHDD eydw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LmSoWZPb; 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 u26-20020a50951a000000b0044260de35ebsi7918673eda.214.2022.08.15.16.26.03; Mon, 15 Aug 2022 16:26:29 -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=LmSoWZPb; 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 S1346683AbiHOXPB (ORCPT + 99 others); Mon, 15 Aug 2022 19:15:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245556AbiHOXNl (ORCPT ); Mon, 15 Aug 2022 19:13:41 -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 3359779EF8; Mon, 15 Aug 2022 13:01:08 -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 CC9B3B80EB1; Mon, 15 Aug 2022 20:01:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 34A66C433D6; Mon, 15 Aug 2022 20:01:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660593665; bh=DpIsB85cAaX72M1feI13jcsxfwUbFB17TZwzeEvMRtA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LmSoWZPbP6Fp7TN4Y5OfdZieLZhiPhqdS0h/CMZhOOk5BAO9i3PR8lst4fC09rK1S nVO9hRHLht3eb5Xv7MiyPuffwf9zYIWiajJIXvAKqi5ICufMszUlUN4vV3t5tSmzhR fEr+t4upj+RllfagoA7dG51kcL46DYIgqABr+hQo= 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.18 0984/1095] drm/vc4: drv: Adopt the dma configuration from the HVS or V3D component Date: Mon, 15 Aug 2022 20:06:23 +0200 Message-Id: <20220815180509.832340319@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@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 162bc18e7497..14a7d529144d 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.c +++ b/drivers/gpu/drm/vc4/vc4_drv.c @@ -209,6 +209,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); @@ -227,6 +236,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