From patchwork Thu May 19 07:06:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 15981 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 27F95C326C for ; Thu, 19 May 2022 07:06:42 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B763E65665; Thu, 19 May 2022 09:06:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1652944001; bh=mTdu1+ei9OhIYZLKbXebF9syI9RmnoGl1j/9hTaBeDc=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=nvionCcl9mUeP34i7dj5tsS4z3wRtZTazT1i8hk4NLDkNuxcFYt7ytkY0Wf+oYgWQ d8I8pw7DN36dpHivFS/75JlCNFPyzsJ0tmXtl9sil72E6J481VbzXItYhm/kKIz0i4 puPUqIJKddG2jRstobio735kGCrfr67nIqUXrDB7secCuj09c8VBJLoOfqkVym5AQF Pmn7Dv+AUoUsqMY6sK9nzkJUMjBLFCiK1FWZojmqy0FJJEgv+oeYafqu2xs7adZQG6 p/G4Cth60rw0dU6Jqnccerc7Y75DEmi40+wsixtxZzFK6/L6Quz67shZqRuLXVTi0I TgvnFVtt1k/IA== 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 04E4C65654 for ; Thu, 19 May 2022 09:06:40 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="bymuVJd1"; dkim-atps=neutral Received: from deskari.lan (91-156-85-209.elisa-laajakaista.fi [91.156.85.209]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 592C1E52; Thu, 19 May 2022 09:06:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1652943999; bh=mTdu1+ei9OhIYZLKbXebF9syI9RmnoGl1j/9hTaBeDc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bymuVJd1NpN7lSr0hBqTioRDZhLcDGf/HW7fvQnCK03z5P+9fKOTU/bITxbeMps5q dHqsK2P8DY+pCk759HEj/VfSsOhT/KhDDi01cVN3WjzmJi8Yreg/1uTPQxKYm+24xj bymytxEpmwObujL3pHGT9ACVbp2x9a0PnE/K13Lk= To: Laurent Pinchart , Kieran Bingham , libcamera-devel@lists.libcamera.org Date: Thu, 19 May 2022 10:06:20 +0300 Message-Id: <20220519070620.10373-2-tomi.valkeinen@ideasonboard.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220519070620.10373-1-tomi.valkeinen@ideasonboard.com> References: <20220519070620.10373-1-tomi.valkeinen@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 2/2] libcamera: formats: add missing RGBX8888 info 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-Patchwork-Original-From: Tomi Valkeinen via libcamera-devel From: Tomi Valkeinen Reply-To: Tomi Valkeinen Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Add missing RGBX8888 PixelFormatInfo. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart --- Changes to v1: * Fixed the wrong v4l2 format * Added entry to v4l2_pixelformat.cpp src/libcamera/formats.cpp | 13 +++++++++++++ src/libcamera/v4l2_pixelformat.cpp | 2 ++ 2 files changed, 15 insertions(+) diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp index 3e60ec7d..a4f27cd4 100644 --- a/src/libcamera/formats.cpp +++ b/src/libcamera/formats.cpp @@ -231,6 +231,19 @@ const std::map pixelFormatInfo{ .pixelsPerGroup = 1, .planes = {{ { 4, 1 }, { 0, 0 }, { 0, 0 } }}, } }, + { formats::RGBX8888, { + .name = "RGBX8888", + .format = formats::RGBX8888, + .v4l2Formats = { + .single = V4L2PixelFormat(V4L2_PIX_FMT_BGRX32), + .multi = V4L2PixelFormat(), + }, + .bitsPerPixel = 32, + .colourEncoding = PixelFormatInfo::ColourEncodingRGB, + .packed = false, + .pixelsPerGroup = 1, + .planes = {{ { 4, 1 }, { 0, 0 }, { 0, 0 } }}, + } }, { formats::BGRX8888, { .name = "BGRX8888", .format = formats::BGRX8888, diff --git a/src/libcamera/v4l2_pixelformat.cpp b/src/libcamera/v4l2_pixelformat.cpp index 1dd93baa..0b980a97 100644 --- a/src/libcamera/v4l2_pixelformat.cpp +++ b/src/libcamera/v4l2_pixelformat.cpp @@ -61,6 +61,8 @@ const std::map vpf2pf{ { formats::BGRX8888, "32-bit XRGB 8-8-8-8" } }, { V4L2PixelFormat(V4L2_PIX_FMT_RGBX32), { formats::XBGR8888, "32-bit RGBX 8-8-8-8" } }, + { V4L2PixelFormat(V4L2_PIX_FMT_BGRX32), + { formats::RGBX8888, "32-bit XBGR 8-8-8-8" } }, { V4L2PixelFormat(V4L2_PIX_FMT_RGBA32), { formats::ABGR8888, "32-bit RGBA 8-8-8-8" } }, { V4L2PixelFormat(V4L2_PIX_FMT_ABGR32),