From patchwork Wed Feb 1 16:28:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 13124699 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6EECFC38142 for ; Wed, 1 Feb 2023 16:29:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232059AbjBAQ3L (ORCPT ); Wed, 1 Feb 2023 11:29:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232110AbjBAQ3A (ORCPT ); Wed, 1 Feb 2023 11:29:00 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2FFE9485AC for ; Wed, 1 Feb 2023 08:28:56 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id DC9CAB821D4 for ; Wed, 1 Feb 2023 16:28:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EEF2AC433D2; Wed, 1 Feb 2023 16:28:52 +0000 (UTC) From: Hans Verkuil To: linux-media@vger.kernel.org Cc: Andy Walls Subject: [PATCHv2 0/8] cx18: convert to vb2 Date: Wed, 1 Feb 2023 17:28:42 +0100 Message-Id: <20230201162850.886563-1-hverkuil-cisco@xs4all.nl> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org (Repost as v2 with the correct author email and some checkpatch fixes) This series converts cx18 to use the vb2 instead of the videobuf framework. It also fixes a number of issues reported by v4l2-compliance. This driver is unusual because it creates two video nodes: one is for MPEG only, the other is for raw video. The first only supports read(), the second supports both streaming and read. Converting cx18 to vb2 uncovered two corner cases in the v4l2 core that were not handled quite right: one in vb2_read where the owner of the queue was set too late (that caused problems in cx18 that expects it to be set when start_streaming is called), and the other was in v4l2-dev.c where the streaming ioctls were enable when they shouldn't. Rather than trying a heuristic based on the device node type, just check CAP_STREAMING. As vb2 conversions go, this one wasn't too bad. Regards, Hans Hans Verkuil (8): vb2: set owner before calling vb2_read v4l2-dev.c: check for V4L2_CAP_STREAMING to enable streaming ioctls cx18: convert to vb2 cx18: fix incorrect input counting cx18: properly report pixelformats cx18: missing CAP_AUDIO for vbi stream cx18: reorder fmt_vid_cap functions in cx18-ioctl.c cx18: fix format compliance issues .../media/common/videobuf2/videobuf2-v4l2.c | 5 +- drivers/media/pci/cx18/Kconfig | 2 +- drivers/media/pci/cx18/cx18-driver.c | 4 +- drivers/media/pci/cx18/cx18-driver.h | 24 +- drivers/media/pci/cx18/cx18-fileops.c | 85 +--- drivers/media/pci/cx18/cx18-fileops.h | 3 +- drivers/media/pci/cx18/cx18-ioctl.c | 391 +++++++----------- drivers/media/pci/cx18/cx18-mailbox.c | 27 +- drivers/media/pci/cx18/cx18-streams.c | 278 +++++++------ drivers/media/v4l2-core/v4l2-dev.c | 5 +- 10 files changed, 357 insertions(+), 467 deletions(-)