Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp2558598rdh; Wed, 27 Sep 2023 06:22:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHF/7c/I4qCaSaVpM4gc6tDHdvtqTZFbNQ3wPenyXO+GkyGCLvmYd3xxQE/EJOrKUdenag1 X-Received: by 2002:a17:90b:3752:b0:279:269:f746 with SMTP id ne18-20020a17090b375200b002790269f746mr695357pjb.48.1695820970925; Wed, 27 Sep 2023 06:22:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695820970; cv=none; d=google.com; s=arc-20160816; b=OJMAEgETlUL8epYKCY9NYWhlEodaKZC52USRMWYzBJ8N7Azd1i1pzUm7HwwJwoCUh6 yuveamE4gFQ6EQsgesq+yRs88Y9rywF14Wbm8InDBuMblwlaGbAS4R21EMi7G8c8JDps yG+haBooWent4pJm7vm3aZsMcLcwhNBolqsFEiB4wjomurZd6SQOix6XKN3MGFq4AIEJ mJeaCQ93WgDx8QeSHRjtD07tuqT/8OmI/SgLld27rQnPZNZHU57vLcrw4kTTgDLtEpUm skLqsNqRoFHBj3QJgATr/CztQBAbImZBHBkTp1ZZQzDtAtB3minu5BXqRWj6YXEeYD+E EXcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id; bh=Ek9Qr7I2FDMkUU/zOZwFhlvD3bScULtsjLuDky3ATdw=; fh=C1F3SQ8JTPg5BRRYYYr3pMBgszD/sK42W6AHDLlR7gU=; b=QHVSgRbUCe4Gc5rq5dI6tk530oib8+Xx4ZkKmyBXGGhlqMrnKzWIe2xutevH95d0sw RN4QrNi9sm13N0ElI8czxpoRKnohzeydP6cG4IXyarj3r9OciAsoKbLF+ztyTua4RNTf JgO+xRp85bWFO3JtDNgU7qrfsroCFacQWC5/JBpTqfjlP/jIDi2Yzq5t4kwIVfAEM4wP W+LeYXBSVOAuQpOlQfxQLaDRauuFwpPmGZ2xO2iuVg/zBjKGC/RJIPt7LFaaKdXmY42B BLHTgCUuTkiZtdS5Fd8zXwTmCpD1O9DTrKee9+goTLW4zwpLeLXpKw9cUV/fyRmd6Mci 8W0w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id gq16-20020a17090b105000b0027761cbb47dsi7307388pjb.49.2023.09.27.06.22.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Sep 2023 06:22:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id D49DC836C00E; Wed, 27 Sep 2023 05:50:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231730AbjI0Mtu (ORCPT + 99 others); Wed, 27 Sep 2023 08:49:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231720AbjI0Mtt (ORCPT ); Wed, 27 Sep 2023 08:49:49 -0400 Received: from mx.gpxsee.org (mx.gpxsee.org [37.205.14.76]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B1240E6; Wed, 27 Sep 2023 05:49:45 -0700 (PDT) Received: from [192.168.42.133] (host-178-72-203-85.ip.nej.cz [178.72.203.85]) by mx.gpxsee.org (Postfix) with ESMTPSA id 4B98A11B; Wed, 27 Sep 2023 14:49:43 +0200 (CEST) Message-ID: Date: Wed, 27 Sep 2023 14:49:43 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v11 0/2] Digiteq Automotive MGB4 driver To: Hans Verkuil , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?Q?Martin_T=C5=AFma?= References: <20230925143605.4686-1-tumic@gpxsee.org> <0e7556cd-4478-4f21-aab1-5abd1849aa51@xs4all.nl> Content-Language: en-US From: =?UTF-8?Q?Martin_T=C5=AFma?= In-Reply-To: <0e7556cd-4478-4f21-aab1-5abd1849aa51@xs4all.nl> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Wed, 27 Sep 2023 05:50:09 -0700 (PDT) Hi Hans, Thank you very much for your patience and help making the driver a much better code than what was send in the v1 patch. I will now watch linux/master with champagne in my fridge ;-) M. On 27. 09. 23 14:03, Hans Verkuil wrote: > Hi Martin, > > Thank you for your work and patience! > > I've just merged this v11, it all looked good to me. > > Regards, > > Hans > > On 25/09/2023 16:36, tumic@gpxsee.org wrote: >> From: Martin Tůma >> >> Hi, >> This patch adds a driver for the Digiteq Automotive MGB4 grabber card. >> MGB4 is a modular frame grabber PCIe card for automotive video interfaces >> (FPD-Link and GMSL for now). It is based on a Xilinx FPGA and uses their >> XDMA IP core for DMA transfers. Additionally, Xilinx I2C and SPI IP cores >> which already have drivers in linux are used in the design. >> >> The driver is a quite standard v4l2 driver, with one exception - there are >> a lot of sysfs options that may/must be set before opening the v4l2 device >> to adapt the card on a specific signal (see mgb4.rst for details) >> as the card must be able to work with various signal sources (or displays) >> that can not be auto-detected. >> >> Changes in v11 >> * Fixed broken video buffer size check. >> * Documented video queue checks/locking during I/O reconfiguration and signal >> parameters changes. >> >> Changes in v10: >> * Use propper locks/is_busy functions when accessing the video devices in >> the sysfs callbacks. >> * Fixed issues found by the sparse/smatch tools. >> >> Changes in v9: >> * Renamed all sysfs show/store functions using the propper naming convention. >> * Now using device_add_groups() when initializing the sysfs properties. >> * Fixed build without debugfs support. >> * Fixed documentation (vsync/hsync) + added default values where applicable. >> * Fixed the rest of minor issues from v8 review. >> >> Changes in v8: >> * Fixed broken video buffer size computation. >> * Fixed switched I2C deserializers addresses. >> * Do not depend on hwmon. >> >> Changes in v7: >> * Now using hwmon for FPGA temperature reporting. >> * Now using VIDIOC_S_FMT and v4l2_pix_format.bytesperline for setting >> the alignment. >> * Removed the magic sleep when loading the i2c/spi adapter modules (solved by >> request_module() calls with propper - "platform:" prefixed - module >> names). >> * Now properly reporting all the timings info in the VIDIOC_G_DV_TIMINGS >> ioctls. >> * Updated the documentation. >> * Minor fixes as discussed in the v6 review. >> * Added debugfs access to the FPGA registers. >> >> Changes in v6: >> * Rebased to current master that includes the Xilinx XDMA driver. >> >> Changes in v5: >> * Removed unused includes >> >> Changes in v4: >> * Redesigned the signal change handling logic. Now using the propper timings >> API in the video input driver and a propper open() syscall check/logic in >> the video output driver. >> * Fixed all minor issues from v3 review. >> * 'checkpatch.pl --strict' used for checking the code. >> >> Changes in v3: >> * Rebased the DMA transfers part to use the new XDMA driver from Xilinx/AMD >> >> Changes in v2: >> * Completely rewritten the original Xilinx's XDMA driver to meet kernel code >> standards. >> * Added all required "to" and "cc" mail addresses. >> >> >> ===== v4l2-compliance results - input ===== >> >> v4l2-compliance 1.24.1, 64 bits, 64-bit time_t >> >> Compliance test for mgb4 device /dev/video0: >> >> Driver Info: >> Driver name : mgb4 >> Card type : MGB4 PCIe Card >> Bus info : PCI:0000:01:00.0 >> Driver version : 6.4.0 >> Capabilities : 0x85200001 >> Video Capture >> Read/Write >> Streaming >> Extended Pix Format >> Device Capabilities >> Device Caps : 0x05200001 >> Video Capture >> Read/Write >> 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 >> test VIDIOC_G/S_AUDIO: OK (Not Supported) >> Inputs: 1 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 >> test VIDIOC_DV_TIMINGS_CAP: OK >> test VIDIOC_G/S_EDID: OK (Not Supported) >> >> Control ioctls (Input 0): >> test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK (Not Supported) >> test VIDIOC_QUERYCTRL: OK (Not Supported) >> test VIDIOC_G/S_CTRL: OK (Not Supported) >> test VIDIOC_G/S/TRY_EXT_CTRLS: OK (Not Supported) >> warn: v4l2-test-controls.cpp(1139): V4L2_CID_DV_RX_POWER_PRESENT not found for input 0 >> test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK (Not Supported) >> test VIDIOC_G/S_JPEGCOMP: OK (Not Supported) >> Standard Controls: 0 Private Controls: 0 >> >> Format ioctls (Input 0): >> test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK >> test VIDIOC_G/S_PARM: OK >> 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 (Not Supported) >> test Composing: OK (Not Supported) >> test Scaling: OK (Not Supported) >> >> Codec ioctls (Input 0): >> 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 (Input 0): >> test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK >> test VIDIOC_EXPBUF: OK >> test Requests: OK (Not Supported) >> >> Total for mgb4 device /dev/video0: 45, Succeeded: 45, Failed: 0, Warnings: 1 >> >> ===== v4l2-compliance results - output ===== >> >> v4l2-compliance 1.24.1, 64 bits, 64-bit time_t >> >> Compliance test for mgb4 device /dev/video2: >> >> Driver Info: >> Driver name : mgb4 >> Card type : MGB4 PCIe Card >> Bus info : PCI:0000:01:00.0 >> Driver version : 6.4.0 >> Capabilities : 0x85200002 >> Video Output >> Read/Write >> Streaming >> Extended Pix Format >> Device Capabilities >> Device Caps : 0x05200002 >> Video Output >> Read/Write >> Streaming >> Extended Pix Format >> >> Required ioctls: >> test VIDIOC_QUERYCAP: OK >> test invalid ioctls: OK >> >> Allow for multiple opens: >> test second /dev/video2 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 >> test VIDIOC_G/S_AUDOUT: OK (Not Supported) >> Outputs: 1 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 (Output 0): >> test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK (Not Supported) >> test VIDIOC_QUERYCTRL: OK (Not Supported) >> test VIDIOC_G/S_CTRL: OK (Not Supported) >> test VIDIOC_G/S/TRY_EXT_CTRLS: OK (Not Supported) >> test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK (Not Supported) >> test VIDIOC_G/S_JPEGCOMP: OK (Not Supported) >> Standard Controls: 0 Private Controls: 0 >> >> Format ioctls (Output 0): >> 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 (Not Supported) >> test Composing: OK (Not Supported) >> test Scaling: OK (Not Supported) >> >> Codec ioctls (Output 0): >> 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 (Output 0): >> test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK >> test VIDIOC_EXPBUF: OK >> test Requests: OK (Not Supported) >> >> Total for mgb4 device /dev/video2: 45, Succeeded: 45, Failed: 0, Warnings: 0 >> >> Martin Tůma (2): >> Added Digiteq Automotive MGB4 driver >> Added Digiteq Automotive MGB4 driver documentation >> >> Documentation/admin-guide/media/mgb4.rst | 374 +++++++ >> .../admin-guide/media/pci-cardlist.rst | 1 + >> .../admin-guide/media/v4l-drivers.rst | 1 + >> MAINTAINERS | 7 + >> drivers/media/pci/Kconfig | 1 + >> drivers/media/pci/Makefile | 1 + >> drivers/media/pci/mgb4/Kconfig | 17 + >> drivers/media/pci/mgb4/Makefile | 6 + >> drivers/media/pci/mgb4/mgb4_cmt.c | 244 +++++ >> drivers/media/pci/mgb4/mgb4_cmt.h | 17 + >> drivers/media/pci/mgb4/mgb4_core.c | 686 +++++++++++++ >> drivers/media/pci/mgb4/mgb4_core.h | 74 ++ >> drivers/media/pci/mgb4/mgb4_dma.c | 123 +++ >> drivers/media/pci/mgb4/mgb4_dma.h | 18 + >> drivers/media/pci/mgb4/mgb4_i2c.c | 140 +++ >> drivers/media/pci/mgb4/mgb4_i2c.h | 35 + >> drivers/media/pci/mgb4/mgb4_io.h | 33 + >> drivers/media/pci/mgb4/mgb4_regs.c | 30 + >> drivers/media/pci/mgb4/mgb4_regs.h | 35 + >> drivers/media/pci/mgb4/mgb4_sysfs.h | 18 + >> drivers/media/pci/mgb4/mgb4_sysfs_in.c | 772 ++++++++++++++ >> drivers/media/pci/mgb4/mgb4_sysfs_out.c | 737 ++++++++++++++ >> drivers/media/pci/mgb4/mgb4_sysfs_pci.c | 71 ++ >> drivers/media/pci/mgb4/mgb4_trigger.c | 208 ++++ >> drivers/media/pci/mgb4/mgb4_trigger.h | 8 + >> drivers/media/pci/mgb4/mgb4_vin.c | 939 ++++++++++++++++++ >> drivers/media/pci/mgb4/mgb4_vin.h | 69 ++ >> drivers/media/pci/mgb4/mgb4_vout.c | 602 +++++++++++ >> drivers/media/pci/mgb4/mgb4_vout.h | 65 ++ >> 29 files changed, 5332 insertions(+) >> create mode 100644 Documentation/admin-guide/media/mgb4.rst >> create mode 100644 drivers/media/pci/mgb4/Kconfig >> create mode 100644 drivers/media/pci/mgb4/Makefile >> create mode 100644 drivers/media/pci/mgb4/mgb4_cmt.c >> create mode 100644 drivers/media/pci/mgb4/mgb4_cmt.h >> create mode 100644 drivers/media/pci/mgb4/mgb4_core.c >> create mode 100644 drivers/media/pci/mgb4/mgb4_core.h >> create mode 100644 drivers/media/pci/mgb4/mgb4_dma.c >> create mode 100644 drivers/media/pci/mgb4/mgb4_dma.h >> create mode 100644 drivers/media/pci/mgb4/mgb4_i2c.c >> create mode 100644 drivers/media/pci/mgb4/mgb4_i2c.h >> create mode 100644 drivers/media/pci/mgb4/mgb4_io.h >> create mode 100644 drivers/media/pci/mgb4/mgb4_regs.c >> create mode 100644 drivers/media/pci/mgb4/mgb4_regs.h >> create mode 100644 drivers/media/pci/mgb4/mgb4_sysfs.h >> create mode 100644 drivers/media/pci/mgb4/mgb4_sysfs_in.c >> create mode 100644 drivers/media/pci/mgb4/mgb4_sysfs_out.c >> create mode 100644 drivers/media/pci/mgb4/mgb4_sysfs_pci.c >> create mode 100644 drivers/media/pci/mgb4/mgb4_trigger.c >> create mode 100644 drivers/media/pci/mgb4/mgb4_trigger.h >> create mode 100644 drivers/media/pci/mgb4/mgb4_vin.c >> create mode 100644 drivers/media/pci/mgb4/mgb4_vin.h >> create mode 100644 drivers/media/pci/mgb4/mgb4_vout.c >> create mode 100644 drivers/media/pci/mgb4/mgb4_vout.h >> >> >> base-commit: 27bbf45eae9ca98877a2d52a92a188147cd61b07 >