{"id":12677,"url":"https://patchwork.libcamera.org/api/1.1/patches/12677/?format=json","web_url":"https://patchwork.libcamera.org/patch/12677/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20210622073433.61678-1-vedantparanjape160201@gmail.com>","date":"2021-06-22T07:34:33","name":"[libcamera-devel,v2] libcamera: Fix V4L2 pixel format mapping for XRGB32 and RGBX32","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"97b4a0b5ab9eb8b91a1d94a8e3bac0cc266635a4","submitter":{"id":85,"url":"https://patchwork.libcamera.org/api/1.1/people/85/?format=json","name":"Vedant Paranjape","email":"vedantparanjape160201@gmail.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/12677/mbox/","series":[{"id":2165,"url":"https://patchwork.libcamera.org/api/1.1/series/2165/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2165","date":"2021-06-22T07:34:33","name":"[libcamera-devel,v2] libcamera: Fix V4L2 pixel format mapping for XRGB32 and RGBX32","version":2,"mbox":"https://patchwork.libcamera.org/series/2165/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/12677/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/12677/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 823D1C321A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 22 Jun 2021 07:34:55 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id EC46A68935;\n\tTue, 22 Jun 2021 09:34:54 +0200 (CEST)","from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com\n\t[IPv6:2607:f8b0:4864:20::42a])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9189668932\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 22 Jun 2021 09:34:53 +0200 (CEST)","by mail-pf1-x42a.google.com with SMTP id w71so5722477pfd.4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 22 Jun 2021 00:34:53 -0700 (PDT)","from localhost.localdomain\n\t([2405:204:21a8:4877:7aca:bbac:9cc:99db])\n\tby smtp.googlemail.com with ESMTPSA id\n\to14sm1436554pjj.6.2021.06.22.00.34.49\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 22 Jun 2021 00:34:51 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"J8c3FGJr\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=2QvVu71xC10oiSVPx53SIAHmdrdShITZzfkw0d9rN6I=;\n\tb=J8c3FGJrLXAXMIUo93Liab0t/D4OTkHOPm9YEFFilqqbK15F7CeKbqFm/SUVDbEYnQ\n\tf0wwQ3Ybf/KKK0btYt2/Tv+h9hlgfmLMcVMfPGHsA3WzDEoDDNu+Fc6NWVm/Oa+rQR9d\n\tg5HgCWN+qkTDpCRNqtxvdYYw8I+AJCM/tkUE/l3yUwil50bHjPYaj56FjWz5UsWp+Zly\n\tj3Iqsll3Xo4aV1dtEA2qiYXtqnuy2plH0c7KqKIk3cHrxb3JnoINB6rHgkM5zUSO/miU\n\t90eJbtLAco9zZER8aWTnctMJZf5mqUPrtS7hXB9IdtKKB7uczxJsvqjjHHLcIDUQ8Ovb\n\tUlZA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=2QvVu71xC10oiSVPx53SIAHmdrdShITZzfkw0d9rN6I=;\n\tb=dmCR8zUeV2nTf+NPyMOL+XtKOj/OKDj/KW0+geYeUNmpkbKo9nVXaVi9tnKzefu2tn\n\tjNp1I19sIodUK62lX08HfPNh1S5h5fUgbdP8G0Uk1dWSr70h0uo0cIuk5R2qr/bACs3N\n\tl5L9qAIONXhDPPYPKMoOlz/LKLGgIba5wyxon29t6wPjlL5eD8rmrP2ZxI0JQpcQWg65\n\tiXveQb1++UZAQBHqtnx34c93MFFaGG8NwpUQSiSpjbTfMEjQ2HwmSn9bQej0vs0VVESD\n\tDJwLYdAbInOqhbD+95cIVu0FQ27tBemwRtl4/OamMBZ8wn9Tn2OHrnfOh6+SLzdUHpQ2\n\t29dQ==","X-Gm-Message-State":"AOAM530ARDV76iwqKY2u0dqoevM+LMZfN/qFrYowBnCupaKWpSFa/LtA\n\ttyvTpuqhxMT16eeNxtcrClO1m/91ZbaLu2A2TmI=","X-Google-Smtp-Source":"ABdhPJwn9WDusFVRQXm8rkzpIPYS2h66WGZm+ykgiHZ7r1WLNUMBW9+wNsqTuvhn635nlZWK80/U0A==","X-Received":"by 2002:a63:dd51:: with SMTP id\n\tg17mr2552004pgj.238.1624347291849; \n\tTue, 22 Jun 2021 00:34:51 -0700 (PDT)","From":"Vedant Paranjape <vedantparanjape160201@gmail.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Tue, 22 Jun 2021 13:04:33 +0530","Message-Id":"<20210622073433.61678-1-vedantparanjape160201@gmail.com>","X-Mailer":"git-send-email 2.25.1","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v2] libcamera: Fix V4L2 pixel format\n\tmapping for XRGB32 and RGBX32","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"Vedant Paranjape <vedantparanjape160201@gmail.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"On running libcamera gstreamer element on Raspberry Pi 4B+, there was a\nwarning as follows:\n\n[3:23:59.717513107] [3577] WARN V4L2 v4l2_pixelformat.cpp:180 Unsupported V4L2 pixel format XB24\n\nThis patch fixes the following warning, by updating the existing\nmapping of V4L2_PIX_FMT_XRGB32 to libcamera pixel format. Additionally,\nadds a new mapping of V4L2_PIX_FMT_RBGX32 to formats::XBGR8888\n\nThis patch does the following changes:\n- add the BGRX8888 format in libcamera\n- fix the mapping of XRGB32 to BGRX8888\n- fix the mapping of RGBX32 to XBGR8888\n\nSigned-off-by: Vedant Paranjape <vedantparanjape160201@gmail.com>\n---\n src/libcamera/formats.cpp          | 12 +++++++++++-\n src/libcamera/v4l2_pixelformat.cpp |  3 ++-\n 2 files changed, 13 insertions(+), 2 deletions(-)","diff":"diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp\nindex 55822f4c..e41bfc05 100644\n--- a/src/libcamera/formats.cpp\n+++ b/src/libcamera/formats.cpp\n@@ -198,13 +198,23 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t{ formats::XBGR8888, {\n \t\t.name = \"XBGR8888\",\n \t\t.format = formats::XBGR8888,\n-\t\t.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_XRGB32),\n+\t\t.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_RGBX32),\n \t\t.bitsPerPixel = 32,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n \t\t.packed = false,\n \t\t.pixelsPerGroup = 1,\n \t\t.planes = {{ { 4, 1 }, { 0, 0 }, { 0, 0 } }},\n \t} },\n+\t{ formats::BGRX8888, {\n+\t\t.name = \"BGRX8888\",\n+\t\t.format = formats::BGRX8888,\n+\t\t.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_XRGB32),\n+\t\t.bitsPerPixel = 32,\n+\t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n+\t\t.packed = false,\n+\t\t.pixelsPerGroup = 1,\n+\t\t.planes = {{ { 4, 1 }, { 0, 0 }, { 0, 0 } }},\n+\t} },\t\n \t{ formats::ABGR8888, {\n \t\t.name = \"ABGR8888\",\n \t\t.format = formats::ABGR8888,\ndiff --git a/src/libcamera/v4l2_pixelformat.cpp b/src/libcamera/v4l2_pixelformat.cpp\nindex 166d93cf..78a08303 100644\n--- a/src/libcamera/v4l2_pixelformat.cpp\n+++ b/src/libcamera/v4l2_pixelformat.cpp\n@@ -51,7 +51,8 @@ const std::map<V4L2PixelFormat, PixelFormat> vpf2pf{\n \t{ V4L2PixelFormat(V4L2_PIX_FMT_RGB24), formats::BGR888 },\n \t{ V4L2PixelFormat(V4L2_PIX_FMT_BGR24), formats::RGB888 },\n \t{ V4L2PixelFormat(V4L2_PIX_FMT_XBGR32), formats::XRGB8888 },\n-\t{ V4L2PixelFormat(V4L2_PIX_FMT_XRGB32), formats::XBGR8888 },\n+\t{ V4L2PixelFormat(V4L2_PIX_FMT_XRGB32), formats::BGRX8888 },\n+\t{ V4L2PixelFormat(V4L2_PIX_FMT_RGBX32), formats::XBGR8888 },\n \t{ V4L2PixelFormat(V4L2_PIX_FMT_RGBA32), formats::ABGR8888 },\n \t{ V4L2PixelFormat(V4L2_PIX_FMT_ABGR32), formats::ARGB8888 },\n \t{ V4L2PixelFormat(V4L2_PIX_FMT_ARGB32), formats::BGRA8888 },\n","prefixes":["libcamera-devel","v2"]}