From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=117.135.210.4 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796231945; b=WIKmTLbJb2O+A5XQ/HpMiFb1sw6HKNTphGpiwvs2ju1DfhSgpv0dEHMH6af6TbwVNHO/ prIJqKInsBAzYjZaf7pw/y/8jd7Hw25Aw0ce+yjqn9FOJGfGrnaH/FMiv63UoXd+A8L0c qLzARfxaTv12mjFyfRFmUGPIvRRldx8Wt5+Rn/mf+Ul2LxuXieSi5R0cEjjyXDMBOcC3E rjVgdf70sf/yoAiXSnzVccy3nIc/AxEaX9k6nsJ1JWYiQz25MIwiWbGHFDJqp0YpkOir8 G/WsKy6Nl8lstWfaLUt2WNcH6NAJ+oHh7B5HgKm80Oe+Q6fTe8odpt5hHJjEpahr9xw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796231945; h=DMARC-Filter:DKIM-Signature:Received:From:To:Cc:Subject:Date: Message-ID:X-Mailer:In-Reply-To:References:MIME-Version:Content-Type: Content-Transfer-Encoding:X-CM-TRANSID:X-Coremail-Antispam: X-CM-SenderInfo; bh=rYlfBV4RoXzz3jkCsBqPTSGapV2MNXwXOfYVMP8JQaY=; b=F5FKiUkpNF7mYUlqh0ZIj/41YVQspoQlrdSCgH9KnDxa1f69ef0zOUJlo0hwkrfQf9dM 6xYtizzPlggs6lK9clRITe2dkQ6GPibq5gt0QZepyauGoGf9U1c/+q6Yky6rKQzED4aaI WDeTEfqAI9EmPMUIHF90/ViLLVlS9cL4s7rUuVH/erZfKi5/reqWFe41K6FYLKMC7Pq0p 5g54TnPTTa05kNmf7jh5e53NP6l5MpowcdSCaWEQGQsmwBjR4st/ENcAJgRVnNxFXPWYc +zHx7cPbHFVamnilTL7fDmszs0DUotK71SV4O+MXiUpOQt4dZRqH14yJWj2fVV2/Cug== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass header.d=163.com header.i=@163.com header.a=rsa-sha256 header.s=s110527 header.b=osg5iQaY; arc=none smtp.remote-ip=117.135.210.4 Received: from m16.mail.163.com (m16.mail.163.com [117.135.210.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A7C37606A31A; Wed, 2 Dec 2026 17:19:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A7C37606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.a=rsa-sha256 header.s=s110527 header.b=osg5iQaY DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:To:Subject:Date:Message-ID:MIME-Version: Content-Type; bh=rYlfBV4RoXzz3jkCsBqPTSGapV2MNXwXOfYVMP8JQaY=; b=osg5iQaYGwPic3QWTS49KpLw6w8hFMR7/tXl/3hk8URLL/FeA7WqtwctcaGG2C XemYWCx0M/VjmhlGgD+MyxH9YDjNwXaaWZaBpy5e4UjJKtY/IH2oGsA4s43xWzOj 4rJSmzca1KBwORVCVxANlZ9uucqtGLxpbWDZzp4sbWEo4= Received: from Ubuntu26.04LTS (unknown []) by gzga-smtp-mtada-g0-1 (Coremail) with SMTP id _____wCnhBDjUhBrjnKcLw--.61858S5; Thu, 03 Dec 2026 01:18:30 +0800 (CST) From: Jiaqi Shi To: linux-media@vger.kernel.org, imx@lists.linux.dev, linux-staging@lists.linux.dev Cc: slongerbeam@gmail.com, p.zabel@pengutronix.de, mchehab@kernel.org, gregkh@linuxfoundation.org, Frank.Li@nxp.com, kernel@pengutronix.de, festevam@gmail.com, Jiaqi Shi Subject: [PATCH v9 3/3] media: imx: remove frame interval monitor Date: Thu, 3 Dec 2026 01:18:27 +0800 Message-ID: <20261202171827.867089-4-shijiaqi_develop@163.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261202171827.867089-1-shijiaqi_develop@163.com> References: <20261202171827.867089-1-shijiaqi_develop@163.com> X-Mailing-List: linux-staging@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-CM-TRANSID:_____wCnhBDjUhBrjnKcLw--.61858S5 X-Coremail-Antispam: 1Uf129KBjvAXoWfCr45Cw1kArWUZrW8ur4rXwb_yoW5tr18to WxWayDCw4rCr18tFWktwnrJFy7Xan8Gan3ArsIyrZ8uFnxZ3W7Ww17GwsxG3W3Xr45CFZ5 Zrn5J3yrJFWrX3W8n29KB7ZKAUJUUUU8529EdanIXcx71UUUUU7v73VFW2AGmfu7bjvjm3 AaLaJ3UbIYCTnIWIevJa73UjIFyTuYvjxUjUDGUUUUU X-CM-SenderInfo: xvklyxpdtlsvxhyhz0rs6rljoofrz/xtbC8AesAGsQUuftcAAA3I The frame interval monitor is disabled by default, has no documented userspace use-case, and has no standard equivalent. The media maintainer does not want it in v4l2-core, so remove it instead of exporting it. Signed-off-by: Jiaqi Shi --- Documentation/admin-guide/media/imx.rst | 15 +- .../userspace-api/media/drivers/imx-uapi.rst | 125 ----- .../userspace-api/media/drivers/index.rst | 1 - MAINTAINERS | 2 - drivers/staging/media/imx/Makefile | 2 +- drivers/staging/media/imx/TODO | 3 - drivers/staging/media/imx/imx-ic-prp.c | 1 - drivers/staging/media/imx/imx-media-capture.c | 17 - drivers/staging/media/imx/imx-media-csi.c | 76 +--- drivers/staging/media/imx/imx-media-dev.c | 1 - drivers/staging/media/imx/imx-media-fim.c | 430 ------------------ drivers/staging/media/imx/imx-media-vdic.c | 1 - drivers/staging/media/imx/imx-media.h | 10 - include/linux/imx-media.h | 25 - include/media/imx.h | 11 - 15 files changed, 8 insertions(+), 712 deletions(-) delete mode 100644 Documentation/userspace-api/media/drivers/imx-uapi.rst delete mode 100644 drivers/staging/media/imx/TODO delete mode 100644 drivers/staging/media/imx/imx-media-fim.c delete mode 100644 include/linux/imx-media.h delete mode 100644 include/media/imx.h diff --git a/Documentation/admin-guide/media/imx.rst b/Documentation/admin-guide/media/imx.rst index 812c6ac09ab8..b1998dcc4344 100644 --- a/Documentation/admin-guide/media/imx.rst +++ b/Documentation/admin-guide/media/imx.rst @@ -98,9 +98,6 @@ Some of the features of this driver include: CSI. There is also support in the future for sending frames to the VDIC from memory buffers via output/mem2mem devices. -- Includes a Frame Interval Monitor (FIM) that can correct vertical sync - problems with the ADV718x video decoders. - Topology -------- @@ -220,8 +217,6 @@ or unqualified interlaced). The capture interface will enforce the same field order as the source pad field order (interlaced-bt if source pad is seq-bt, interlaced-tb if source pad is seq-tb). -For events produced by ipuX_csiY, see ref:`imx_api_ipuX_csiY`. - Cropping in ipuX_csiY --------------------- @@ -266,11 +261,6 @@ rate by half at the IDMAC output source pad: media-ctl -V "'ipu1_csi0':0[fmt:UYVY2X8/640x480@1/60]" media-ctl -V "'ipu1_csi0':2[fmt:UYVY2X8/640x480@1/30]" -Frame Interval Monitor in ipuX_csiY ------------------------------------ - -See ref:`imx_api_FIM`. - ipuX_vdic --------- @@ -395,8 +385,7 @@ Usage Notes ----------- Controls for pipeline entities are accessed through their subdev device -nodes. For example, the FIM controls are available from the ipuX_csiY -subdevs. +nodes. The following are specific usage notes for the Sabre* reference boards: @@ -690,8 +679,6 @@ File list --------- drivers/staging/media/imx/ -include/media/imx.h -include/linux/imx-media.h References ---------- diff --git a/Documentation/userspace-api/media/drivers/imx-uapi.rst b/Documentation/userspace-api/media/drivers/imx-uapi.rst deleted file mode 100644 index 8d47712dea9f..000000000000 --- a/Documentation/userspace-api/media/drivers/imx-uapi.rst +++ /dev/null @@ -1,125 +0,0 @@ -.. SPDX-License-Identifier: GPL-2.0 - -========================= -i.MX Video Capture Driver -========================= - -Events -====== - -.. _imx_api_ipuX_csiY: - -ipuX_csiY ---------- - -This subdev can generate the following event when enabling the second -IDMAC source pad: - -- V4L2_EVENT_IMX_FRAME_INTERVAL_ERROR - -The user application can subscribe to this event from the ipuX_csiY -subdev node. This event is generated by the Frame Interval Monitor -(see below for more on the FIM). - -Controls -======== - -.. _imx_api_FIM: - -Frame Interval Monitor in ipuX_csiY ------------------------------------ - -The adv718x decoders can occasionally send corrupt fields during -NTSC/PAL signal re-sync (too little or too many video lines). When -this happens, the IPU triggers a mechanism to re-establish vertical -sync by adding 1 dummy line every frame, which causes a rolling effect -from image to image, and can last a long time before a stable image is -recovered. Or sometimes the mechanism doesn't work at all, causing a -permanent split image (one frame contains lines from two consecutive -captured images). - -From experiment it was found that during image rolling, the frame -intervals (elapsed time between two EOF's) drop below the nominal -value for the current standard, by about one frame time (60 usec), -and remain at that value until rolling stops. - -While the reason for this observation isn't known (the IPU dummy -line mechanism should show an increase in the intervals by 1 line -time every frame, not a fixed value), we can use it to detect the -corrupt fields using a frame interval monitor. If the FIM detects a -bad frame interval, the ipuX_csiY subdev will send the event -V4L2_EVENT_IMX_FRAME_INTERVAL_ERROR. Userland can register with -the FIM event notification on the ipuX_csiY subdev device node. -Userland can issue a streaming restart when this event is received -to correct the rolling/split image. - -The ipuX_csiY subdev includes custom controls to tweak some dials for -FIM. If one of these controls is changed during streaming, the FIM will -be reset and will continue at the new settings. - -- V4L2_CID_IMX_FIM_ENABLE - -Enable/disable the FIM. - -- V4L2_CID_IMX_FIM_NUM - -How many frame interval measurements to average before comparing against -the nominal frame interval reported by the sensor. This can reduce noise -caused by interrupt latency. - -- V4L2_CID_IMX_FIM_TOLERANCE_MIN - -If the averaged intervals fall outside nominal by this amount, in -microseconds, the V4L2_EVENT_IMX_FRAME_INTERVAL_ERROR event is sent. - -- V4L2_CID_IMX_FIM_TOLERANCE_MAX - -If any intervals are higher than this value, those samples are -discarded and do not enter into the average. This can be used to -discard really high interval errors that might be due to interrupt -latency from high system load. - -- V4L2_CID_IMX_FIM_NUM_SKIP - -How many frames to skip after a FIM reset or stream restart before -FIM begins to average intervals. - -- V4L2_CID_IMX_FIM_ICAP_CHANNEL / V4L2_CID_IMX_FIM_ICAP_EDGE - -These controls will configure an input capture channel as the method -for measuring frame intervals. This is superior to the default method -of measuring frame intervals via EOF interrupt, since it is not subject -to uncertainty errors introduced by interrupt latency. - -Input capture requires hardware support. A VSYNC signal must be routed -to one of the i.MX6 input capture channel pads. - -V4L2_CID_IMX_FIM_ICAP_CHANNEL configures which i.MX6 input capture -channel to use. This must be 0 or 1. - -V4L2_CID_IMX_FIM_ICAP_EDGE configures which signal edge will trigger -input capture events. By default the input capture method is disabled -with a value of IRQ_TYPE_NONE. Set this control to IRQ_TYPE_EDGE_RISING, -IRQ_TYPE_EDGE_FALLING, or IRQ_TYPE_EDGE_BOTH to enable input capture, -triggered on the given signal edge(s). - -When input capture is disabled, frame intervals will be measured via -EOF interrupt. - - -File list ---------- - -drivers/staging/media/imx/ -include/media/imx.h -include/linux/imx-media.h - - -Authors -------- - -- Steve Longerbeam -- Philipp Zabel -- Russell King - -Copyright (C) 2012-2017 Mentor Graphics Inc. diff --git a/Documentation/userspace-api/media/drivers/index.rst b/Documentation/userspace-api/media/drivers/index.rst index 8d2c489b8453..3f6b9a5ceefd 100644 --- a/Documentation/userspace-api/media/drivers/index.rst +++ b/Documentation/userspace-api/media/drivers/index.rst @@ -32,7 +32,6 @@ For more details see the file COPYING in the source distribution of Linux. cx2341x-uapi dcmipp dw100 - imx-uapi mali-c55 max2175 npcm-video diff --git a/MAINTAINERS b/MAINTAINERS index 926c9beb308a..5510bdda72e9 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -16787,8 +16787,6 @@ T: git git://linuxtv.org/media.git F: Documentation/admin-guide/media/imx.rst F: Documentation/devicetree/bindings/media/fsl,imx6-mipi-csi2.yaml F: drivers/staging/media/imx/ -F: include/linux/imx-media.h -F: include/media/imx.h MEDIA DRIVERS FOR FREESCALE IMX7/8 M: Laurent Pinchart diff --git a/drivers/staging/media/imx/Makefile b/drivers/staging/media/imx/Makefile index 330e0825f506..fe2001a76f7a 100644 --- a/drivers/staging/media/imx/Makefile +++ b/drivers/staging/media/imx/Makefile @@ -6,7 +6,7 @@ imx6-media-objs := imx-media-dev.o imx-media-internal-sd.o \ imx-ic-common.o imx-ic-prp.o imx-ic-prpencvf.o imx-media-vdic.o \ imx-media-csc-scaler.o -imx6-media-csi-objs := imx-media-csi.o imx-media-fim.o +imx6-media-csi-objs := imx-media-csi.o obj-$(CONFIG_VIDEO_IMX_MEDIA) += imx-media-common.o obj-$(CONFIG_VIDEO_IMX_MEDIA) += imx6-media.o diff --git a/drivers/staging/media/imx/TODO b/drivers/staging/media/imx/TODO deleted file mode 100644 index 43cd030d4bbd..000000000000 --- a/drivers/staging/media/imx/TODO +++ /dev/null @@ -1,3 +0,0 @@ - -- The Frame Interval Monitor could be exported to v4l2-core for - general use. diff --git a/drivers/staging/media/imx/imx-ic-prp.c b/drivers/staging/media/imx/imx-ic-prp.c index b2c648149964..d2f54b42ebde 100644 --- a/drivers/staging/media/imx/imx-ic-prp.c +++ b/drivers/staging/media/imx/imx-ic-prp.c @@ -18,7 +18,6 @@ #include #include #include -#include #include "imx-media.h" #include "imx-ic.h" diff --git a/drivers/staging/media/imx/imx-media-capture.c b/drivers/staging/media/imx/imx-media-capture.c index 2bd3f336b36b..217e57532a8c 100644 --- a/drivers/staging/media/imx/imx-media-capture.c +++ b/drivers/staging/media/imx/imx-media-capture.c @@ -21,7 +21,6 @@ #include #include #include