From patchwork Fri Sep 24 07:45:38 2021 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: 12514309 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F19CC433EF for ; Fri, 24 Sep 2021 07:48:28 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id E9F4A60EE3 for ; Fri, 24 Sep 2021 07:48:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E9F4A60EE3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id: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=2pIJDZzdS74hqbmhy2OXLlxvQkIdW3Q3mDjExPYtMjY=; b=gJNBbAn4CPfd4o lk1VpK7gtxA1dNv2/mxPF8l0U+Ts9eA/LmVbLEKA9ShSS0EpQGUtCVTbmndkEqRPydP9C5U5U16kq yovLho/4wC5dkudmaEl1acrmVunbjzDTYUPhcoCtkIr4yTH7hyPw0TlvvGBQ6sAfEO41bAqkq8p+o izMv0jc9YQ/0iy5OvB13CJbDtJiw5vwQm/XrHteeCc1Ji5fIIcnKyh8Hk8yNuhtXZWRSfLgLxeAor 4ps6k0cclzX4IVij1yaOWJ9NQBb1LqcPVA4C+wjFN5I9rFC9sXJkjrtylZqKxaJCYea29cW8Ebeqh 2CkMccIyldQGChauqKfQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mTfuD-00DMvG-B1; Fri, 24 Sep 2021 07:46:01 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mTfu1-00DMqi-32; Fri, 24 Sep 2021 07:45:50 +0000 X-UUID: 86f6d8b0ae04436c8e61d1203caffcfd-20210924 X-UUID: 86f6d8b0ae04436c8e61d1203caffcfd-20210924 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1082488148; Fri, 24 Sep 2021 00:45:46 -0700 Received: from mtkmbs07n1.mediatek.inc (172.21.101.16) by MTKMBS62N1.mediatek.inc (172.29.193.41) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 24 Sep 2021 00:45:44 -0700 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 24 Sep 2021 15:45:43 +0800 Received: from localhost.localdomain (10.17.3.154) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 24 Sep 2021 15:45:42 +0800 From: kyrie.wu To: Hans Verkuil , Mauro Carvalho Chehab , Rob Herring , Tomasz Figa , Matthias Brugger , "Tzung-Bi Shih" CC: , , , , , , , , , , Subject: [PATCH V4,0/5] Support jpeg encoder for MT8195 Date: Fri, 24 Sep 2021 15:45:38 +0800 Message-ID: <1632469543-27345-1-git-send-email-kyrie.wu@mediatek.com> X-Mailer: git-send-email 2.6.4 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210924_004549_165270_800E12F0 X-CRM114-Status: GOOD ( 12.72 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org MT8195 has two jpeg encoding HW, each one has its own power-domain, clock, interrupt, register base. The two jpeg encoding HW can work together to achieve higher performance. Generally, one HW needs to register one device node, and the APP operates the HW through the device node. If there are multiple HWs, the multiple device node needs to be registered. At this time, the app needs to design software logic to use multiple HWs in parallel, which will undoubtedly increase the difficulty of app development and weaken its compatibility. These serial patches use the component framework to achieve the purpose of using multiple HWs through only one device node. About the component framework Block Diagram, please check below: Master(device node) ________|_________________________ | | | component0(HW0) component1(HW1) component2(HW2) ...... As above, the component framework is similar to a master-component two level architecture. Both master and component have the compatible attribute in the device tree, and the corresponding platform driver structure is defined in the driver. Therefore, when the compatible attribute matches, the corresponding probe function will be called. In the probe function of component, operations such as initialization clock, remmap register base, registration interrupt will be performed. And add the component to a component linked list to find the corresponding master. In the probe function of the master, the device node will be registered, and the master will be added to a master linked list to find the corresponding component. After the master matches the component, it will obtain the clock, interrupt, register base and other resources in the component, and operate the HW through these resources. At the same time, multiple HWs software function interfaces are designed in the master driver. kyrie.wu (5): dt-bindings: mediatek: Add mediatek, mt8195-jpgenc compatible media: mtk-jpegenc: Use component framework to manage each hardware media: mtk-jpegenc: add jpegenc timeout func interface media: mtk-jpegenc: add jpeg encode worker interface media: mtk-jpegenc: add output pic reorder interface .../bindings/media/mediatek-jpeg-encoder.yaml | 3 + drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c | 395 ++++++++++++++++++--- drivers/media/platform/mtk-jpeg/mtk_jpeg_core.h | 79 +++++ drivers/media/platform/mtk-jpeg/mtk_jpeg_enc_hw.c | 298 ++++++++++++++++ 4 files changed, 730 insertions(+), 45 deletions(-) --- 2.6.4