From patchwork Mon Oct 28 11:02:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 2284 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A70CA6017F for ; Mon, 28 Oct 2019 12:02:19 +0100 (CET) Received: from pendragon.ideasonboard.com (unknown [91.217.168.176]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 50939325 for ; Mon, 28 Oct 2019 12:02:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1572260539; bh=WMHsLisep86+QZdT2aPaTmT3fikfiw5eU7tZd+Nqdag=; h=From:To:Subject:Date:From; b=CXeF4nYvmCEN3ArAxI2X33K1n+411We5PUGyf9B7KzPt0g6TmfwWZBLwEHo5eM1Tx 9n0kceFaU1rs/SDajlZ7qd/6Irae8jtH5g9Ur2sHQ8kXHrbtF4ul9e6JkvUROzgMqi XacmG+7r0Nv1Xddc+J2r/ptT80ocgBAIRK4AAdzQ= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Mon, 28 Oct 2019 13:02:01 +0200 Message-Id: <20191028110208.15751-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 0/7] libcamera: Introduce a PixelFormat type 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: , X-List-Received-Date: Mon, 28 Oct 2019 11:02:19 -0000 Hello, This series is a second version of Jacopo's work on pixel format support in libcamera. The goal is to consistently use a dedicated PixelFormat type to describe image pixel formats in the libcamera public API and, by extension, through the code. This increases type safety and will ease extending format descriptions. The series starts by importing a new version of the kernel headers, and adding a (for now) local DRM_FORMAT_MJPEG FourCC. Patch 4/7 and 5/7 then introduce the new PixelFormat type and use it through the code. Patches 6/7 and 7/7 finally switch the PixelFormat numerical value to use DRM FourCC instead of V4L2 FourCC. Thank you Jacopo for your initial work. Jacopo Mondi (7): include: linux: Update headers to Linux v5.2 include: linux: Import DRM/KMS headers from Linux v5.2 include: drm_fourcc: Add Motion-JPEG FourCC libcamera: Define a PixelFormat type for application-facing formats libcamera: stream: Use the newly defined PixelFormat libcamera: v4l2_videodevice: Add PixelFormat conversion libcamera: Switch PixelFormat to DRM FourCC values include/libcamera/meson.build | 1 + include/libcamera/pixelformats.h | 18 + include/libcamera/stream.h | 13 +- include/linux/drm.h | 1042 ++++++++++++++++++++++ include/linux/drm_fourcc.h | 765 ++++++++++++++++ include/linux/drm_mode.h | 1032 +++++++++++++++++++++ include/linux/media-bus-format.h | 4 +- include/linux/media.h | 27 +- include/linux/v4l2-controls.h | 29 + include/linux/videodev2.h | 31 +- src/libcamera/include/v4l2_videodevice.h | 5 + src/libcamera/meson.build | 1 + src/libcamera/pipeline/ipu3/ipu3.cpp | 7 +- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 25 +- src/libcamera/pipeline/uvcvideo.cpp | 4 +- src/libcamera/pipeline/vimc.cpp | 15 +- src/libcamera/pixelformats.cpp | 28 + src/libcamera/stream.cpp | 17 +- src/libcamera/v4l2_videodevice.cpp | 141 +++ src/qcam/format_converter.cpp | 30 +- test/camera/buffer_import.cpp | 17 +- 21 files changed, 3177 insertions(+), 75 deletions(-) create mode 100644 include/libcamera/pixelformats.h create mode 100644 include/linux/drm.h create mode 100644 include/linux/drm_fourcc.h create mode 100644 include/linux/drm_mode.h create mode 100644 src/libcamera/pixelformats.cpp