Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2234197pxb; Mon, 12 Apr 2021 18:55:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZv1dcerS5sReou5KsLLfEtxCVVoB41Qv8O4lYzcsC/Hhz/5EHb6rfW7VX9ICUHpSbyt2C X-Received: by 2002:aa7:d2da:: with SMTP id k26mr19087711edr.156.1618278925391; Mon, 12 Apr 2021 18:55:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618278925; cv=none; d=google.com; s=arc-20160816; b=Tbp8eJpLsN3+E3khSXzfkHOW7tl78CNkdajsYiOYJeot1TpjEGy0opVDvGfaiOeuMa ghAnyp0/qYDB6Q0E686bWTKR2ODxXSCIKDB4j/Dio0Z5H1cxzCpdV1qdAlUzK7le1sbc DxZzhxY5MkNfRiybIz6QmRoSUve4C+igpkZG+ob1myiWd/h9lY5t41hq9UNiQgdJWOL8 nk8f/NwXzUzHZSpUwj0YlVMRwMu1up2YXIZM3/IduqKoCjmR8lSwREjRwRwA3pkpKFiW wF7hPVGOPRKfHzxs+NMuUz7KOgSLcn1/pQ7RCjK3MuDBzU2Op40rBbBhcVwmuF/1PSVs LENw== 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=vEkaWLOxQUt8aFzcvTDU6LgjoRwXc9UMnt7q1PK/aPE=; b=LGE6EfesJCM2LlVSvBVliyZ6bKwbOpaJioKF3yArtHa/J306+dc+7jX53HoyNvv6r5 L1oDnBz5FavlshwIcepHwhS13pmpqkFwOawe//7SKKs/PJfrTRBrcmBiJ9BBZ6mEAJ4X bBET+zaMzGgUdJKxgKnWmkeNDOeLuhD5TSf8tOUakTK6BEG1c+NVVNu+6b+gjvIIiruK CAcPCsJavN9XMV5oAoaKMuJ+CVc3bAQFs4DK55VlsYBGZUaM+PwuDNEPt9+pU16bi5c8 K8+b3ofhCKrscEkf94RPQwncrAxWt9wrqUg8HltlSvouazRRppVYt5rVMSbLzonVgCTz LQUg== 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 z2si8945585edb.287.2021.04.12.18.55.02; Mon, 12 Apr 2021 18:55:25 -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 S241309AbhDLMqg (ORCPT + 99 others); Mon, 12 Apr 2021 08:46:36 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:54470 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S241296AbhDLMqe (ORCPT ); Mon, 12 Apr 2021 08:46:34 -0400 X-UUID: d925d6448db841f391f54f2237976e25-20210412 X-UUID: d925d6448db841f391f54f2237976e25-20210412 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 282938753; Mon, 12 Apr 2021 20:46:13 +0800 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 12 Apr 2021 20:46:11 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 12 Apr 2021 20:46:10 +0800 From: Irui Wang To: Alexandre Courbot , Hans Verkuil , Andrew-CT Chen , Mauro Carvalho Chehab , Rob Herring , Matthias Brugger CC: Tiffany Lin , Fritz Koenig , Tzung-Bi Shih , Maoguang Meng , Longfei Wang , Yunfei Dong , Irui Wang , , , , , , , Subject: [PATCH v3,3/6] media: mtk-vcodec: Support 4GB~8GB range iova space for venc Date: Mon, 12 Apr 2021 20:45:52 +0800 Message-ID: <20210412124555.26897-4-irui.wang@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210412124555.26897-1-irui.wang@mediatek.com> References: <20210412124555.26897-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 Use 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.25.1