From patchwork Thu Jul 15 18:15:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vedant Paranjape X-Patchwork-Id: 12967 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 0621EC3225 for ; Thu, 15 Jul 2021 18:15:51 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4581D6852A; Thu, 15 Jul 2021 20:15:50 +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="cOGigy2f"; dkim-atps=neutral Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 56A6C6059F for ; Thu, 15 Jul 2021 20:15:48 +0200 (CEST) Received: by mail-pf1-x42f.google.com with SMTP id a127so6231781pfa.10 for ; Thu, 15 Jul 2021 11:15:48 -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=SYfOqql/X7mpZA5XQyiXNpSfKtZrj8HFScSnM6oKiGk=; b=cOGigy2fAbCBjLAKut90unKDx+d7hk/+HUyreuGUb1wfsfKb7m5oEQTWge9weouRGI VTwN4BFwLjeCP7GKDH4BiBA4h7tqmW81pABEIM/qmLCA9s+RiV5HyksU5dbiIhSAx72P 3KhMZEPNeULlxyA3wB71PNcVp9ll3azA+Mx9vJ0bts8FN21+xLXRUBLnUDmuHxRGX6dV 6w+IY1xHVnAJ3jKH1gdlbYovP/1CVas1GCwggqXRaF/i98zp4XlvFVtmmPf3E6eLL15R 8yiM2etVJIp/3H1lUMnqy0KBm2/fcooPz0T0xCgzMKo/DIGos7NezEgX387Pd6rB4ewO ichA== 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=SYfOqql/X7mpZA5XQyiXNpSfKtZrj8HFScSnM6oKiGk=; b=lMl9W0+WlknNBcRyW67ZEJxyAPgY105hmKbQhvwjFNoHSVVU7g9yt+NJGxDPiDH1Jt MbmmaksjHzF5KSqirOGw5BydniUyMFhzAWszyD/XV4R+2xC/i2JeZlOmQktp/1/yi2hL HfqoyNSZAQl5qFL9s+pkj4mtjCBtxZhZauOgCACIWml4nqBkcB4PAf0ufQcXYhZvoe2S B6NzKf3woG9U04gaDTqyxVT0VxvQZqjHRHLWhtwMvSxxNt6zhE7OqtZellt2Z1iavMpv tfFqF6/1p585cq3V7+y90IbqDy360JGL4lewlwJ/q6qmtpeSWYnSl7VbIAPAjzi82GP4 EFbQ== X-Gm-Message-State: AOAM532az75AiRh0Pe10BEvYHsgt8fhU5rDyCDkUlndHE8PlKtfTqkIY B6yc6kKadXDMuERnZG7Rl8WbtnI1lIFRuivI2e0= X-Google-Smtp-Source: ABdhPJyBVMevx+yZla0Bv079wJ6SGCuYRSdCXeitQTmQTqnZ67rLvSvfH5QWFjTIvuV7ccy5f3WKew== X-Received: by 2002:a05:6a00:158e:b029:32b:9de5:a198 with SMTP id u14-20020a056a00158eb029032b9de5a198mr6019200pfk.3.1626372946282; Thu, 15 Jul 2021 11:15:46 -0700 (PDT) Received: from localhost.localdomain ([1.186.167.37]) by smtp.googlemail.com with ESMTPSA id b3sm7358293pfi.179.2021.07.15.11.15.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Jul 2021 11:15:45 -0700 (PDT) From: Vedant Paranjape To: libcamera-devel@lists.libcamera.org Date: Thu, 15 Jul 2021 23:45:21 +0530 Message-Id: <20210715181522.273606-1-vedantparanjape160201@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 1/2] Fixes: 4fd6bb33 ("libcamera: Add support for XRGB8888 and 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 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 18:15:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vedant Paranjape X-Patchwork-Id: 12968 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 03D86C3225 for ; Thu, 15 Jul 2021 18:15:53 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id ACA036853E; Thu, 15 Jul 2021 20:15:52 +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="rNXqHZrv"; dkim-atps=neutral Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A08C168538 for ; Thu, 15 Jul 2021 20:15:51 +0200 (CEST) Received: by mail-pl1-x62c.google.com with SMTP id h1so3832479plf.6 for ; Thu, 15 Jul 2021 11:15:51 -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=rNXqHZrvVbexc2QM24+axgB4Ks27CJqDo2oYHLdFFix4wGn5naiwMAbarosoR4xcXp TGf3x0IG2WnfQJ2S1QTEvn/vKsU3hBtDwqEXDY3IzaHqa8dofEfp/dkUKkl4urmhXwmU Q5dMqeYwnUct14OmyU2RgTMuZ9ks5E8UC3AVa9NVeLFDdcaITfZh5UB401ydVs22XTkc uNMeU4KJGK0XGawrmULyZqutM0WnY4xIKmlxRnjUMytt4n9vImjqVzeB0wqo1PQmLgwR NmnFdRS/xHUs5g26tXhNbycpFJ2FPyUlkTNBbVjftXIy8Cl93v0CFz/T15IJy/bvb5Sm WdTg== 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=ayuOdkF3NAVY4Prk6OvSE90hNcVO3X/Q4VfNKjJEKyERObEOdBHcPOEJ29dKganMEZ tgIBNMUj2nAKI8t6ZMrihQapenKs2NlwOM/2N65Cp++aVbZlXydDkwDXrmJJnIO7ViOi FPpj1qE5MgRryF/8eC7BJUn59F6VCQRdQeu7epLjkJlMt8yjJiT7bn6d4odmM+/39mdc 89AafwKlWdenTeay5Zt5HBLh1pEooRmIKwmHAEUj7IKS9wO5bkuwvKrRQ6pfEe0NvyIc RjAiaUNpAyDtIbCZZbwWJDWiE0akDTRW/7B0F81YcZ90YzzO6JtuoYID+VihlcRO0bF4 7vxA== X-Gm-Message-State: AOAM5315Zcy/6wD0EzlYCdViV5qUR5fAvP6B+m75u3xFeRGXMv1mhVeN XKuB1xsVE2Y2CKU7FsTYWyhMVoljzcRnUBaymQI= X-Google-Smtp-Source: ABdhPJxI4YO9osAkWBTdl/0iHV7FhGNZDbBSwYsdfDSTg2m2TfKigLwsdponxi5NxYJVJkbTf/t58w== X-Received: by 2002:a17:902:7085:b029:114:eb3f:fe29 with SMTP id z5-20020a1709027085b0290114eb3ffe29mr4408821plk.40.1626372950010; Thu, 15 Jul 2021 11:15:50 -0700 (PDT) Received: from localhost.localdomain ([1.186.167.37]) by smtp.googlemail.com with ESMTPSA id b3sm7358293pfi.179.2021.07.15.11.15.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Jul 2021 11:15:49 -0700 (PDT) From: Vedant Paranjape To: libcamera-devel@lists.libcamera.org Date: Thu, 15 Jul 2021 23:45:22 +0530 Message-Id: <20210715181522.273606-2-vedantparanjape160201@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210715181522.273606-1-vedantparanjape160201@gmail.com> References: <20210715181522.273606-1-vedantparanjape160201@gmail.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 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 },