From patchwork Mon Jun 30 07:42:16 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 23685 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 3EF84BDCBF for ; Mon, 30 Jun 2025 07:42:37 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id DA2EA68E05; Mon, 30 Jun 2025 09:42:35 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=igalia.com header.i=@igalia.com header.b="Txt1fU8R"; dkim-atps=neutral Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id D799A61529 for ; Mon, 30 Jun 2025 09:42:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject: Cc:To:From:Sender:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=qe8gll63tQDLa6yIusZ32gWu7SVQFFPxif/0qiii7Zw=; b=Txt1fU8RO3mPOa7gVkIQ+HyRey GiWm/qmdnAXZntnIACYVyoQiKhsDIXdmc9vM4HFP62S3Z/HafXaP+iObOUY7DH/PlP72jb7PCso2Y W25uQCqJg+/6goKwEIofKFymDkrl0tDq9EFv4os4qVJ/e0gh45m87vPgarW8ErH6PDQagtEuvWafS l2Ykf0sM2rT37nXirqiDcu45kn1foWd4CRMRRL1sQF+i6yc/82j9e8V+ozG1He+H973YgAp3HJ3LD Mo4ODzI/o6ypt8/gLwYkOg9BtcD2qQmuuEJq06aAr77mzQm7RRTGvOInnjMQYzoJ/pML5ic9TA8yB zOVLoBgQ==; Received: from [49.36.69.141] (helo=uajain.lan) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1uW99r-00ANIV-Vq; Mon, 30 Jun 2025 09:42:32 +0200 From: Umang Jain To: libcamera-devel@lists.libcamera.org Cc: Antoine Bouyer , Milan Zamazal , Umang Jain Subject: [PATCH] lc-compliance: Ensure stream's colorspace is set after validate() Date: Mon, 30 Jun 2025 13:12:16 +0530 Message-ID: <20250630074216.13731-1-uajain@igalia.com> X-Mailer: git-send-email 2.50.0 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" StreamConfiguration::colorspace is a std::optional<> and if unset by the user, it should be populated by the pipeline handler after the CameraConfiguration::validate(). Add a EXPECT_TRUE() check to ensure that each stream in the CameraConfiguration has a colorspace set. Signed-off-by: Umang Jain Reviewed-by: Kieran Bingham --- Question for reviewers: Should setting the colorspace rule be applied to all pipeline handlers, or do we have exceptions? For e.g. Laurent's comment: https://patchwork.libcamera.org/patch/22373/#32812 suggests to set ColorSpace::Raw if the colorspace is still unknown after validate() - which will lead to pass this lc-compliance test in those cases as well. Also I preferred EXPECT_TRUE() deliberately as it is non-fatal and all such violations can be caught in a single lc-compliance run for a platform. --- src/apps/lc-compliance/helpers/capture.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/apps/lc-compliance/helpers/capture.cpp b/src/apps/lc-compliance/helpers/capture.cpp index 2a3fa3b6..e767e45e 100644 --- a/src/apps/lc-compliance/helpers/capture.cpp +++ b/src/apps/lc-compliance/helpers/capture.cpp @@ -52,6 +52,9 @@ void Capture::configure(libcamera::Span roles) FAIL() << "Configuration not valid"; } + for (auto &cfg : *config_) + EXPECT_TRUE(cfg.colorSpace) << cfg << " - colorspace not set."; + if (camera_->configure(config_.get())) { config_.reset(); FAIL() << "Failed to configure camera";