From patchwork Tue Apr 6 10:40:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 11843 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 2F504BD695 for ; Tue, 6 Apr 2021 10:41:03 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 75E016879E; Tue, 6 Apr 2021 12:41:01 +0200 (CEST) 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="JxD4SiDD"; dkim-atps=neutral Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0904760518 for ; Tue, 6 Apr 2021 12:40:58 +0200 (CEST) Received: by mail-ej1-x630.google.com with SMTP id w3so21129762ejc.4 for ; Tue, 06 Apr 2021 03:40:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=rSOJgaNUw3NF/cZf8r+FqCQTK/JHz4v6Ca7da4ob6Vs=; b=JxD4SiDDbQw1FT5Sw9AGB34xghXw2oz5G1jKHJNYP1vSPnf7YxckCldKAeQeWj8IJq DjE1hRlQXxyGeEWC+eRg6RbgKSzhAHCM7N7jGZih+CAj7vQYDuyVzawLr+HCVhHcKbwy 6l1rlSjDtlSIp9AX/p6vWtywCTmL92OdCZZSHGDbFxysCnJRi5gbEmwf0SkwGFNLRy3w dBMUCzPKDZH7UlSsbADLgK1fCMz5N0UvjvAMg2wjDpPDWczXgEqMMrFSOo9Tjb131IAh NZsNkZ/mvy4WWIuFDFlB9mloaI9Bn/Dk87a0x6GvkibvQgipdgfQVYPCYcNR/IHutyMR 96bQ== 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=rSOJgaNUw3NF/cZf8r+FqCQTK/JHz4v6Ca7da4ob6Vs=; b=XVjctD1EaIDSs7DyogjtGhzuZx8/SyzkmvnifkEh4kcur8uwEZERRiQ8M5TfEnYKq2 aD0qCbLbaLKfXbhF9dUxCJ/w73/Xj5TLmifCnRVdIS4NpZ629GaRTxztOPVgpG6KNs7H SBUa7fdU1QvRt2oAPRBABM3b8RllPnh401x3M+58a/97s4++vhCRdxI6AWYST6j2JGKr VBTIO3pAi1WgRGFtZQlvxg3HgoppuTQvnFYhUEPF/E6+mPGt1tiPYEoGuWh2mk+xbK6p u8mSrXJ90UR0TfkgG8vVBy811rQsr2eyJU3djIr3yROnYPoUYHEeYtODV/zqd3Wrxzif hJqQ== X-Gm-Message-State: AOAM5323ZuwZt7Thb3a1YzB0uRNb+vqwB7nlNke8Y6AKcyEYOwCoXoqv LGWAsOufCKX7kyef2DiQlsZGkfa67WZU2Q== X-Google-Smtp-Source: ABdhPJzB+95802T2i37sebTjVb2iTQowvcgvFytS5EQrwMQVgTJ/qLdMRxpNu2nieutUndEIiWp0hQ== X-Received: by 2002:a17:906:2349:: with SMTP id m9mr20135644eja.98.1617705658211; Tue, 06 Apr 2021 03:40:58 -0700 (PDT) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id df8sm4068486edb.4.2021.04.06.03.40.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Apr 2021 03:40:57 -0700 (PDT) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Tue, 6 Apr 2021 11:40:48 +0100 Message-Id: <20210406104050.23814-1-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 0/2] Fix CameraSensor::sensorInfo by updating VBLANK ControlInfo 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" Hi everyone Here's a second version of the CameraSensor::sensorInfo() fix, taking account of some of Jacopo's suggestions. The principal differences are: 1. I renamed the new method to "updateControlInfos". It seems to me a more accurate description of what the method is doing! ("refreshControls" was rather vague.) 2. CameraSensor::setFormat calls updateControlInfos directly, so it's only pipeline handlers like the RPi one (which don't use CameraSensor::setFormat) that must do so for themselves. 3. This (trivial) RPi pipeline handler update is in a separate commit, to keep it separate from the "core" changes. 4. I didn't go with the "lazy" implementation, which would have a flag in the CameraSensor that gets set, and checked before the controls are used. But we could change our minds on that at any point, it's merely an implementation detail of the CameraSensor class now. I did try to add a ControlInfo::update (and V4L2ControlInfo::update) method but, after being hounded by switch statements and casts, I found it ended up all but identical to the assignment operator - so I removed it again. But I'm still open to offers there...! Thanks David David Plowman (2): libcamera: camera_sensor: Fix frame lengths calculated by sensorInfo() libcamera: pipeline: raspberrypi: Update ControlInfos after sensor format change include/libcamera/internal/camera_sensor.h | 2 ++ include/libcamera/internal/v4l2_device.h | 2 ++ src/libcamera/camera_sensor.cpp | 31 ++++++++++++++++++- .../pipeline/raspberrypi/raspberrypi.cpp | 6 ++++ src/libcamera/v4l2_device.cpp | 26 ++++++++++++++++ 5 files changed, 66 insertions(+), 1 deletion(-)