{"id":12654,"url":"https://patchwork.libcamera.org/api/patches/12654/?format=json","web_url":"https://patchwork.libcamera.org/patch/12654/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/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":"<20210618200247.624987-2-vedantparanjape160201@gmail.com>","date":"2021-06-18T20:02:46","name":"[libcamera-devel,1/2] libcamera: Fix V4L2 pixel format mapping for XRGB32","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"89af06a7694f17972c17b1500b0a906dd5a6e5c7","submitter":{"id":85,"url":"https://patchwork.libcamera.org/api/people/85/?format=json","name":"Vedant Paranjape","email":"vedantparanjape160201@gmail.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/12654/mbox/","series":[{"id":2154,"url":"https://patchwork.libcamera.org/api/series/2154/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2154","date":"2021-06-18T20:02:45","name":"Fixed mismatch of pixel formats of V4L2 and libcamera","version":1,"mbox":"https://patchwork.libcamera.org/series/2154/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/12654/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/12654/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 36796C3218\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 18 Jun 2021 20:03:30 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E8ED36050D;\n\tFri, 18 Jun 2021 22:03:29 +0200 (CEST)","from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com\n\t[IPv6:2607:f8b0:4864:20::102e])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 98D5160298\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 18 Jun 2021 22:03:28 +0200 (CEST)","by mail-pj1-x102e.google.com with SMTP id\n\ts17-20020a17090a8811b029016e89654f93so8780421pjn.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 18 Jun 2021 13:03:28 -0700 (PDT)","from localhost.localdomain ([1.186.76.76])\n\tby smtp.googlemail.com with ESMTPSA id\n\ta11sm8852972pfl.168.2021.06.18.13.03.25\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 18 Jun 2021 13:03:26 -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=\"cr4YNKN7\"; 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:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=jMXUnHJF/T3oXW8IoawsxQf4vG5HSd7BBkl+wnS0QOs=;\n\tb=cr4YNKN7jDMrABugXk3t5/JvRyPXX0vu5ZwMK7wm3kWghT/izj5f/0+hOjgisAapxR\n\timoii+C3LmjhwQ3bF/eM89JBkptSCPpY1AtHSC7qgPh0CnEB0zK7RxDRgL2BzgiPV4a+\n\t2F2Gfqym5f/RYdYDQ/n8bqYR4RRGTJbQe4tdjabl23UVQn78veJtYGyLBttyvfGrNy/z\n\t68go668iruUT1NK3m6V32duWyVHbNkhNbvh2m0PzhhF8WiKbHEqbvyOkmstqkcDsQvIp\n\t0uB9UAFtg8nzsQO8VEO25uSbr+1v3V0oOSqzLRbLlkbv+kT25cVUsomUiznXBPqHi2ri\n\tRZmA==","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:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=jMXUnHJF/T3oXW8IoawsxQf4vG5HSd7BBkl+wnS0QOs=;\n\tb=iHA2syx0y/Xc6XlPcfyBYdC8JbC68ygMDmzP9MaYe286IHCicRJ7u0o/Muozkq5gkG\n\ttRozVY4v/Umswacli5SKZIxGHgwMYQXDhmsds7zyFg/rMJbkFWuINeFrCY21ULb87510\n\tGoVDfr8tAK5et40KqDnhFyHpUrS7ZMNg9ZNCtpttJ29pBHWcVUCqtMwONgfC8Sxdd5Yj\n\tPn8Sbj/qA2U/BcVt/8De2YVxvgpd1hERgR12OBIcJY3n8haXYmz8dU+z+ARh/nAwAdJV\n\ta7TaPjy7wPTkycqruINmMQfrZgopxtDAka1WCyqLgkQoVBc+9Ld9+SvvAE+iyYW7crQ7\n\twHQQ==","X-Gm-Message-State":"AOAM5318cJdkBwIs6QqbFj0yBNci2yOzZCXrCFKaRxy6pUqhwztfaHm4\n\txAsULhkeRFBX5CYJOi/lvPxEuSD5aEr5QA==","X-Google-Smtp-Source":"ABdhPJydhLDCYPswrlhBYcx7mgnepSQuwFlsQMRyEu3FCrx7ati0CCYiXdNIrq16f01j4wOuRJwMbQ==","X-Received":"by 2002:a17:90a:6281:: with SMTP id\n\td1mr10189140pjj.140.1624046607114; \n\tFri, 18 Jun 2021 13:03:27 -0700 (PDT)","From":"Vedant Paranjape <vedantparanjape160201@gmail.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Sat, 19 Jun 2021 01:32:46 +0530","Message-Id":"<20210618200247.624987-2-vedantparanjape160201@gmail.com>","X-Mailer":"git-send-email 2.25.1","In-Reply-To":"<20210618200247.624987-1-vedantparanjape160201@gmail.com>","References":"<20210618200247.624987-1-vedantparanjape160201@gmail.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 1/2] libcamera: Fix V4L2 pixel format\n\tmapping for XRGB32","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":"Fixed the mismatch of V4L2 and Libcamera pixelformats.\n\nMatched V4L2_PIX_FMT_XRGB32 with formats::BGRX8888. Additionally, fixes\nmapping of V4L2_PIX_FMT_RGBX32 to formats::XBGR8888 in formats.cpp\n\nSigned-off-by: Vedant Paranjape <vedantparanjape160201@gmail.com>\n---\n src/libcamera/formats.cpp          | 12 +++++++++++-\n src/libcamera/v4l2_pixelformat.cpp |  2 +-\n 2 files changed, 12 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..950cbda4 100644\n--- a/src/libcamera/v4l2_pixelformat.cpp\n+++ b/src/libcamera/v4l2_pixelformat.cpp\n@@ -51,7 +51,7 @@ 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_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","1/2"]}