Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1169231pxf; Fri, 12 Mar 2021 03:42:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJwXT9wmpjUG1YtIrZ0zRACEPIzbabf9uhBvQYnoH6SQ8rtSjLOUAdE9SoCSTA46JfOUlc3W X-Received: by 2002:a17:906:130c:: with SMTP id w12mr8001092ejb.253.1615549373967; Fri, 12 Mar 2021 03:42:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615549373; cv=none; d=google.com; s=arc-20160816; b=DBl5XxGYMzlfJNgaiyYlwVUY/zW5pBC57/9mr/SXvKC1oW3EDL5b6kd/B1HJ238Mo0 7188WtPZMOrKY7trkFpCuTV4UpxIiuJC3K4CVGyFyNPcEiQ9ILZJfIo3EaXt9ZDEhgrx Mrp/+XP6NwG19xPsi/D0ILkgganw3dVwXV0AUR4vYzAlhH2nFTXEknRiKOBcQBZsfGqJ c3FL0BnMf+d2zw3DhXOW6Qw4r3aZyEX9owuO14RcBu9Wa9iZ0WI8uSDyZtD14Sk29Mut cQf3zzG005U32mmYUeYo5pd/rWK1X3ukAKzRKfWtgI2pnNYUdpHi7J73gtjOgjym5/3B vBAg== 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=V9u341K3o5SWAr+LD/mLl6Xo/q/wI5BWx9lOhM6RJRo=; b=G9jxI5lgV7c8zBxeEgb6B/9bM7WrgvqC3JynXwgd8R0cI/dc2ROzzbi676qZveCUVC kSjdjM7GLiYfbOLq0VgGnDtH1+JKMl+jzPAxcIGF489th/RRQeqlUm4oS4fjJvn+wLR2 /M0CKsuwyt9kXXXIHxo+KjOjxgRvjtKvT/IvpjGV8vGs6nyd2GwPWI4mqOce4wfe/IR/ OvDU6bEv/vfgW9panHL7if6eIn5woqxOewUHZQPJx0s4RN4Dz0dar3wD0OS0xmFlq908 wS3Zs2vxtXKsDgrWzD/pXNH59jHOXgoRmsGkE8i/trii2a4aRhyKnnu8w+RInnACN/t3 Vksg== 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 cc4si3808409edb.347.2021.03.12.03.42.31; Fri, 12 Mar 2021 03:42:53 -0800 (PST) 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 S232017AbhCLH4b (ORCPT + 99 others); Fri, 12 Mar 2021 02:56:31 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:47124 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S231423AbhCLHzz (ORCPT ); Fri, 12 Mar 2021 02:55:55 -0500 X-UUID: 586fc1bc010540008d09236ff8ba0f7a-20210312 X-UUID: 586fc1bc010540008d09236ff8ba0f7a-20210312 Received: from mtkmrs01.mediatek.inc [(172.21.131.159)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1722308573; Fri, 12 Mar 2021 15:55:53 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 12 Mar 2021 15:55:51 +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; Fri, 12 Mar 2021 15:55:50 +0800 From: Irui Wang To: Alexandre Courbot , Hans Verkuil , Tiffany Lin , Andrew-CT Chen , Mauro Carvalho Chehab , Rob Herring , Matthias Brugger , Tomasz Figa , Hsin-Yi Wang , Maoguang Meng , Longfei Wang , Yunfei Dong , CC: Irui Wang , , , , , , Subject: [PATCH v2,2/5] media: mtk-vcodec: Support 4GB~8GB range iova space for venc Date: Fri, 12 Mar 2021 15:55:39 +0800 Message-ID: <20210312075542.5503-3-irui.wang@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210312075542.5503-1-irui.wang@mediatek.com> References: <20210312075542.5503-1-irui.wang@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 Uses the dma_set_mask_and_coherent helper to set venc DMA bit mask to support 4GB~8GB range iova space. Signed-off-by: Irui Wang --- drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c index 7d7b8cfc2cc5..26b089e81213 100644 --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c @@ -361,6 +361,9 @@ static int mtk_vcodec_probe(struct platform_device *pdev) goto err_event_workq; } + if (of_get_property(pdev->dev.of_node, "dma-ranges", NULL)) + dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(34)); + ret = video_register_device(vfd_enc, VFL_TYPE_VIDEO, 1); if (ret) { mtk_v4l2_err("Failed to register video device"); -- 2.18.0