From patchwork Thu Jul 15 20:46:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vedant Paranjape X-Patchwork-Id: 12969 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 92869C3225 for ; Thu, 15 Jul 2021 20:46:45 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0AAC468539; Thu, 15 Jul 2021 22:46:45 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="oXrEPIZY"; dkim-atps=neutral Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 4BD4E6059F for ; Thu, 15 Jul 2021 22:46:43 +0200 (CEST) Received: by mail-pj1-x1029.google.com with SMTP id d9-20020a17090ae289b0290172f971883bso7346397pjz.1 for ; Thu, 15 Jul 2021 13:46:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=kQ3i2Qx61kPbBNSobc8acCysjHGsv1SIi5SzjCT28JY=; b=oXrEPIZYiYrc/0RuSbMlNeXuqhntLLz5Vkt/xJoo9LWzgsqEXafHqA6lrNMh7RalL1 ki1vVarp91VnHkXYAz6JRVr4OgxOoT2/AENJB77f1yas+qgnfSvN6/iykbe7+XMuZSse xyslBle73r2JIZXNsVbznMncS91MIp4f/ISxVibTamWA1twmtnP1v9cY4K3F6TR3T2eo eElEGQBQKtdP2O18a1OKm4CDSV6ssbYoeYSbD6aY9I9gYDhughGRnsvodlOdWEl4Za3W n7eLC5VveWXgUWO4gE9760XHDRGC8+LiSf7nYqBL6/PWOXPIFeGfBihnc2MhQ3IaRNAN 4w6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=kQ3i2Qx61kPbBNSobc8acCysjHGsv1SIi5SzjCT28JY=; b=KjcHLQtR50jlo3HYc+4GqchYNpCoysprF9qh364wdmJBjuscly2hVqJkaG6GAIvFF3 1L30eu40R9YteeY8Oo/d3cPwLkHgYJ7dVRZ65Pagj65LDtkKpKN3mnMaTS4KKW9ebipK g+UrNRO6FaZb4mkj+msi2EJXumYdV+Q9LTGqpC3sXM3WcTjUofVbIOVriwa/CK1eRuUX rwvo2jHDKYyoZk2pYbuZ282vbQIelSSic7PmYAy3VAFW0zDQAGPCNVvOPH4mZUiHJHeq DQ9yEBYrwqFBfEfPFjYTOrvsNAAR5ef25gBxjR5fDu+bRQAUP/0VNEc5/GFeE4Kg51dk YzAg== X-Gm-Message-State: AOAM533X7BpDN+nPZcshBA32+VkunWLuuSPwHerqu4ZzhwEwfQ/iunjl UZgMurWxu55YP8PC5zxveMLAfkIDIwSoEBaNWrQ= X-Google-Smtp-Source: ABdhPJwxLA3CRWNHG/K8GnaDXcwmSn7FV5lGDmTafcllEVy+/DzaWsYy4HT4HoX6U+i8oko9HEbcQQ== X-Received: by 2002:a17:902:8d98:b029:129:18e5:8c31 with SMTP id v24-20020a1709028d98b029012918e58c31mr4770139plo.3.1626382001376; Thu, 15 Jul 2021 13:46:41 -0700 (PDT) Received: from localhost.localdomain ([1.186.167.37]) by smtp.googlemail.com with ESMTPSA id c12sm7545796pfl.27.2021.07.15.13.46.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Jul 2021 13:46:41 -0700 (PDT) From: Vedant Paranjape To: libcamera-devel@lists.libcamera.org Date: Fri, 16 Jul 2021 02:16:16 +0530 Message-Id: <20210715204617.20140-1-vedantparanjape160201@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 1/2] libcamera: Fix the V4L2 pixel format for formats::XBGR8888 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: , Cc: Vedant Paranjape Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" This patch fixes V4L2 pixel format for formats::XBGR8888 by updating the existing matching to V4L2_PIX_FMT_RGBX32 Fixes: 4fd6bb33 ("libcamera: Add support for XRGB8888 and XBGR8888") Signed-off-by: Vedant Paranjape Reviewed-by: Paul Elder Reviewed-by: Laurent Pinchart --- src/libcamera/formats.cpp | 2 +- src/libcamera/v4l2_pixelformat.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp index 59a34853..578ac4af 100644 --- a/src/libcamera/formats.cpp +++ b/src/libcamera/formats.cpp @@ -198,7 +198,7 @@ const std::map pixelFormatInfo{ { formats::XBGR8888, { .name = "XBGR8888", .format = formats::XBGR8888, - .v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_XRGB32), + .v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_RGBX32), .bitsPerPixel = 32, .colourEncoding = PixelFormatInfo::ColourEncodingRGB, .packed = false, diff --git a/src/libcamera/v4l2_pixelformat.cpp b/src/libcamera/v4l2_pixelformat.cpp index 87d728fe..59a01e02 100644 --- a/src/libcamera/v4l2_pixelformat.cpp +++ b/src/libcamera/v4l2_pixelformat.cpp @@ -52,7 +52,7 @@ const std::map vpf2pf{ { V4L2PixelFormat(V4L2_PIX_FMT_RGB24), formats::BGR888 }, { V4L2PixelFormat(V4L2_PIX_FMT_BGR24), formats::RGB888 }, { V4L2PixelFormat(V4L2_PIX_FMT_XBGR32), formats::XRGB8888 }, - { V4L2PixelFormat(V4L2_PIX_FMT_XRGB32), formats::XBGR8888 }, + { V4L2PixelFormat(V4L2_PIX_FMT_RGBX32), formats::XBGR8888 }, { V4L2PixelFormat(V4L2_PIX_FMT_RGBA32), formats::ABGR8888 }, { V4L2PixelFormat(V4L2_PIX_FMT_ABGR32), formats::ARGB8888 }, { V4L2PixelFormat(V4L2_PIX_FMT_ARGB32), formats::BGRA8888 }, From patchwork Thu Jul 15 20:46:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vedant Paranjape X-Patchwork-Id: 12970 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 B5F99C3225 for ; Thu, 15 Jul 2021 20:46:47 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 710DD6852A; Thu, 15 Jul 2021 22:46:47 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ucSHL4ke"; dkim-atps=neutral Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7366B6059F for ; Thu, 15 Jul 2021 22:46:46 +0200 (CEST) Received: by mail-pj1-x1036.google.com with SMTP id bt15so4962409pjb.2 for ; Thu, 15 Jul 2021 13:46:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=79q8nTRra8BB2hCmCIawmyGF4lHQ73LVIqBfkVcd7fE=; b=ucSHL4keJqBIOrzZ12iE8QC/fm7bvSA9BUEunRsmEF3+pvoHc8oKPqOjUxdsoH2s94 2W+ZPcaKXh1WYpBe70p7NiT6TyRlSPpGYcEtc+x/cBkWsB7vt2h6crtx6uYIBm0lhlxJ uyY+ID1iLU99q4+Q5hkf/LwjSZb2eppFjX67LcFBrJ3JacH/blk/wkpKjdNAft39Tcbt PqJNPVjyuDCiiQn7silpNhJNuekqMilPmhyIy+M6bw0iDCcYzEwxaGlkXko0pXWMPRTS 4RQ4Q5oR+Tu3IVhLqlVWbruaS3bNcIKaPG9BDWEdXzI2+BtSbcq91K4Sv4pr2YVVQsGt 5N+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=79q8nTRra8BB2hCmCIawmyGF4lHQ73LVIqBfkVcd7fE=; b=jY0SSET8IXA/FK/kEDs3WCAg0NeCrcTGPn/xs517A474VI0PkepbKEX5xVqy3lHraA UQeFBT8bCUtLHMz/6M0zIUUUOvuIuxIvaYc1iugR5Yhpt/O5oytkDGQGcqTMdOo9mrXs pxlgBjglxl2x1OtN2huLLiehba8pfMgR7sRSXEtMyj4vclq/5jly+4mtiKwInazbWxh+ d9Ip0YyHS+pUKN7321Yd+5HSV/CIlpSfqI4Kz/AsHl5SLFRAn5Udrru46m1PorkwsWyp 175seOGrpI4aWb3ATIW8LdHfuGqbJ1Lria6dZZYI0BgYR6I49oTeQBJTBli3TEQz1z0i q55A== X-Gm-Message-State: AOAM533HvTYjvnPehvVCyAozcUL0izEZyyGS7c/DAFK7+bIcE4VBUkgV B0cy561ttOcAbi5E2D64bsRlIoqWNuk587biN7Y= X-Google-Smtp-Source: ABdhPJzCwCb0sE6Hu5Seryy4mxVmLs0Df21ozmMf+1iW7ypfnhfsekl082OKbla+PfLMrTXMb4oAmw== X-Received: by 2002:a17:90a:8e82:: with SMTP id f2mr12153559pjo.177.1626382004846; Thu, 15 Jul 2021 13:46:44 -0700 (PDT) Received: from localhost.localdomain ([1.186.167.37]) by smtp.googlemail.com with ESMTPSA id c12sm7545796pfl.27.2021.07.15.13.46.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Jul 2021 13:46:44 -0700 (PDT) From: Vedant Paranjape To: libcamera-devel@lists.libcamera.org Date: Fri, 16 Jul 2021 02:16:17 +0530 Message-Id: <20210715204617.20140-2-vedantparanjape160201@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210715204617.20140-1-vedantparanjape160201@gmail.com> References: <20210715204617.20140-1-vedantparanjape160201@gmail.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 2/2] libcamera: Add pixel format BGRX8888 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: , Cc: Vedant Paranjape Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" This patch adds pixel format BGRX8888 to libcamera. Additionally adds mapping of V4L2 pixel format (V4L2_PIX_FMT_XRGB32) to BGRX8888. Signed-off-by: Vedant Paranjape Reviewed-by: Paul Elder Reviewed-by: Laurent Pinchart --- src/libcamera/formats.cpp | 10 ++++++++++ src/libcamera/v4l2_pixelformat.cpp | 1 + 2 files changed, 11 insertions(+) diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp index 578ac4af..8f1197de 100644 --- a/src/libcamera/formats.cpp +++ b/src/libcamera/formats.cpp @@ -205,6 +205,16 @@ const std::map pixelFormatInfo{ .pixelsPerGroup = 1, .planes = {{ { 4, 1 }, { 0, 0 }, { 0, 0 } }}, } }, + { formats::BGRX8888, { + .name = "BGRX8888", + .format = formats::BGRX8888, + .v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_XRGB32), + .bitsPerPixel = 32, + .colourEncoding = PixelFormatInfo::ColourEncodingRGB, + .packed = false, + .pixelsPerGroup = 1, + .planes = {{ { 4, 1 }, { 0, 0 }, { 0, 0 } }}, + } }, { formats::ABGR8888, { .name = "ABGR8888", .format = formats::ABGR8888, diff --git a/src/libcamera/v4l2_pixelformat.cpp b/src/libcamera/v4l2_pixelformat.cpp index 59a01e02..93fc4446 100644 --- a/src/libcamera/v4l2_pixelformat.cpp +++ b/src/libcamera/v4l2_pixelformat.cpp @@ -52,6 +52,7 @@ const std::map vpf2pf{ { V4L2PixelFormat(V4L2_PIX_FMT_RGB24), formats::BGR888 }, { V4L2PixelFormat(V4L2_PIX_FMT_BGR24), formats::RGB888 }, { V4L2PixelFormat(V4L2_PIX_FMT_XBGR32), formats::XRGB8888 }, + { V4L2PixelFormat(V4L2_PIX_FMT_XRGB32), formats::BGRX8888 }, { V4L2PixelFormat(V4L2_PIX_FMT_RGBX32), formats::XBGR8888 }, { V4L2PixelFormat(V4L2_PIX_FMT_RGBA32), formats::ABGR8888 }, { V4L2PixelFormat(V4L2_PIX_FMT_ABGR32), formats::ARGB8888 },