From patchwork Mon Aug 29 10:04:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 17223 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 6C617C3272 for ; Mon, 29 Aug 2022 10:04:28 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 2327661FC4; Mon, 29 Aug 2022 12:04:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1661767468; bh=HXSEU9XbPmNwni/4BnhJsezUu0yOUCWcVZhGYF5g/1E=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=tn+rgAYxOz0b5qbKLK6lkjbAcRuLV7nxdT2u1I4eFfzemO6g4WFYerE5eG01xjMxI sO/gN3uDj8DUFyzPNUbnRLQExnUWlDQ6dKvRFIxb9105xybHongEPH9wz4SqpRPE0f fAY9qEhd+1ui5598/UjvEgQhDaBSm3AZFYJYmS2vods6dYiASDbtatTy8BeqHVek9Z P9V/rYlmwmVpX80s9FbxFiJN3PP8Ehpunoa5tNFbeO8/9Tp5JT5jAs2nunOmr28Ely 6jBeTVHE6ANXqxM0tLOd5/fDdGSu8evLIxbYU5fioWkaneJGyLZVpV2uexdVL9lMFT a83mk9adAuFCA== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B3ED761FBC for ; Mon, 29 Aug 2022 12:04:25 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="EZRjMoA9"; dkim-atps=neutral Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 3F3DFA1D for ; Mon, 29 Aug 2022 12:04:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1661767465; bh=HXSEU9XbPmNwni/4BnhJsezUu0yOUCWcVZhGYF5g/1E=; h=From:To:Subject:Date:In-Reply-To:References:From; b=EZRjMoA92AZHU6SH1ZsuyHwurq1eZlC+qIupamT99jAMOiGktlkR6sdsgRuzGly/a vhJOMduFNChwk89Faxl1rd8NUqpbT6DBQveC81AoGJY2k9dWgkhL7Kuv8Is3DqdBD4 yn4p5jmD3bMpBVch2eKbCdBoVnxj+HZ3oDBZM59A= To: libcamera-devel@lists.libcamera.org Date: Mon, 29 Aug 2022 13:04:12 +0300 Message-Id: <20220829100414.28404-2-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220829100414.28404-1-laurent.pinchart@ideasonboard.com> References: <20220829100414.28404-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 1/3] pipeline: uvcvideo: Add color space support 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: , X-Patchwork-Original-From: Laurent Pinchart via libcamera-devel From: Laurent Pinchart Reply-To: Laurent Pinchart Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Add support for color space to the uvcvideo pipeline handler. UVC devices have a fixed color space per format, so only the validate() function needs to be extended to retrieve the color space from the kernel. There is no need to pass the value back to the driver in configure(). Signed-off-by: Laurent Pinchart Reviewed-by: Umang Jain --- src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp index 9cbf126aea57..2ae640a31f68 100644 --- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp +++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp @@ -159,6 +159,11 @@ CameraConfiguration::Status UVCCameraConfiguration::validate() cfg.stride = format.planes[0].bpl; cfg.frameSize = format.planes[0].size; + if (cfg.colorSpace != format.colorSpace) { + cfg.colorSpace = format.colorSpace; + status = Adjusted; + } + return status; }