Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp941185pxb; Thu, 19 Nov 2020 18:38:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJyOiXD0b+Klrfue/k+oOUdhYlZQ1XZy9JsAf/PHLwLmTtpDTbzayq2q/fDODwte02EGXtmH X-Received: by 2002:a17:906:9583:: with SMTP id r3mr8075136ejx.139.1605839912544; Thu, 19 Nov 2020 18:38:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605839912; cv=none; d=google.com; s=arc-20160816; b=wYl+85BIK5cQkMQ/R0jk8Z2LDHmDzbmOpULIpK4butetbhgPn6zl8OBvy4jJL9B1ix Npy4TNw0cd0gvxyd34D05VYzhXt3PJ0izU4kLJqWvcHRHpQnFTibrCy3CX6aOKBjbNox sXII8zuFNrqCfkndDKUWapgiqDsU6NmDJzDgVnsC/KCDgsBKLs1Gu0JyBdMnZN5+ybVl PMEjKeRLnAe1ff7p4tGp9qnLBou1UbNrBJLD4GG0ZL+LnUcuXXGDgowIE3mGQVYqrBXi uvRSyDSrRtRGPHF1vKvvmd1NbsBsWJhn8G7sQVXtV5WUkxReNcsu9CJzuOKn5l3fR+Nx nR7g== 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; bh=rZoyhqgFSmfp9dD0pfmBjWKoxK4geREhPUBeG3VRiqs=; b=PpiMQSue4BdIFD+zs41YRbnE1xSkBXEBPb5itkZcJGCQkqaX0sUXxULOzctEeFCj6b cDQBFJOUTYKFIAlSliz6xlOySXDFgIiK3+tnD0X1gcJk6E7yspTFLmID5Z/e8eOGOqEu h8McTc0rkdO9Ld/BeZTD9jBjgmJZmhEG+iS3pzaJswN4UujyN/NuVP9soV3OQR4jeUmH BrSOyu8cjiv7qkhoPyNLIUPdke43Z0IeaZEzqUuCwFZVm5KCm5gDbEpAnAwkj4Azh1T+ CkoEKvWjisVi+PAls/X84GZzk4epd4K14N6UkIDuHXcX9aX4VAdtj0mSJuk95cAStpyB rXgQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q12si646310edi.141.2020.11.19.18.38.09; Thu, 19 Nov 2020 18:38:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727158AbgKTCea (ORCPT + 99 others); Thu, 19 Nov 2020 21:34:30 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:55690 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726985AbgKTCe2 (ORCPT ); Thu, 19 Nov 2020 21:34:28 -0500 X-UUID: 6f86debced76427e9da06cb20af6fb03-20201120 X-UUID: 6f86debced76427e9da06cb20af6fb03-20201120 Received: from mtkcas08.mediatek.inc [(172.21.101.126)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 152737837; Fri, 20 Nov 2020 10:29:18 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs01n2.mediatek.inc (172.21.101.79) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 20 Nov 2020 10:29:08 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 20 Nov 2020 10:29:08 +0800 From: Daoyuan Huang To: Mauro Carvalho Chehab , Rob Herring , Matthias Brugger , Hans Verkuil , Jernej Skrabec CC: Maoguang Meng , Krzysztof Kozlowski , daoyuan huang , Ping-Hsun Wu , Geert Uytterhoeven , Rob Landley , Laurent Pinchart , , , , , , , , , , , , , , , Subject: [PATCH v4 0/4] media: mediatek: support mdp3 on mt8183 platform Date: Fri, 20 Nov 2020 10:29:02 +0800 Message-ID: <1605839346-10648-1-git-send-email-daoyuan.huang@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: 396CC85A8D0E16EE1F5570B1027F9616E51282698A71B637A4F9EBCC55A77EA42000:8 X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: daoyuan huang Changes since v3: - Rebase on v5.9-rc1. - modify code for review comment from Rob Herring, cancel multiple nodes using same register base situation. - control IOMMU port through pm runtime get/put to DMA components' device. - SCP(VPU) driver revision. - stop queuing jobs(remove flush_workqueue()) after mdp_m2m_release(). - add computation of plane address with data_offset. - fix scale ratio check issue. - add default v4l2_format setting. Changes since v2: - modify code for review comment from Tomasz Figa & Alexandre Courbot - review comment from Rob Herring will offer code revision in v4, due to it's related to device node modification, will need to modify code architecture Changes since v1: - modify code for CMDQ v3 API support - EC ipi cmd migration - fix compliance test fail item (m2m cmd with -f) due to there is two problem in runing all format(-f) cmd: 1. out of memory before test complete Due to capture buffer mmap (refcount + 1) after reqbuf but seems no corresponding munmap called before device close. There are total 12XX items(formats) in format test and each format alloc 8 capture/output buffers. 2. unceasingly captureBufs() (randomly) Seems the break statement didn't catch the count == 0 situation: In v4l2-test-buffers.cpp, function: captureBufs() ... count--; if (!node->is_m2m && !count) break; Log is as attachment I will paste the test result with problem part in another e-mail Hi, This is the first version of RFC patch for Media Data Path 3 (MDP3), MDP3 is used for scaling and color format conversion. support using GCE to write register in critical time limitation. support V4L2 m2m device control. daoyuan huang (4): [v4,1/4] dt-binding: mt8183: Add Mediatek MDP3 dt-bindings [v4,2/4] dts: arm64: mt8183: Add Mediatek MDP3 nodes [v4,3/4] media: platform: Add Mediatek MDP3 driver KConfig [v4,4/4] media: platform: mtk-mdp3: Add Mediatek MDP3 driver .../bindings/media/mediatek,mt8183-mdp3.txt | 208 +++ arch/arm64/boot/dts/mediatek/mt8183.dtsi | 116 ++ drivers/media/platform/Kconfig | 17 + drivers/media/platform/Makefile | 2 + drivers/media/platform/mtk-mdp3/Makefile | 7 + drivers/media/platform/mtk-mdp3/isp_reg.h | 37 + .../media/platform/mtk-mdp3/mdp-platform.h | 58 + .../media/platform/mtk-mdp3/mdp_reg_ccorr.h | 75 + .../media/platform/mtk-mdp3/mdp_reg_rdma.h | 206 +++ drivers/media/platform/mtk-mdp3/mdp_reg_rsz.h | 109 ++ .../media/platform/mtk-mdp3/mdp_reg_wdma.h | 125 ++ .../media/platform/mtk-mdp3/mdp_reg_wrot.h | 115 ++ .../media/platform/mtk-mdp3/mmsys_config.h | 188 +++ drivers/media/platform/mtk-mdp3/mmsys_mutex.h | 35 + .../media/platform/mtk-mdp3/mmsys_reg_base.h | 38 + drivers/media/platform/mtk-mdp3/mtk-img-ipi.h | 281 ++++ .../media/platform/mtk-mdp3/mtk-mdp3-cmdq.c | 504 ++++++ .../media/platform/mtk-mdp3/mtk-mdp3-cmdq.h | 54 + .../media/platform/mtk-mdp3/mtk-mdp3-comp.c | 1420 +++++++++++++++++ .../media/platform/mtk-mdp3/mtk-mdp3-comp.h | 155 ++ .../media/platform/mtk-mdp3/mtk-mdp3-core.c | 269 ++++ .../media/platform/mtk-mdp3/mtk-mdp3-core.h | 86 + .../media/platform/mtk-mdp3/mtk-mdp3-m2m.c | 795 +++++++++ .../media/platform/mtk-mdp3/mtk-mdp3-m2m.h | 42 + .../media/platform/mtk-mdp3/mtk-mdp3-regs.c | 748 +++++++++ .../media/platform/mtk-mdp3/mtk-mdp3-regs.h | 373 +++++ .../media/platform/mtk-mdp3/mtk-mdp3-vpu.c | 313 ++++ .../media/platform/mtk-mdp3/mtk-mdp3-vpu.h | 79 + 28 files changed, 6455 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/mediatek,mt8183-mdp3.txt create mode 100644 drivers/media/platform/mtk-mdp3/Makefile create mode 100644 drivers/media/platform/mtk-mdp3/isp_reg.h create mode 100644 drivers/media/platform/mtk-mdp3/mdp-platform.h create mode 100644 drivers/media/platform/mtk-mdp3/mdp_reg_ccorr.h create mode 100644 drivers/media/platform/mtk-mdp3/mdp_reg_rdma.h create mode 100644 drivers/media/platform/mtk-mdp3/mdp_reg_rsz.h create mode 100644 drivers/media/platform/mtk-mdp3/mdp_reg_wdma.h create mode 100644 drivers/media/platform/mtk-mdp3/mdp_reg_wrot.h create mode 100644 drivers/media/platform/mtk-mdp3/mmsys_config.h create mode 100644 drivers/media/platform/mtk-mdp3/mmsys_mutex.h create mode 100644 drivers/media/platform/mtk-mdp3/mmsys_reg_base.h create mode 100644 drivers/media/platform/mtk-mdp3/mtk-img-ipi.h create mode 100644 drivers/media/platform/mtk-mdp3/mtk-mdp3-cmdq.c create mode 100644 drivers/media/platform/mtk-mdp3/mtk-mdp3-cmdq.h create mode 100644 drivers/media/platform/mtk-mdp3/mtk-mdp3-comp.c create mode 100644 drivers/media/platform/mtk-mdp3/mtk-mdp3-comp.h create mode 100644 drivers/media/platform/mtk-mdp3/mtk-mdp3-core.c create mode 100644 drivers/media/platform/mtk-mdp3/mtk-mdp3-core.h create mode 100644 drivers/media/platform/mtk-mdp3/mtk-mdp3-m2m.c create mode 100644 drivers/media/platform/mtk-mdp3/mtk-mdp3-m2m.h create mode 100644 drivers/media/platform/mtk-mdp3/mtk-mdp3-regs.c create mode 100644 drivers/media/platform/mtk-mdp3/mtk-mdp3-regs.h create mode 100644 drivers/media/platform/mtk-mdp3/mtk-mdp3-vpu.c create mode 100644 drivers/media/platform/mtk-mdp3/mtk-mdp3-vpu.h -- 2.18.0