Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1578486pxj; Fri, 4 Jun 2021 19:32:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgj3XnZXTIZkZGygULRssQ0s5UAbo1wYwnpyij26NCSr4jgsUcI8pA+Uht4cqp3veyjmpt X-Received: by 2002:a05:6402:548:: with SMTP id i8mr8094231edx.344.1622860363008; Fri, 04 Jun 2021 19:32:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622860363; cv=none; d=google.com; s=arc-20160816; b=SG8+ROTJ9Fd6J+ErmVqD3q3pgb7YUfumLDuzUCDgvEZybOscV+djNhhnvCqUDZDPpQ 2MQODn4UFuKv65WZQGdw2tAYYc8U+3BxSCWkGyBUDJj2AT7tlQLcvd+kDrrIMJ7Wk927 q4eNn8DlfJ4wShSHvbTbq7M82vl+mFQmdpEeo/49UGCYcAe7jWBqydaZs7Pa56Nxt6Jy ffAMDtyNhjOOgx5i5/xKejCE9jVdANmnvU+bIy9e0wMSTAKCzRLmZaWCs6PDbXKzYMfv ClTlle6FZ3X4HdmE++ACSlTJ7tUXrOKj5caCJUmuPMyQZnE8wXJQD3mH3aNAmkxor03j GO+A== 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=Oq1hNPq1VsxSXp0bh0TIvWuNmVIngjggkwE8bEdq1DY=; b=hlAIiiICEmbHbekDdAqDSHauE8gWS919J4Tvii1dN711BYY2Up7tR1In21+f4XdnoR wDIR+zToUzbG/HloCZe7tkqw3tJ89FlBFHq5XhX2u5HVqjOCuXEckpErl2Q0OuGhbgiy DVfIM7nMVYLXqznMvn1qVni9+h+97V8jEDMNgODKmddJhCj1pH7l2ecXAowdlPOrpL6M LsnrrupJFJkonaVux6nOPxdTae7vaW1wDKbvSwbLu5Rn92z8/wODpEJnuSykfDNlxkCn udg+ajvr62DsAmdDF2HhmOKPpEjIwrGC7NvHytsBZ447O7T6VxSBdS6HSOHwL0WrK/hc FcHA== 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 x10si5931416eji.476.2021.06.04.19.32.20; Fri, 04 Jun 2021 19:32:42 -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 S231601AbhFECbZ (ORCPT + 99 others); Fri, 4 Jun 2021 22:31:25 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:37590 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S231642AbhFECbX (ORCPT ); Fri, 4 Jun 2021 22:31:23 -0400 X-UUID: 33289062065e48228e3348f0124d9e27-20210605 X-UUID: 33289062065e48228e3348f0124d9e27-20210605 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 2008772008; Sat, 05 Jun 2021 10:29:32 +0800 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs01n1.mediatek.inc (172.21.101.68) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sat, 5 Jun 2021 10:29:30 +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; Sat, 5 Jun 2021 10:29:29 +0800 From: Irui Wang To: Alexandre Courbot , Hans Verkuil , Tzung-Bi Shih , Tiffany Lin , Andrew-CT Chen , Mauro Carvalho Chehab , Rob Herring , Matthias Brugger , Tomasz Figa , Yong Wu CC: Hsin-Yi Wang , Maoguang Meng , Longfei Wang , Yunfei Dong , Fritz Koenig , Irui Wang , , , , , , , Subject: [PATCH v5,3/6] media: mtk-vcodec: Support 34bits dma address for venc Date: Sat, 5 Jun 2021 10:29:15 +0800 Message-ID: <20210605022918.4213-4-irui.wang@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210605022918.4213-1-irui.wang@mediatek.com> References: <20210605022918.4213-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 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 VENC actually locate, it depends on the dma-ranges property of venc dtsi node. 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