Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp8817451rwb; Thu, 24 Nov 2022 04:50:19 -0800 (PST) X-Google-Smtp-Source: AA0mqf5QzIR5GpjH9UX7syDcyjx/jAPtG5mR7K1mukK6rxhcJFzjDjFlwBsLYRDQ7LSBc4chOSEU X-Received: by 2002:a17:903:3295:b0:189:2b93:3faf with SMTP id jh21-20020a170903329500b001892b933fafmr13886888plb.108.1669294218760; Thu, 24 Nov 2022 04:50:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669294218; cv=none; d=google.com; s=arc-20160816; b=fAYIj7UNYQFdEfapF7gKhsrsZjiMJs5ATYsyxXkj9AcT9qUN3rHdwSuQ/CD/at1bbw vc47Drz8B0tDSsbyXPQ4pvTDkJe5azWaA0Wo57blaaqZ9o6X2WCR5MBU7bVbray4nKRg DRsVA5He7pTk1qz1W8VRbii51T/rVDNcfFxwjtHDVhrwb/j/6tO33QRA3Jmdmg9QwPN0 yWZ+RdFN9aDcnxSNNY6SjxSQ1bGvpy5sCdNtRPzb7Uo1VI8iuoxBINvXdOqDvlfZ7HMA dA/Ekf7TwiIhtoeV1KS9VxPo28IOKObnI1BrBrcz2InnDG6zBW8HHshHTGSUk4v4s+6H 9QGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=pUJpnX38MTUYdJw0+joE4HCfW+fYw9uYjfz54UOs6rY=; b=ZKfXfqAAEpYBAsm/Ix7JoAeVkAqCu6kT0C5AeDJicMAcwBtWVWD0cNFQZ/sHULScbQ NOYehCXxm6ceBvLy3rfEY6AEahfoX9kxwnhHiSDc/9gr3yBjPSUFtHP8e8QEc8yjkLIk ekSZ+hLEeIPdCtb6V1dXVlq2LfioIIDsTb7n8QGhlAEcGZIc836rJ39Ls+HzZayA425/ YUpV3w6q1GPLmRcvbzVTIaEpuooUFNr4Iz1IigJshqkrBZrgph7idZXJcpFGPEDFKKKo vthA8TSlNRjJM2TC4et3j1TbbHqtNMlimSZQN34FmfjwQctlztJYgU9NyrzgkrcCqEk/ cxdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=IxOfwUJw; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id iz17-20020a170902ef9100b001874910a2c6si853826plb.286.2022.11.24.04.50.06; Thu, 24 Nov 2022 04:50:18 -0800 (PST) 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=IxOfwUJw; 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 S229811AbiKXMjb (ORCPT + 87 others); Thu, 24 Nov 2022 07:39:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229776AbiKXMjQ (ORCPT ); Thu, 24 Nov 2022 07:39:16 -0500 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55F7E8B86D; Thu, 24 Nov 2022 04:39:11 -0800 (PST) X-UUID: 943fd13c9eaf4916b1d557f623f080ba-20221124 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=pUJpnX38MTUYdJw0+joE4HCfW+fYw9uYjfz54UOs6rY=; b=IxOfwUJwsr8+RVzVCQUx19639P0sl0PzjuISr2T3XRdlQ9DRhIiJOIElWejGjW6LaAqZ4MNiIPnu24ZmzNypTdO6KkslEevemS/lMEgou0h2P8T9j+yqT4fYCPenkVb6on3EqkuK7l9Wc/UjLTAXFYMx5kyw+hj3oAx1iGRm+4s=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.14,REQID:6cd35e87-1a9f-47bb-94ec-ad840e401f47,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:dcaaed0,CLOUDID:948c25dc-6ad4-42ff-91f3-18e0272db660,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:1,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0 X-UUID: 943fd13c9eaf4916b1d557f623f080ba-20221124 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 1081700785; Thu, 24 Nov 2022 20:39:02 +0800 Received: from mtkmbs11n1.mediatek.inc (172.21.101.185) by mtkmbs10n2.mediatek.inc (172.21.101.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.3; Thu, 24 Nov 2022 20:39:01 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Thu, 24 Nov 2022 20:39:01 +0800 From: Moudy Ho To: Mauro Carvalho Chehab , Matthias Brugger , Hans Verkuil CC: Chun-Kuang Hu , , , , , Moudy Ho Subject: [PATCH v4 0/9] Add support for multiple chips Date: Thu, 24 Nov 2022 20:38:50 +0800 Message-ID: <20221124123859.24395-1-moudy.ho@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS,UNPARSEABLE_RELAY autolearn=ham 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 Changes since v3: - Rebase on linux-next. - In the file "mtk-mdp3-m2m.c", use the limited resolution defined by each platform to replace the default format. - Add platform ID in driver data, and refine shared memory structure preprocessing. - Simplify the way to get mutex ID in function "mdp_path_subfrm_require". Changes since v2: - Depend on : [1] https://patchwork.kernel.org/project/linux-mediatek/list/?series=687004 - Split the shared memory header(mtk-img-ipi.h) by preprocessing instead, and classify the generic parts into "mtk-mdp3-type.h", and move chip-specific parts to"mt8183/mdp3-comp-mt8183.h". Changes since v1: - Depend on : [1] https://patchwork.kernel.org/project/linux-mediatek/list/?series=687004 - For hardware-specific structures in the shared memory header(mtk-img-ipi.h), split the relevant functions and structure definitions. Hi, To support multiple chips, a chip configuration header file needs to be created and the relevant information split and moved into it. The v4l2-compliance test results list is as follows: v4l2-compliance 1.23.0-4942, 32 bits, 32-bit time_t v4l2-compliance SHA: 4cf258c24026 2022-07-28 15:43:45 Compliance test for mtk-mdp3 device /dev/video0: Driver Info: Driver name : mtk-mdp3 Card type : MediaTek MDP3 Bus info : platform:14001000.mdp3-rdma0 Driver version : 6.1.0 Capabilities : 0x84204000 Video Memory-to-Memory Multiplanar Streaming Extended Pix Format Device Capabilities Device Caps : 0x04204000 Video Memory-to-Memory Multiplanar Streaming Extended Pix Format Required ioctls: test VIDIOC_QUERYCAP: OK test invalid ioctls: OK Allow for multiple opens: test second /dev/video0 open: OK test VIDIOC_QUERYCAP: OK test VIDIOC_G/S_PRIORITY: OK test for unlimited opens: OK Debug ioctls: test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported) test VIDIOC_LOG_STATUS: OK (Not Supported) Input ioctls: test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported) test VIDIOC_G/S_FREQUENCY: OK (Not Supported) test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported) test VIDIOC_ENUMAUDIO: OK (Not Supported) test VIDIOC_G/S/ENUMINPUT: OK (Not Supported) test VIDIOC_G/S_AUDIO: OK (Not Supported) Inputs: 0 Audio Inputs: 0 Tuners: 0 Output ioctls: test VIDIOC_G/S_MODULATOR: OK (Not Supported) test VIDIOC_G/S_FREQUENCY: OK (Not Supported) test VIDIOC_ENUMAUDOUT: OK (Not Supported) test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported) test VIDIOC_G/S_AUDOUT: OK (Not Supported) Outputs: 0 Audio Outputs: 0 Modulators: 0 Input/Output configuration ioctls: test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported) test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported) test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported) test VIDIOC_G/S_EDID: OK (Not Supported) Control ioctls: test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK test VIDIOC_QUERYCTRL: OK test VIDIOC_G/S_CTRL: OK test VIDIOC_G/S/TRY_EXT_CTRLS: OK test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK test VIDIOC_G/S_JPEGCOMP: OK (Not Supported) Standard Controls: 4 Private Controls: 0 Format ioctls: test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK test VIDIOC_G/S_PARM: OK (Not Supported) test VIDIOC_G_FBUF: OK (Not Supported) test VIDIOC_G_FMT: OK test VIDIOC_TRY_FMT: OK test VIDIOC_S_FMT: OK test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported) test Cropping: OK test Composing: OK test Scaling: OK Codec ioctls: test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported) test VIDIOC_G_ENC_INDEX: OK (Not Supported) test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported) Buffer ioctls: test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK test VIDIOC_EXPBUF: OK test Requests: OK (Not Supported) test TIME32/64: OK Test input 0: Streaming ioctls: test read/write: OK (Not Supported) test blocking wait: OK Video Capture Multiplanar: Captured 58 buffers test MMAP (no poll): OK Video Capture Multiplanar: Captured 58 buffers test MMAP (select): OK Video Capture Multiplanar: Captured 58 buffers test MMAP (epoll): OK test USERPTR (no poll): OK (Not Supported) test USERPTR (select): OK (Not Supported) test DMABUF: Cannot test, specify --expbuf-device Stream using all formats: (snip) Total for mtk-mdp3 device /dev/video0: 1592, Succeeded: 1592, Failed: 0, Warnings: 0 Moudy Ho (9): media: platform: mtk-mdp3: add chip configuration header file media: platform: mtk-mdp3: chip config split about component settings media: platform: mtk-mdp3: chip config split about subcomponents media: platform: mtk-mdp3: chip config split about color format media: platform: mtk-mdp3: chip config split about resolution limitations media: platform: mtk-mdp3: chip config split about pipe info media: platform: mtk-mdp3: extend mdp_color format for compressed mode media: platform: mtk-mdp3: Split general definitions used in MDP3 media: platform: mtk-mdp3: decompose hardware-related information in shared memory .../mediatek/mdp3/mt8183/mdp3-comp-mt8183.h | 144 +++++ .../mediatek/mdp3/mt8183/mdp3-plat-mt8183.h | 409 ++++++++++++++ .../platform/mediatek/mdp3/mtk-img-ipi.h | 186 +------ .../platform/mediatek/mdp3/mtk-mdp3-cmdq.c | 145 +++-- .../platform/mediatek/mdp3/mtk-mdp3-comp.c | 520 ++++++++++++------ .../platform/mediatek/mdp3/mtk-mdp3-comp.h | 24 +- .../platform/mediatek/mdp3/mtk-mdp3-core.c | 49 +- .../platform/mediatek/mdp3/mtk-mdp3-core.h | 14 + .../platform/mediatek/mdp3/mtk-mdp3-m2m.c | 15 +- .../platform/mediatek/mdp3/mtk-mdp3-regs.c | 283 +--------- .../platform/mediatek/mdp3/mtk-mdp3-regs.h | 214 +++---- .../platform/mediatek/mdp3/mtk-mdp3-type.h | 53 ++ 12 files changed, 1267 insertions(+), 789 deletions(-) create mode 100644 drivers/media/platform/mediatek/mdp3/mt8183/mdp3-comp-mt8183.h create mode 100644 drivers/media/platform/mediatek/mdp3/mt8183/mdp3-plat-mt8183.h create mode 100644 drivers/media/platform/mediatek/mdp3/mtk-mdp3-type.h -- 2.18.0