Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4270414pxv; Tue, 27 Jul 2021 03:13:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9lWY9pEwYrYf7ni7CzmZauTARTTYWx56p4CAqIVjLZV+TKuYYzPOZ8HobeZelILKP5xKs X-Received: by 2002:a05:6602:2814:: with SMTP id d20mr18213326ioe.65.1627380810521; Tue, 27 Jul 2021 03:13:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627380810; cv=none; d=google.com; s=arc-20160816; b=Op/fMCH1nrDPReB29dEO79SRuqrghIvucfc+vHifiXfHORbAjXClaYxr5X1dkrCGm/ CoHbUA4zNt75IJ3qcE/8IOnPOvlIlWkhlEB3c6+z0F72iGmmluGfkc9Bi9o070aJbFJL A3waw8Os0FfYm/amx7IrhGMivxpWLlAneVZahr83+FKTD2G3VlkowiQIVz4LuCMyo+bO EqHXCoINBT1SwslUvQaorc8eqVPrRJBiusw8vtDX1/mdPTrfdT+5+v83o78/o5U0Khnk pSZMb2vlsDCfTEkcmR+oSLkt4tjwpuN0I+8q54d9bHQXp3kwUkrazqAH6beaTtzmYSzH FQAQ== 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=0xwpmYh4CPL6uA/O7jj5CktM/w99dCQnp9GYU8Z+frw=; b=UEdFgeA/2CXgjMnA4RrM7SFU84xD5/NZEeWzsp/FBVHn27+XwIePW5bmqPhWENxqQi tsmyc+cpBMBSgTlljo+HOIIDHmcEf5bGH4Bl1B45IgQqWmmXkn37reyQAGGPobTSDUNb mQztZFmIq0aFLbT9y7iYn77ClDSpMwY8L9pHPMj+RmJfwzbWDabf+VDOPAN/rk5fXK3I +QVID/B4NG2VvbPDyi4IQL/YAmet9R1Z0R0bojxb26hdYv+eqa221AiFHJo+wE4T/m32 NUQEMnT9mVGQ3w9XbyqGkm5tgkkgiI3J5dXQFhfJFOVnlUc4uLAFFeMHsM4LwOnwJ04I CXkg== 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 e11si3534437iow.68.2021.07.27.03.13.19; Tue, 27 Jul 2021 03:13:30 -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 S236469AbhG0KME (ORCPT + 99 others); Tue, 27 Jul 2021 06:12:04 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:43996 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S236290AbhG0KLr (ORCPT ); Tue, 27 Jul 2021 06:11:47 -0400 X-UUID: 1308ad5353e642d6abede9dde7a91e47-20210727 X-UUID: 1308ad5353e642d6abede9dde7a91e47-20210727 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 606548631; Tue, 27 Jul 2021 18:11:43 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 27 Jul 2021 18:11:41 +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; Tue, 27 Jul 2021 18:11:40 +0800 From: Yunfei Dong To: Yunfei Dong , Alexandre Courbot , Hans Verkuil , Tzung-Bi Shih , Tiffany Lin , Andrew-CT Chen , Mauro Carvalho Chehab , Rob Herring , Matthias Brugger , Tomasz Figa CC: Hsin-Yi Wang , Fritz Koenig , Irui Wang , , , , , , , Subject: [PATCH v3, 12/15] media: mtk-vcodec: Support 34bits dma address for vdec Date: Tue, 27 Jul 2021 18:10:48 +0800 Message-ID: <20210727101051.24418-13-yunfei.dong@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210727101051.24418-1-yunfei.dong@mediatek.com> References: <20210727101051.24418-1-yunfei.dong@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 vdec 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 VDEC actually locate, it depends on the dma-ranges property of vdec dtsi node. Signed-off-by: Yunfei Dong --- v3: no changes --- drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c index d0006da10df6..27de22e17a5a 100644 --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c @@ -434,6 +434,9 @@ static int mtk_vcodec_probe(struct platform_device *pdev) } } + if (of_get_property(pdev->dev.of_node, "dma-ranges", NULL)) + dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(34)); + for (i = 0; i < MTK_VDEC_HW_MAX; i++) mutex_init(&dev->dec_mutex[i]); mutex_init(&dev->dev_mutex); -- 2.25.1