From patchwork Fri May 21 07:01:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Irui Wang X-Patchwork-Id: 12272393 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 23B81C433ED for ; Fri, 21 May 2021 08:48:42 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AA90761363 for ; Fri, 21 May 2021 08:48:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AA90761363 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=LNKh9Pj+upZ0koyvBzOM20rjW0Y42d1u5X05zAr7Hig=; b=asUl4iyAC9N7ByTmTANEpwUKzF TwGhy9JLFqR4N5ZoUyiZTayLp0FfeWR9B6H1M97AzCXu36Dvv8LcnBT4QRoL6ddD6NekZsk0TNcKF UCs87NGho5Hc/blweZ0/hOC/Sx5cC6OgBaVFpWfhk9uEorHX51uHvaQvUxrPblNpybWE9QbEsniuS 2u7LaCiQywjUTYJ9OVYUnMrd9xKqp5XdKqCN/WWUnMiHO1CsyqaXWozcCn03RfRBcwK9Si03KTg07 CshDUw5h5rN7HODSLKIB9nP+oaMGG61ShtDU143UJYpmMVgON3I6rxmWgniyhKsTfEsQVzTDC+S80 5kx+dfBA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lk0n8-004VCp-TD; Fri, 21 May 2021 08:45:59 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lk0mh-004V6R-TZ; Fri, 21 May 2021 08:45:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC: To:From:Sender:Reply-To:Content-ID:Content-Description; bh=d2NRHblndJP67p32XPJ4/BDZ/uZudWQLIOcx3bibWTk=; b=x8sn/rhU3RKvugvw7y7U3NIJT2 OF6nS2E5br0NsfuBVWPiiIiQm4AZUo4qxA841HyGzSV9Nu8D5xznILVa8TDEwuHI9dq/Gh5f0vb8r LPi2Nm2bok1E2GFB+e+/Tk1LtZLrzWsDscio7fe1wC9MxJGcT9J79i429xlUqY3Ot03epHIGJRLZk 1KHQmDnP9FkaYOJ0AcId4hme2/5dw4v5Tes3GF4snKlINv4QZj/7S5mxxC06CtMwO6j5LxNnwpdeN LYmBKN9E7KQJYwWZNJJ1HQxZDhnu+SqAkfg/h3BDyETmW65lJdczpaUFMF2J9WiVfwQznLEyTywPw TSMkyQlg==; Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lk0mf-00GxRt-FJ; Fri, 21 May 2021 08:45:30 +0000 X-UUID: 377ffd5f7da7452799db344ce1f3d797-20210521 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=d2NRHblndJP67p32XPJ4/BDZ/uZudWQLIOcx3bibWTk=; b=ZEbDwnGDmnk4RZSbCZZTqd8v9BCcjyFjIJoMaQ8wCJEnrgEWL7lQkRvNksQfneThx62XAyph8v9xOxgdOH8kkpHRAakT9/eo7HoJtFErlIDOwrg1NCK3eMi5rIB2jn8wsOsX62gHfjB7nkZZO7f0zeZSNaYIV1l2OPhxyYq8WyE=; X-UUID: 377ffd5f7da7452799db344ce1f3d797-20210521 Received: from mtkcas68.mediatek.inc [(172.29.94.19)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1513105778; Fri, 21 May 2021 00:02:15 -0700 Received: from MTKMBS01N2.mediatek.inc (172.21.101.79) by MTKMBS62N2.mediatek.inc (172.29.193.42) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 21 May 2021 00:02:13 -0700 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs01n2.mediatek.inc (172.21.101.79) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 21 May 2021 15:02:00 +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; Fri, 21 May 2021 15:01:59 +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" , Yong Wu CC: Yunfei Dong , Fritz Koenig , Tzung-Bi Shih , Irui Wang , , , , , , , Subject: [PATCH v4, 3/6] media: mtk-vcodec: Support 4GB~8GB range iova space for venc Date: Fri, 21 May 2021 15:01:36 +0800 Message-ID: <20210521070139.20644-4-irui.wang@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210521070139.20644-1-irui.wang@mediatek.com> References: <20210521070139.20644-1-irui.wang@mediatek.com> MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210521_014529_548188_539575E7 X-CRM114-Status: GOOD ( 13.35 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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");