Message ID | 20230113064104.22402-1-moudy.ho@mediatek.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp122404wrt; Thu, 12 Jan 2023 22:59:17 -0800 (PST) X-Google-Smtp-Source: AMrXdXtXB1gkbTEsmXe4OpOrmj9fBf8Xi4RoW2nuudjTvGghXczNLMVnf9NmODlzXwZcMSpBLmVh X-Received: by 2002:a50:e606:0:b0:497:4f44:7eba with SMTP id y6-20020a50e606000000b004974f447ebamr19010561edm.26.1673593157733; Thu, 12 Jan 2023 22:59:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673593157; cv=none; d=google.com; s=arc-20160816; b=C4873QPatbEdGAlC5DH/nqLEM1K2hnhFBPLeAyCIPyZl3HlI458+jwI36RXIyGhap0 qSGQhcwqcUZJc9b092wy2YuHdpmx7C8S0wrpB+gX7Cpo82vIVhWHNvMpyVkSLdSt0j8W 4UlkTqonZ+BNv+WCf0ykCe1F1aKOWc1VtFLCi9TKqAYgelJwLtQsv3PeD5GjmBvBPc/s BYABpP5RgDrlCtrPFjFGG5HD18B8bro57xQfi/h7zHDz+FdSTCV9MvDZZXPUzuzIviTq Y3CQqDCW+ZRaTPBba7yik38QtrIWDztXSs/jYVHbsdV/e3jMR1N8RYvtBDTM5G02wZ27 4dEg== 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=z3jvBq8prIW+2nxTySolV2oTR+8wYM/Zd0sr863uT3o=; b=u8et2bwwJ0W3IX7qMsRHIy2yWvVDn8jqfDplTMJ7ndgn5u8JTMh/d31nI1d1K+SsXZ mAqQLFO+aUzT+Q/vthSrwkOKJc2rg5PhReMIaubOUc/HcWffDzahKS5LL85Lj1S1+OQj dQLnYgSOw/n5/8eJaDkDsf52PAuVqYsOWKCR/WEea/27CAngr+Sm8CutjDdfgsMcRzWR 2Pbc6Xg/PcPNx7T26tJ+/sPeZ9AOeAIqD7TaKif8t5PkGFG5n94GGGZtsl5xa4REf0Kh qMyA2n7KQ3L8W8SRy+PvMIWq2Hsq7cPN5F8QSgv3PF/P+JRoVQIH7jd6cGTYbl0p/zIM wQjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=UaAjTgBT; 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 ee38-20020a056402292600b004591f959c3bsi17495880edb.427.2023.01.12.22.58.53; Thu, 12 Jan 2023 22:59:17 -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=UaAjTgBT; 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 S241050AbjAMG5l (ORCPT <rfc822;zhuangel570@gmail.com> + 99 others); Fri, 13 Jan 2023 01:57:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240830AbjAMGzx (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 13 Jan 2023 01:55:53 -0500 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C05171494; Thu, 12 Jan 2023 22:41:12 -0800 (PST) X-UUID: 41e61f7e930d11eda06fc9ecc4dadd91-20230113 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=z3jvBq8prIW+2nxTySolV2oTR+8wYM/Zd0sr863uT3o=; b=UaAjTgBTe5X8cbCCJRF7WV8Oeo05dTL+FnMkvL5vq9b0YntASyWcV+3KVxGIUPE/IVIXOfRitJB56DPJ7DzrFoURR8rd/t7lqGn32pIM2GAm4zhWJciy6Qd3lzwyxZTTDYLNZgrLPh9gL5wvcrOfpe37QheOUxZmGLyX+90XvCU=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.17,REQID:061cbabb-8932-4146-b5ea-b6af25ba8275,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:543e81c,CLOUDID:27f0b5f5-ff42-4fb0-b929-626456a83c14,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,OSI:0,OSA:0 X-CID-BVR: 0,NGT X-UUID: 41e61f7e930d11eda06fc9ecc4dadd91-20230113 Received: from mtkmbs11n1.mediatek.inc [(172.21.101.185)] by mailgw01.mediatek.com (envelope-from <moudy.ho@mediatek.com>) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 2108194176; Fri, 13 Jan 2023 14:41:06 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.15; Fri, 13 Jan 2023 14:41:05 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Fri, 13 Jan 2023 14:41:06 +0800 From: Moudy Ho <moudy.ho@mediatek.com> To: Mauro Carvalho Chehab <mchehab@kernel.org>, Matthias Brugger <matthias.bgg@gmail.com>, Hans Verkuil <hverkuil-cisco@xs4all.nl> CC: Chun-Kuang Hu <chunkuang.hu@kernel.org>, <linux-media@vger.kernel.org>, <linux-mediatek@lists.infradead.org>, <linux-kernel@vger.kernel.org>, <Project_Global_Chrome_Upstream_Group@mediatek.com>, Moudy Ho <moudy.ho@mediatek.com> Subject: [PATCH v5 00/12] Add support for multiple chips Date: Fri, 13 Jan 2023 14:40:52 +0800 Message-ID: <20230113064104.22402-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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754889619387781953?= X-GMAIL-MSGID: =?utf-8?q?1754889619387781953?= |
Series |
Add support for multiple chips
|
|
Message
Moudy Ho (何宗原)
Jan. 13, 2023, 6:40 a.m. UTC
Changes since v4: - Rebase on linux-next. - Fix potential frame size overflow in "mtk-mdp3-regs.c". - Fix OOB in MDP3 component clocks in "mtk-mdp3-comp.*". - Reconfigure the shared memory between MDP3 kerenl and SCP. 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.2.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 (snip) test MMAP (no poll): OK (snip) test MMAP (select): OK (snip) 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: 1174, Succeeded: 1174, Failed: 0, Warnings: 0 Moudy Ho (12): media: platform: mtk-mdp3: fix potential frame size overflow in mdp_try_fmt_mplane() 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: dynamically allocate component clocks media: platform: mtk-mdp3: Split general definitions used in MDP3 media: platform: mtk-mdp3: decompose hardware-related information in shared memory media: platform: mtk-mdp3: reconfigure 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 | 188 +----- .../platform/mediatek/mdp3/mtk-mdp3-cmdq.c | 145 +++-- .../platform/mediatek/mdp3/mtk-mdp3-comp.c | 567 ++++++++++++------ .../platform/mediatek/mdp3/mtk-mdp3-comp.h | 27 +- .../platform/mediatek/mdp3/mtk-mdp3-core.c | 49 +- .../platform/mediatek/mdp3/mtk-mdp3-core.h | 18 +- .../platform/mediatek/mdp3/mtk-mdp3-m2m.c | 28 +- .../platform/mediatek/mdp3/mtk-mdp3-m2m.h | 1 - .../platform/mediatek/mdp3/mtk-mdp3-regs.c | 287 +-------- .../platform/mediatek/mdp3/mtk-mdp3-regs.h | 214 +++---- .../platform/mediatek/mdp3/mtk-mdp3-type.h | 53 ++ .../platform/mediatek/mdp3/mtk-mdp3-vpu.c | 194 +++--- .../platform/mediatek/mdp3/mtk-mdp3-vpu.h | 29 +- 15 files changed, 1397 insertions(+), 956 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
Comments
Hi Moudy, On 13/01/2023 07:40, Moudy Ho wrote: > Changes since v4: > - Rebase on linux-next. > - Fix potential frame size overflow in "mtk-mdp3-regs.c". > - Fix OOB in MDP3 component clocks in "mtk-mdp3-comp.*". > - Reconfigure the shared memory between MDP3 kerenl and SCP. > > 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. When I try to compile this series I get these compile errors: In file included from drivers/media/platform/mediatek/mdp3/mtk-img-ipi.h:14, from drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.h:13, from drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.h:10, from drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c:11: drivers/media/platform/mediatek/mdp3/mt8183/mdp3-comp-mt8183.h:10:10: fatal error: mtk-mdp3-type.h: No such file or directory 10 | #include "mtk-mdp3-type.h" | ^~~~~~~~~~~~~~~~~ compilation terminated. You need to add this line to the Makefile, I think: ccflags-y += -I$(srctree)/drivers/media/platform/mediatek/mdp3 checkpatch --strict also reports a lot of issues regarding macros (missing parenthesis) in patch 11/12. Regards, Hans > > 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.2.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 > (snip) > test MMAP (no poll): OK > (snip) > test MMAP (select): OK > (snip) > 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: 1174, Succeeded: 1174, Failed: 0, Warnings: 0 > > Moudy Ho (12): > media: platform: mtk-mdp3: fix potential frame size overflow in > mdp_try_fmt_mplane() > 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: dynamically allocate component clocks > media: platform: mtk-mdp3: Split general definitions used in MDP3 > media: platform: mtk-mdp3: decompose hardware-related information in > shared memory > media: platform: mtk-mdp3: reconfigure 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 | 188 +----- > .../platform/mediatek/mdp3/mtk-mdp3-cmdq.c | 145 +++-- > .../platform/mediatek/mdp3/mtk-mdp3-comp.c | 567 ++++++++++++------ > .../platform/mediatek/mdp3/mtk-mdp3-comp.h | 27 +- > .../platform/mediatek/mdp3/mtk-mdp3-core.c | 49 +- > .../platform/mediatek/mdp3/mtk-mdp3-core.h | 18 +- > .../platform/mediatek/mdp3/mtk-mdp3-m2m.c | 28 +- > .../platform/mediatek/mdp3/mtk-mdp3-m2m.h | 1 - > .../platform/mediatek/mdp3/mtk-mdp3-regs.c | 287 +-------- > .../platform/mediatek/mdp3/mtk-mdp3-regs.h | 214 +++---- > .../platform/mediatek/mdp3/mtk-mdp3-type.h | 53 ++ > .../platform/mediatek/mdp3/mtk-mdp3-vpu.c | 194 +++--- > .../platform/mediatek/mdp3/mtk-mdp3-vpu.h | 29 +- > 15 files changed, 1397 insertions(+), 956 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 >
On 13/01/2023 07:40, Moudy Ho wrote: > Changes since v4: > - Rebase on linux-next. > - Fix potential frame size overflow in "mtk-mdp3-regs.c". > - Fix OOB in MDP3 component clocks in "mtk-mdp3-comp.*". > - Reconfigure the shared memory between MDP3 kerenl and SCP. > > 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. FYI: compiling this series with smatch results in the following warnings and errors: drivers/media/platform/mediatek/mdp3/mtk-mdp3-vpu.c:285 mdp_vpu_process() warn: inconsistent returns 'vpu->lock'. drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c:43 is_output_disabled() error: uninitialized symbol 'dis_output'. drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c:43 is_output_disabled() error: uninitialized symbol 'dis_tile'. drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c:427 mdp_cmdq_send() warn: missing error code 'ret' drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c:59 get_comp_public_id() error: 'mdp_dev' dereferencing possible ERR_PTR() Regards, Hans > > 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.2.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 > (snip) > test MMAP (no poll): OK > (snip) > test MMAP (select): OK > (snip) > 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: 1174, Succeeded: 1174, Failed: 0, Warnings: 0 > > Moudy Ho (12): > media: platform: mtk-mdp3: fix potential frame size overflow in > mdp_try_fmt_mplane() > 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: dynamically allocate component clocks > media: platform: mtk-mdp3: Split general definitions used in MDP3 > media: platform: mtk-mdp3: decompose hardware-related information in > shared memory > media: platform: mtk-mdp3: reconfigure 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 | 188 +----- > .../platform/mediatek/mdp3/mtk-mdp3-cmdq.c | 145 +++-- > .../platform/mediatek/mdp3/mtk-mdp3-comp.c | 567 ++++++++++++------ > .../platform/mediatek/mdp3/mtk-mdp3-comp.h | 27 +- > .../platform/mediatek/mdp3/mtk-mdp3-core.c | 49 +- > .../platform/mediatek/mdp3/mtk-mdp3-core.h | 18 +- > .../platform/mediatek/mdp3/mtk-mdp3-m2m.c | 28 +- > .../platform/mediatek/mdp3/mtk-mdp3-m2m.h | 1 - > .../platform/mediatek/mdp3/mtk-mdp3-regs.c | 287 +-------- > .../platform/mediatek/mdp3/mtk-mdp3-regs.h | 214 +++---- > .../platform/mediatek/mdp3/mtk-mdp3-type.h | 53 ++ > .../platform/mediatek/mdp3/mtk-mdp3-vpu.c | 194 +++--- > .../platform/mediatek/mdp3/mtk-mdp3-vpu.h | 29 +- > 15 files changed, 1397 insertions(+), 956 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 >