Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp5282009pxv; Tue, 6 Jul 2021 23:24:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6ex6ef0VkEwpwOlkaIf1A2t+7ExxBgT2iwQmFQR6NpG8Sn9koB/G++FDig7E/++0EFe6C X-Received: by 2002:aa7:da94:: with SMTP id q20mr11323004eds.247.1625639050314; Tue, 06 Jul 2021 23:24:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625639050; cv=none; d=google.com; s=arc-20160816; b=oHHi2mZ4NSxwy+pATRuJHeRilXOXL3bTboNjLAzlMCD2PaBOWSpsrcqJr6LmRxX5Iy g4Xe+3a4LignnaEdxdVmISoR2Luyf++mrSJGP/DTfNwX+55Ld0+QiQMOL1RUIHEdZddn yh1QH7/JWINWC03ubYL7MVcY/rpUc469jilq+//CuI33sKZNCKSt534gwyF4sQwYtIBe Tu7k6hbq+375FY3DZWzppVN79wwiGjDT2o8jv7mFGrcpBGzm/XqSLc/crjm897K4oGS/ xKc5dCymH2/XBSdMTLMGz0atFR+T/OmWyCo3pbgTHZyIXLBSD/KAnSdZSVsmN16LUUmn Ukng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=whfcCVwplfye/kEanKARooQskYGNVHdCcEykd70ljmQ=; b=LyUqpKm50ixSGz5ofaMIXBypUbpUC73/nlJcQYwoSi5BWEVe9XnIQ2+NViVIXjhKfK qB8GGVvMwGwy8NJdGXpOWFwPAvPXC3L/NdyV9F6OD7GacM/VCpjqk6Y88Z0Hdf1LeTX2 aRyheQ0yCMqpYRwLlYwvUrAILeU6AfDihVjDwgRgch/mARoLeNajE3JC2iG7o94GDExf GOy/z2ENzlQb2Kbb8r/i8Am1146ubI1yLvARlQ87dHq7afx5Om6hmBqw4vL4D7rba+zJ 8X+Mzsx2Ex2UnG71eTCqR9AKRC5YFPVYr8NDR7RBZ4TUbRxDybID6HSlsTWSITsE+6BF zxgA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u5si16180809eju.85.2021.07.06.23.23.47; Tue, 06 Jul 2021 23:24:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231179AbhGGGZ2 (ORCPT + 99 others); Wed, 7 Jul 2021 02:25:28 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:50300 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S230376AbhGGGZP (ORCPT ); Wed, 7 Jul 2021 02:25:15 -0400 X-UUID: a27007085a8d4a829fef872264ea8a84-20210707 X-UUID: a27007085a8d4a829fef872264ea8a84-20210707 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 753883690; Wed, 07 Jul 2021 14:22:32 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs02n2.mediatek.inc (172.21.101.101) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 7 Jul 2021 14:22:30 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 7 Jul 2021 14:22:29 +0800 From: Yunfei Dong To: Yunfei Dong , Alexandre Courbot , Hans Verkuil , Tzung-Bi Shih , Tiffany Lin , Andrew-CT Chen , Mauro Carvalho Chehab , Rob Herring , Matthias Brugger , Tomasz Figa CC: Hsin-Yi Wang , Fritz Koenig , Irui Wang , , , , , , , Subject: [PATCH v1, 11/14] media: mtk-vcodec: Support 34bits dma address for vdec Date: Wed, 7 Jul 2021 14:21:54 +0800 Message-ID: <20210707062157.21176-12-yunfei.dong@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210707062157.21176-1-yunfei.dong@mediatek.com> References: <20210707062157.21176-1-yunfei.dong@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use the dma_set_mask_and_coherent helper to set vdec DMA bit mask to support 34bits iova space(16GB) that the mt8192 iommu HW support. Whole the iova range separate to 0~4G/4G~8G/8G~12G/12G~16G, regarding which iova range VDEC actually locate, it depends on the dma-ranges property of vdec dtsi node. Signed-off-by: Yunfei Dong --- drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c index 1bcb070ef947..c29154c30dcc 100644 --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c @@ -432,6 +432,9 @@ static int mtk_vcodec_probe(struct platform_device *pdev) dev->num_core = 0; } + if (of_get_property(pdev->dev.of_node, "dma-ranges", NULL)) + dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(34)); + for (i = 0; i < MTK_VDEC_HW_MAX; i++) mutex_init(&dev->dec_mutex[i]); mutex_init(&dev->dev_mutex); -- 2.18.0