From patchwork Thu Jan 13 14:15:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 15280 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 A84B4C325B for ; Thu, 13 Jan 2022 14:16:07 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E1F3860935; Thu, 13 Jan 2022 15:16:06 +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="g9gzCMyG"; dkim-atps=neutral Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C2CA5604F4 for ; Thu, 13 Jan 2022 15:16:04 +0100 (CET) Received: by mail-wm1-x332.google.com with SMTP id v123so3977631wme.2 for ; Thu, 13 Jan 2022 06:16:04 -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=PtWJNFmk1vWzp2J6OmgnsiVLUT9BGhimEM0bzjBaDAI=; b=g9gzCMyGmMf2OQWA7mQtriNj9+2H3Xr4WNFU+xvWrzPQtXNNj+u2d5WA66ITPJOnvV p6UoSSpnohAZvshtVvKX8+uHOu1s+RaesZAiEyr/dQHIJcnLxwwU1+eBRnO2AIAvt6Xz Ui78omCBGt2UHkNS+poml+2kV/zSrtYrTtKPgBLC/bFxanqopwjE98Z3kldF0vTQJYZr pLcsGockhIZeAnvWUTNJ6lMGm8peKG5UnbEArLH7aXuK3hL9KbrFeNDAlIfldQ9zlOoq JpM8bGzb6NfYpOwWzuIPUnW7tVA7qrJRRXvnBN2jsbMCbi9xjYibUA6xadqi5X1b7QbJ RkJg== 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=PtWJNFmk1vWzp2J6OmgnsiVLUT9BGhimEM0bzjBaDAI=; b=c/ioKBYpBYDuX8yw2s/IgCrqOdCgF/BJ16X4JV0qE5OND9dNFZBYi8s5aDcIY+WZ4T /fEKFdiH8jkpXP/k9pHKabzI9uRcwdlSm2669RWOAqXmxpwPBfQVG2g0c/6kdvnwzjkp ksweePAIBcbtwVN5oO7ifTHkT3R1VNLWCDGMhGqEKg3I/X6pVKDWxVy56YJPKxxzYWki ppbY52bI2iF1hErJ/fmJLPoTuNwuZlytxZxcI8tBRXxBCus6eCyG2GlV+Q/8dovrTzfH cxMutMa2g5Gf+2lUMXRtFce8LwRrnnR8PFnMpg3rb+pHFykrwL91g/k15bw4qrsjE+w4 PFWQ== X-Gm-Message-State: AOAM530UjIoix+7TN2W2SQb5wwnf+oUG6Lzfm4DiLMeqyqxHu+ZC7MnO /0BKfvyHNFJA13Ivvb9xwIolz1zlOPneWEZc X-Google-Smtp-Source: ABdhPJy62t05DYyJVwul+KsWAltAr7HIp6VtqUvv2U+eAEf5U0A0IVqS8lXeZi5K8YT2oxeVxMtIIw== X-Received: by 2002:a05:600c:1d95:: with SMTP id p21mr4013972wms.9.1642083364227; Thu, 13 Jan 2022 06:16:04 -0800 (PST) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id b2sm3284584wrd.35.2022.01.13.06.16.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jan 2022 06:16:03 -0800 (PST) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Thu, 13 Jan 2022 14:15:58 +0000 Message-Id: <20220113141558.5805-3-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220113141558.5805-1-david.plowman@raspberrypi.com> References: <20220113141558.5805-1-david.plowman@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 2/2] pipeline: raspberrypi: Simplify calculation of sensor's native Bayer order 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" Now that the sensor is defined to list mbus codes using its native (untransformed) Bayer order, the method of obtaining it can be simplified. We don't have to try and reset the flips, we just use the value directly from the sensor. Signed-off-by: David Plowman Reviewed-by: Kieran Bingham Reviewed-by: Naushir Patuck --- src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp index 49d7ff23..79cb75c6 100644 --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp @@ -1279,8 +1279,8 @@ int PipelineHandlerRPi::registerCamera(MediaDevice *unicam, MediaDevice *isp, Me * Thirdly, what is the "native" Bayer order, when no transforms are * applied? * - * As part of answering the final question, we reset the camera to - * no transform at all. + * We note that the sensor's cached list of supported formats is + * already in the "native" order, with any flips having been undone. */ const V4L2Subdevice *sensor = data->sensor_->device(); const struct v4l2_query_ext_ctrl *hflipCtrl = sensor->controlInfo(V4L2_CID_HFLIP); @@ -1288,11 +1288,6 @@ int PipelineHandlerRPi::registerCamera(MediaDevice *unicam, MediaDevice *isp, Me /* We assume it will support vflips too... */ data->supportsFlips_ = true; data->flipsAlterBayerOrder_ = hflipCtrl->flags & V4L2_CTRL_FLAG_MODIFY_LAYOUT; - - ControlList ctrls(data->sensor_->controls()); - ctrls.set(V4L2_CID_HFLIP, 0); - ctrls.set(V4L2_CID_VFLIP, 0); - data->setSensorControls(ctrls); } /* Look for a valid Bayer format. */