Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1393763pxj; Fri, 21 May 2021 13:08:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJza9JbRS0o8ORQ04sFYGSxC2pnppAmKFX6+b1TOGzUb+tgjwUhODTYz28QjECtaDQQJtk+4 X-Received: by 2002:a92:dd89:: with SMTP id g9mr615875iln.209.1621627739131; Fri, 21 May 2021 13:08:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621627739; cv=none; d=google.com; s=arc-20160816; b=xaFzwezm9QbcrWvJGegSAtEPlihBM22exF/jTGNd6fBUy4vslLFFQeR+DTYfQP46Z9 BqGaqd3+gtqZN8A8rYDl53dMfZVveXMu+f8JOX6L3LlchmVhVVBCCLvKpR4eJ+AVr51n 6R72r+urOP8Su4LJRMK9hDtc5NF1S5ZLWo/DLkXYZSolPs8vlSQXhAXHqIgktPB3j6Bw izbJXC18j2+6fBfhK7gd2/8wBV4SPqyEk90f0a2Kc+2AsxsXYjVoUULZ4uzV9pbVodkg Yo3+zrBV2yMbnIfYgZ6A2NWkgqyX2LZdQDX3egKnfoK4nVJAlY9ZwPyJVz38i59C624o oZwA== 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=5t+sd5wf7rc37q3bBRMm3+EPIXlYssXDXrst2m2LgfU=; b=cIwBPvDIywau1go+gYPES/hfVssZoTEEtpf0w3GyuoeLMgdG1ytNjdEELwe7B4SVSp cBJs0Z2Cd0nl+2Atr8X97qmneDdetrk9GAv/z11cgdOaPIuKE5LV+eNeAo1okZp9UgCC 655wpqOM6kh1F7CUj7nL6tzE+bi1Kb5eFOZW8gHyITTXa6fArkNY2EnFANhOo/v3JgKr Fy+4D1fpImnL9uSXEPsqvzDk2qpciWjAGekPdXYz+oewHPCbzkSAZ59l5RJTZkJthnWc ZdJk33aLB9PJIoarwv7an8064T1goaqBIf8JcdCYJqNgPRWWVyvWORNjW/ITA2jNjBwf TBRA== 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 p9si6504250iov.92.2021.05.21.13.08.46; Fri, 21 May 2021 13:08:59 -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 S234856AbhEUHDf (ORCPT + 99 others); Fri, 21 May 2021 03:03:35 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:36031 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S234672AbhEUHD3 (ORCPT ); Fri, 21 May 2021 03:03:29 -0400 X-UUID: 1f0f8977ed3d40e2af585399d97ad0c7-20210521 X-UUID: 1f0f8977ed3d40e2af585399d97ad0c7-20210521 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 637408379; Fri, 21 May 2021 15:02:02 +0800 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 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.18.0