From patchwork Fri Feb 5 13:10:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helen Koike X-Patchwork-Id: 11174 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 32A7EBD162 for ; Fri, 5 Feb 2021 13:10:59 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id CE73760306; Fri, 5 Feb 2021 14:10:58 +0100 (CET) Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 5D6F560306 for ; Fri, 5 Feb 2021 14:10:57 +0100 (CET) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: koike) with ESMTPSA id 7D1FB1F466AB From: Helen Koike To: libcamera-devel@lists.libcamera.org Date: Fri, 5 Feb 2021 10:10:41 -0300 Message-Id: <20210205131044.512128-1-helen.koike@collabora.com> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH 0/3] libcamera: Use extended fmt and buffer ioctls API X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kieran.bingham+renesas@ideasonboard.com, frkoenig@chromium.org, kernel@collabora.com Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Hi, This RFC migrate libcamera to use the kernel V4L2 Ext API. Please see kernel patchset cover letter on [1] for more details on the API and the features it would bring for userspace. The purpose of this RFC is: * To use as a proof-of-concept of the proposed Ext API on [1]. * To promote discussions/reviews on the proposed uapi, to make sure we get it right. * To discuss how this would be integrated with libcamera. This RFC replaces the traditional ioctls: * VIDIOC_{S,G,TRY}_FMT * VIDIOC_(D)QBUF By: * VIDIOC_{S,G,TRY}_EXT_PIX_FMT * VIDIOC_EXT_(D)QBUF Which is far from the final solution, since libcamera would need a fallback mechanism for older kernels. So I would like to get some ideas and pointers regarding how this would be implemented, and also if you see issues on the uapi. Another point is regarding memory planes and color planes. QUERYBUF and EXPBUF deals with memory planes, but QBUF requires information per color planes, which requires some special handling in the code. I'd like to hear your thoughts. This RFC was tested with qcam on vimc. It works with my wip-v7 branch [2] (which is v6 with some fixes that I'm going to post to linux-media soon), and it is also available at my tree [3]. [1] https://patchwork.linuxtv.org/project/linux-media/cover/20210114180738.1758707-1-helen.koike@collabora.com/ [2] https://gitlab.collabora.com/koike/linux/-/tree/v4l2/ext-api/wip-v7 [3] https://gitlab.collabora.com/koike/libcamera/-/tree/ext_api Thanks! Helen Koike (3): include: uapi: Add header definitions for V4L2 Ext API libcamera: Use VIDIOC_{S,G,TRY}_EXT_PIX_FMT API libcamera: Use VIDIOC_EXT_(D)QBUF for buffer handling include/libcamera/internal/v4l2_videodevice.h | 8 +- include/linux/videodev2.h | 96 +++++++ src/libcamera/pipeline/ipu3/cio2.cpp | 1 - src/libcamera/pipeline/ipu3/imgu.cpp | 1 - .../pipeline/raspberrypi/raspberrypi.cpp | 4 + src/libcamera/pipeline/rkisp1/rkisp1_path.cpp | 4 +- src/libcamera/pipeline/simple/converter.cpp | 6 +- src/libcamera/pipeline/simple/simple.cpp | 8 +- src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 2 + src/libcamera/pipeline/vimc/vimc.cpp | 2 + src/libcamera/v4l2_videodevice.cpp | 258 ++++++------------ src/v4l2/v4l2_camera_proxy.cpp | 20 +- 12 files changed, 212 insertions(+), 198 deletions(-)