From patchwork Thu Jan 9 13:35:00 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?S3lyaWUgV3UgKOWQtOaZlyk=?= X-Patchwork-Id: 13932553 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D290FE77197 for ; Thu, 9 Jan 2025 13:38:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding:MIME-Version: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:In-Reply-To:References:List-Owner; bh=Q7IqtAzsqRyq2MV5yJRjbh9Wk4+9FAZ/gH0fjGvtH5o=; b=XKBDuGnR881nquOWXE719BKYZg TEE2aIYZ9fu/axn1ppq2T8OfeJy8E3OsiA8UQyLozgKOopvYk0M1XIrmeyMg2dyMNV8nRQutAWQqw RptHefNh5cWzgKH7G2YS9kS86djLjwYMEMYLBq639yjcFti5FuWWpMs5oTMDN/sDsh0GOkeKlS2F4 MitNJd2HCRG8vLfhGyJ/L2xKCmmu/XXCbAyHbbLcg5wpvA5+hyVphq3WaiHwEwfnp1v+mPCmJYBlE Pqd73MCKBr45S6UBDj6RR/jx9iQQ215DawsfaVbDsV63YqQmdBAQ5rNfw1moOtgMcluuFBwac/zti OhpnAIVA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tVsjZ-0000000C3gs-48hn; Thu, 09 Jan 2025 13:38:01 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tVshA-0000000C2u4-3K8a; Thu, 09 Jan 2025 13:35:34 +0000 X-UUID: 95b18bc0ce8e11ef9048ed6ed365623b-20250109 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:Message-ID:Date:Subject:CC:To:From; bh=Q7IqtAzsqRyq2MV5yJRjbh9Wk4+9FAZ/gH0fjGvtH5o=; b=OxNzW9unI0DY2kGLvksThCOmnVwI9xxsCSzS0cTx6SCGCStgNv/hyiTfF0ZLfcNkBLdz8BSUepxenlSa9/TgXSYSFCuE4n51OVc/SQxujXuoEeXYEOVQgp3Z6J0/CllLXFp9pafY0j7Hs05g1cIHjhzkRS1OmWrY49E6JmO8XG4=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.46,REQID:dd30f012-0fed-41d6-bf5a-4b9cb6ad6f74,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:60aa074,CLOUDID:bcf8a037-e11c-4c1a-89f7-e7a032832c40,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0|50,EDM:-3,IP:ni l,URL:1,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES :1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR,TF_CID_SPAM_ULS X-UUID: 95b18bc0ce8e11ef9048ed6ed365623b-20250109 Received: from mtkmbs09n2.mediatek.inc [(172.21.101.94)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 780352536; Thu, 09 Jan 2025 06:35:26 -0700 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by mtkmbs11n2.mediatek.inc (172.21.101.187) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Thu, 9 Jan 2025 21:35:23 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs11n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Thu, 9 Jan 2025 21:35:22 +0800 From: kyrie.wu To: Hans Verkuil , Mauro Carvalho Chehab , Rob Herring , Matthias Brugger , Tzung-Bi Shih CC: Rob Herring , Krzysztof Kozlowski , Conor Dooley , AngeloGioacchino Del Regno , Bin Liu , kyrie wu , , , , , , kyrie.wu Subject: [V1,00/12] Enable jpeg enc & dec multi-hardwares for MT8196 Date: Thu, 9 Jan 2025 21:35:00 +0800 Message-ID: <20250109133513.20151-1-kyrie.wu@mediatek.com> X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250109_053532_833429_E664C0AE X-CRM114-Status: UNSURE ( 9.76 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org This series adds support for mt8196 multi-hardwares jpeg enc & dec, by first adding mt8196 jpegdec and jpegenc compatible to install kernel driver. Add smmu setting to support smmu and iommu at the same time. Secondly refactor buffer and clock setting to support multi-hw jpeg working. Lastly, fix some bugs, including resolution change handleing, stop streaming sw flow and others. This series has been tested with MT8196 tast test. Encoding and decoding worked for this chip. Patches 1-3 Adds jpeg encoder and decoder compatible. Patches 4 add jpeg smmu sid setting. Patches 5 fix jpeg hw count setting to support different chips. Patches 6 refactor jpeg buffer payload setting to handle buffer size bug while resolution changed. Patches 7 reconstruct jpeg dst buffer layout. Patches 8 fix multi-core stop streaming flow Patches 9 refactor multi-core clk suspend/resume setting Patches 10 fix decoding buffer number setting timing issue Patches 11 refactor decoding resolution change operation Patches 12 fix remove buffer operation --- This series patches dependent on: [1] https://patchwork.kernel.org/project/linux-mediatek/patch/20240808092555.12999-1-jianhua.lin@mediatek.com/ kyrie.wu (11): dt-bindings: mediatek: Add mediatek, mt8196-jpgdec compatible dt-bindings: mediatek: Add mediatek, mt8196-jpgenc compatible media: mediatek: jpeg: add jpeg compatible media: mediatek: jpeg: add jpeg smmu sid setting media: mediatek: jpeg: fix jpeg hw count setting media: mediatek: jpeg: refactor jpeg buffer payload setting media: mediatek: jpeg: refactor jpeg dst buffer layout media: mediatek: jpeg: fix stop streaming flow for multi-core media: mediatek: jpeg: refactor multi-core clk suspend and resume setting media: mediatek: jpeg: fix decoding buffer number setting timing issue media: mediatek: jpeg: refactor decoding resolution change operation media: mediatek: jpeg: fix remove buffer operation for multi-core ....yaml => mediatek,multi-core-jpegdec.yaml} | 10 +- ....yaml => mediatek,multi-core-jpegenc.yaml} | 10 +- .../platform/mediatek/jpeg/mtk_jpeg_core.c | 126 ++++++++++++------ .../platform/mediatek/jpeg/mtk_jpeg_core.h | 17 ++- .../platform/mediatek/jpeg/mtk_jpeg_dec_hw.c | 116 +++++++++++++++- .../platform/mediatek/jpeg/mtk_jpeg_dec_hw.h | 4 + .../platform/mediatek/jpeg/mtk_jpeg_enc_hw.c | 113 +++++++++++++++- .../platform/mediatek/jpeg/mtk_jpeg_enc_hw.h | 4 + 8 files changed, 343 insertions(+), 57 deletions(-) rename Documentation/devicetree/bindings/media/{mediatek,mt8195-jpegdec.yaml => mediatek,multi-core-jpegdec.yaml} (95%) rename Documentation/devicetree/bindings/media/{mediatek,mt8195-jpegenc.yaml => mediatek,multi-core-jpegenc.yaml} (94%)