From patchwork Tue Apr 11 09:31:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yong Wu X-Patchwork-Id: 81839 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2443390vqo; Tue, 11 Apr 2023 02:37:28 -0700 (PDT) X-Google-Smtp-Source: AKy350aTDaYHseKgz+cOiSkUTSOqRQD0EKWBkfNj/3w4btI/HQO8N3gl2LxTmNw2Nkt6Pfr7VAiP X-Received: by 2002:a17:902:da90:b0:1a6:47aa:dbd7 with SMTP id j16-20020a170902da9000b001a647aadbd7mr5482144plx.53.1681205848395; Tue, 11 Apr 2023 02:37:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681205848; cv=none; d=google.com; s=arc-20160816; b=zE5w4bKiW/NS7ySWqORBjBDn5BHqQpqYYjBuel/66BPc59O6CKQ7jAOR4CxycLY8qx /xwlUHuhj5Zy4s3D1ZBeqK5DVQWW2GjbV/Un/EA5kT5MBBuucsZqzkih5O4lPyVjadLf vomsozIOOpDrhhfHhDNGtrRqH3n55tPEHu4ovO9907xJAWubuCcFcmUeIdL1+ihVZ5Xk mFGsnekDNpO48N9lCSC6+aFE7TcJV9P93q6mzsf1vNWyEVnI3TYxznnnMeGepS/gnvw2 7tL3q1Mp6H68bRzWNjzwAYQbTk7Sbekv7UZ8TiX9y9JIa116a3Ix1vqsqPrQi1QdLzUw mz0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=R0k5lQHHRLml/ji++14oXkm9cmht5KGHr7AnrObcMd4=; b=ImhJ+IGp8s/iNoBDmUoIs/4Zy8vMSK4+hUDdPyV6w8FlC0AxcxMUK4pOv9QNMMei5k dDoSitaCdfgwMY89YmqYQCh8oaaR0gJIcJCGTj9Xb+3Zan8016h9GpUlCqGh5V4Uo7n0 18q53VGoATp5mV3arL1xfWiXc7ocFvjr/e0DrnvW3pgQ3HfKcQqbb+SN3oMJodsRrtf8 M3i6Tvp0UwLArQKADBRcXtuyrSsJELbArXzbtj9F1U8USnIFjoDYxhBLk2PGxOa5r/85 OhL1eCA0hz1X0yL6zcXB27vrgFJgG0/0eDI8mWXBTQoISGyVUKoS5YovzeNQ6QvJ6eml 6hAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=UOyxwXL8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l11-20020a170903120b00b001a1b5dc97f0si14532820plh.270.2023.04.11.02.37.16; Tue, 11 Apr 2023 02:37:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=UOyxwXL8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229478AbjDKJew (ORCPT + 99 others); Tue, 11 Apr 2023 05:34:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230145AbjDKJeQ (ORCPT ); Tue, 11 Apr 2023 05:34:16 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ADDB93C25; Tue, 11 Apr 2023 02:33:57 -0700 (PDT) X-UUID: f97ced10d84b11eda9a90f0bb45854f4-20230411 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=R0k5lQHHRLml/ji++14oXkm9cmht5KGHr7AnrObcMd4=; b=UOyxwXL88mhRAvK3zmw+lbZBjPtgAOXHO3PZMhye+TysyK2pOQXdgJmfOUUAwxAZY9wAAx5AT2Q0PK95TAHasoilJ3VrBFV5PFQo+T0xshqMFCmyrWfxN+esexQxevEiKxAMcmGOLnb/XXIkCCCGlh+aPftlRT45B/UgQsw5Twg=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.22,REQID:a0fea9d4-b872-423d-bddb-f33fda861715,IP:0,U RL:0,TC:0,Content:-25,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:-25 X-CID-META: VersionHash:120426c,CLOUDID:5270ae83-cd9c-45f5-8134-710979e3df0e,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:11|1,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-UUID: f97ced10d84b11eda9a90f0bb45854f4-20230411 Received: from mtkmbs10n2.mediatek.inc [(172.21.101.183)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 264596907; Tue, 11 Apr 2023 17:33:53 +0800 Received: from mtkmbs11n1.mediatek.inc (172.21.101.185) by mtkmbs13n1.mediatek.inc (172.21.101.193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.25; Tue, 11 Apr 2023 17:33:52 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.25 via Frontend Transport; Tue, 11 Apr 2023 17:33:51 +0800 From: Yong Wu To: Joerg Roedel , Matthias Brugger , Mauro Carvalho Chehab , Rob Herring CC: Will Deacon , Robin Murphy , Krzysztof Kozlowski , Hans Verkuil , , , , , , , , AngeloGioacchino Del Regno , , , , Yunfei Dong , kyrie wu , , , , Yong Wu , Tiffany Lin , Andrew-CT Chen , irui wang Subject: [PATCH v7 11/14] media: mediatek: vcodec: Remove the setting for dma_mask Date: Tue, 11 Apr 2023 17:31:41 +0800 Message-ID: <20230411093144.2690-12-yong.wu@mediatek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230411093144.2690-1-yong.wu@mediatek.com> References: <20230411093144.2690-1-yong.wu@mediatek.com> MIME-Version: 1.0 X-MTK: N X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS, UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762872103356656545?= X-GMAIL-MSGID: =?utf-8?q?1762872103356656545?= In order to simplify the masters to set their respective dma masks, MTK IOMMU helps to centralize the processing. Because all the dma ranges is set in IOMMU, IOMMU knows well the dma mask requirements of masters. After this patch, the masters(codec here) code does not need care dma-ranges/dma_mask related information. Cc: Tiffany Lin Cc: Andrew-CT Chen Cc: Yunfei Dong Cc: Mauro Carvalho Chehab Cc: irui wang Signed-off-by: Yong Wu Reviewed-by: AngeloGioacchino Del Regno Acked-by: Hans Verkuil --- .../media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c | 8 -------- .../media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c | 3 --- 2 files changed, 11 deletions(-) diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c index 174a6eec2f54..11583405cf61 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c @@ -321,14 +321,6 @@ static int mtk_vcodec_probe(struct platform_device *pdev) } } - if (of_get_property(pdev->dev.of_node, "dma-ranges", NULL)) { - ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(34)); - if (ret) { - mtk_v4l2_err("Failed to set mask"); - goto err_core_workq; - } - } - for (i = 0; i < MTK_VDEC_HW_MAX; i++) mutex_init(&dev->dec_mutex[i]); mutex_init(&dev->dev_mutex); diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c index 9095186d5495..50e5571608cd 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c @@ -344,9 +344,6 @@ 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");