From patchwork Tue Jan 23 15:20:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 19467 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 05F51C323E for ; Tue, 23 Jan 2024 15:21:00 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 35ABA62945; Tue, 23 Jan 2024 16:20:59 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="VLFY0df1"; dkim-atps=neutral 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 39198628E9 for ; Tue, 23 Jan 2024 16:20:58 +0100 (CET) Received: from Monstersaurus.local (aztw-30-b2-v4wan-166917-cust845.vm26.cable.virginm.net [82.37.23.78]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 66CF81B9A; Tue, 23 Jan 2024 16:19:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1706023184; bh=DH/9+KyPCRyYuWW6EntMltni4yB5wldduq+XvGae4Y8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VLFY0df1vZ9+AW+5d8G5lA3iPyOFElbbJOFkjWGZfk/KG4bhAvSMQL+Uudb3Dc/Sz 88MViiD2DOABCSSSTCY62UI1mr8dz+sYNb/2Rl6H6YhcXzGP5LVBf1r0xDWT3mS+mA rGpSPQE339dg0fr1FG2Kzw72PEfJelCYeuB53Fa4= From: Kieran Bingham To: libcamera devel Subject: [PATCH v2 4/4] libcamera: v4l2_subdevice: Explain sort order of formatInfoMap Date: Tue, 23 Jan 2024 15:20:34 +0000 Message-Id: <20240123152034.119295-1-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240123143535.52255-1-kieran.bingham@ideasonboard.com> References: <20240123143535.52255-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The sort order used in the table isn't obvious. Reference the source of linux/media-bus-format.h at the top of the table for reference for future updates. Signed-off-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- This patch replaces: [PATCH v2 4/4] libcamera: v4l2subdev: Organise the formatInfoMap src/libcamera/v4l2_subdevice.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp index 265240dbd405..6d0785b7b484 100644 --- a/src/libcamera/v4l2_subdevice.cpp +++ b/src/libcamera/v4l2_subdevice.cpp @@ -57,6 +57,7 @@ struct V4L2SubdeviceFormatInfo { * bus codes */ const std::map formatInfoMap = { + /* This table is sorted to match the order in linux/media-bus-format.h */ { MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE, { 16, "RGB444_2X8_PADHI_BE", PixelFormatInfo::ColourEncodingRGB } }, { MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE, { 16, "RGB444_2X8_PADHI_LE", PixelFormatInfo::ColourEncodingRGB } }, { MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE, { 16, "RGB555_2X8_PADHI_BE", PixelFormatInfo::ColourEncodingRGB } },