From patchwork Fri Dec 10 14:44:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 15119 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 81CA4BF415 for ; Fri, 10 Dec 2021 14:44:48 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id DEAF0608A8; Fri, 10 Dec 2021 15:44:47 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="Osgcxd1h"; dkim-atps=neutral Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2873060898 for ; Fri, 10 Dec 2021 15:44:41 +0100 (CET) Received: by mail-wr1-x42b.google.com with SMTP id a18so15315688wrn.6 for ; Fri, 10 Dec 2021 06:44:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HmfJ8ac2EKHf4bnrsfrn/IYvdkuy5nb+6QQ8a96WsCY=; b=Osgcxd1h16dTeVKrr8zRN/DxScdKaphCLdzwEtAqE+0KTboj7bcRsFIQWLw0UeB+/B xusGN9AvTzVcGRbsESTMNIB9Pnb0zz+6YrXDoUb73qOAcUSixoTXVOnajp2imoq4WIfk OL6OBsd+wcnMihOZdBWBb+uCQEmIGeRV4BklwH4pmc+QsgTUb4+Aq/7vRvsynAJBfcpp LhR5jl1GDKwgvz72RgVx5PuyCSrrSRADZA4CSWewsDmC7BYb+8+9pwL45+sr6nnZBPim JAdgHpExIdL0Br+M+nEAGQBMjBSDLsAQfLsOLgAvA3uo4kVe7qkD8YRcKMMAz/zaDLHR jT7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HmfJ8ac2EKHf4bnrsfrn/IYvdkuy5nb+6QQ8a96WsCY=; b=bB+3047J9gr1rUyGRVKL1+9D3IXPFumGML+d/cUR6T4DYexCBjldgbO01v6iRGOUaU qlctREyqWgQlFcbZHJzF1Nr/QYYumLuWrFJPBP8Mlr1nONXyzfVh+IGS/ILlPWJ6QRO2 P4g15yfav+4dSQTEBU/cw5iC6jTBWKL7RqcQQFCjAxPcPHiW16nizWaoBS/HI0wkCF/T RPRUE0MpxCjWmPGn9hrtQgxW2GYjys95zMct+PIMLJBEbAZ4D8ONXYXZYRfxq1R6bBpp U8LLZoMgPG1260rvtwgjeT0qDyQI1+ldnNlMqG0wwQuIdX2P55vC0xjNnaVXEqXh7DWw H37g== X-Gm-Message-State: AOAM532bh75sj7TvsSLlCr/nuVD+NpXmwLnvqw2MqGoSfdHMvYIHfQGM CmaqQ64YJ1VF+0yHNBVQT5Wuxg== X-Google-Smtp-Source: ABdhPJyYvQWZayRuF/r2Z8jK6SXmXncn+hOgKnVbSLBDX+p3lvSYoy8Dt0jvaz7px3VCyBqXgmJqvw== X-Received: by 2002:adf:e747:: with SMTP id c7mr14604832wrn.38.1639147480894; Fri, 10 Dec 2021 06:44:40 -0800 (PST) Received: from pi4-davidp.pitowers.org ([2a00:1098:3142:14:e4a2:3070:eea4:e434]) by smtp.gmail.com with ESMTPSA id w22sm3000515wmi.27.2021.12.10.06.44.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Dec 2021 06:44:40 -0800 (PST) From: David Plowman To: Laurent Pinchart , Kieran Bingham , Hans Verkuil , Tomasz Figa , Jacopo Mondi , Naushir Patuck , libcamera-devel@lists.libcamera.org Date: Fri, 10 Dec 2021 14:44:22 +0000 Message-Id: <20211210144424.14747-7-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211210144424.14747-1-david.plowman@raspberrypi.com> References: <20211210144424.14747-1-david.plowman@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v12 6/8] libcamera: v4l2_subdevice: Support passing ColorSpaces to V4L2 subdevices 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" The ColorSpace from the StreamConfiguration is now handled appropriately in the V4L2Subdevice. Signed-off-by: David Plowman Reviewed-by: Laurent Pinchart Reviewed-by: Jacopo Mondi --- src/libcamera/v4l2_subdevice.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp index b782325a..fa216e85 100644 --- a/src/libcamera/v4l2_subdevice.cpp +++ b/src/libcamera/v4l2_subdevice.cpp @@ -415,6 +415,7 @@ int V4L2Subdevice::getFormat(unsigned int pad, V4L2SubdeviceFormat *format, format->size.width = subdevFmt.format.width; format->size.height = subdevFmt.format.height; format->mbus_code = subdevFmt.format.code; + format->colorSpace = toColorSpace(subdevFmt.format); return 0; } @@ -442,6 +443,7 @@ int V4L2Subdevice::setFormat(unsigned int pad, V4L2SubdeviceFormat *format, subdevFmt.format.height = format->size.height; subdevFmt.format.code = format->mbus_code; subdevFmt.format.field = V4L2_FIELD_NONE; + fromColorSpace(format->colorSpace, subdevFmt.format); int ret = ioctl(VIDIOC_SUBDEV_S_FMT, &subdevFmt); if (ret) { @@ -454,6 +456,7 @@ int V4L2Subdevice::setFormat(unsigned int pad, V4L2SubdeviceFormat *format, format->size.width = subdevFmt.format.width; format->size.height = subdevFmt.format.height; format->mbus_code = subdevFmt.format.code; + format->colorSpace = toColorSpace(subdevFmt.format); return 0; }