From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=220.197.31.3 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796138842; b=2QiddtEs/za2AWgH3BM4sBPtEpxhBET8tRwIlHjqrJbEguKuUkRXok2JFfgCMyKpZcq/ Zmr0FboLgLmQFZMNzMszCWBRRymvexLJ2+yl3KbXu+CcM1roCnqlRRL934Dsbr+yNiF2P GtT8R3P9LG6tI530o1Ewze766MHgVnU3Zv5X7exMIPm1/GEcD+OKbQLFmOM4JFinH/Bb6 xkYIVMy8scd0gNJ/Xr0fowZ23DRFvcDhtcDBHMp32wVaE2EfaFZy7iz+JrOB/89gFjtwX h527n5mpDyZI31dff+W0vPHXoPM2OKbEuvg9thlmBAbQHYUseXamPd8DxUBcc5BPX7w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796138842; 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=Q3tb+8B1VAUcR6fWtlMsLggq8StpEp18zkFgKPEgX7Y=; b=Cld/0Hrrr1oi/HGu2/SM8Pjvhn0kvaJZ7/3P2kzctZShsYbH7bBzZtuClDxuhbuft4pF MNqXe6C9dMMNUrjmU/X2TdppBG1fFAdRTUzyugo3MASAc1Dh3vGdjVWvcf5+Lewfl4Gwu 7we1rly5W+Tkk2+rbIrAtS7GMVHU/jiOuX5AyCWgcD+21xibJj/XA/wkPhApflaEaC70E A6GRyeKTvp9XGpQTjTDaLSuSaBA2HZyiHofnxhcZEcBVtdmdLGvPOFStzF807b4msbtPg iw/NaS+LLgUa31lNCPhIj/nYqOHkLWAgj6Y8LOKp4ZguaFlJcSuAaIVs57ulmHrGG3g== 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=ea6biFMl; arc=none smtp.remote-ip=220.197.31.3 Received: from m16.mail.163.com (m16.mail.163.com [220.197.31.3]) (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 21803606A32F; Tue, 1 Dec 2026 15:27:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 21803606A32F 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=ea6biFMl 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=Q3tb+8B1VAUcR6fWtlMsLggq8StpEp18zkFgKPEgX7Y=; b=ea6biFMl7Uq/y++t1EhUv0yUrBQwT4qwwf4znnUCYHr+6zibnj+t9YgeZ78aMd 2lOd5EuO63UMfgCsyNrrcPmX8TGq8rYmoUb0FmCXAkFkFFprNjd1t/VtyTAtvGrv 1gA8QaEHKewbb1yJDK4yII2jkkhJhhWqtCYLrVrNcijoQ= Received: from Ubuntu26.04LTS (unknown []) by gzga-smtp-mtada-g0-0 (Coremail) with SMTP id _____wD310w65w5rvGObMQ--.18896S4; Tue, 01 Dec 2026 23:26:52 +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 v8 2/2] media: imx: remove frame interval monitor Date: Tue, 1 Dec 2026 23:26:47 +0800 Message-ID: <20261201152647.847238-3-shijiaqi_develop@163.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261201152647.847238-1-shijiaqi_develop@163.com> References: <20261201152647.847238-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:_____wD310w65w5rvGObMQ--.18896S4 X-Coremail-Antispam: 1Uf129KBjvAXoWfCr45Cw1kArWUZrW8ur4rXwb_yoW5tw1kWo WxWa1DCw4rCr10qFWktwnrJFy7XFs8Gan3ArsIyrZ8uasxZ3W2gw17GwsxJ3W3Xr4rCFZ5 ZFs5J3yrJFWrX3W8n29KB7ZKAUJUUUU8529EdanIXcx71UUUUU7v73VFW2AGmfu7bjvjm3 AaLaJ3UbIYCTnIWIevJa73UjIFyTuYvjTE_QRiUUUUU X-CM-SenderInfo: xvklyxpdtlsvxhyhz0rs6rljoofrz/xtbC8BxnumsO5zx2bwAA3W The frame interval monitor is an i.MX-private feature that measures CSI frame intervals using private controls and a private event. It is disabled by default, is only wired into the CSI driver, and aside from the driver-specific UAPI page has no documentation. There is no evidence of a real userspace consumer, and the media maintainer considers it dubious for v4l2-core. Remove it rather than exporting it to the core as previously suggested in the TODO. This drops imx-media-fim.c, the private control and event definitions in include/linux/imx-media.h along with the include/media/imx.h wrapper, the CSI integration, the capture event subscriptions, the driver-specific UAPI documentation, and the remaining TODO entry. 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-ic-prpencvf.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 - 16 files changed, 8 insertions(+), 713 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-ic-prpencvf.c b/drivers/staging/media/imx/imx-ic-prpencvf.c index 979d124c19ea..111b5f9fd447 100644 --- a/drivers/staging/media/imx/imx-ic-prpencvf.c +++ b/drivers/staging/media/imx/imx-ic-prpencvf.c @@ -19,7 +19,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