From patchwork Tue Mar 30 16:57:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 11796 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 BE044C0DA3 for ; Tue, 30 Mar 2021 16:57:51 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0E02F68782; Tue, 30 Mar 2021 18:57:51 +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="lUb8LKq7"; dkim-atps=neutral Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A72DA602D2 for ; Tue, 30 Mar 2021 18:57:49 +0200 (CEST) Received: by mail-wm1-x32f.google.com with SMTP id b2-20020a7bc2420000b029010be1081172so8805655wmj.1 for ; Tue, 30 Mar 2021 09:57:49 -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=s/HYy3aySFTeYwe0B2XB8aV0coXSY3WEqyhGPqGM+Og=; b=lUb8LKq7wful5Ta4r5kMeTL4/y3Mfi38vN3Ih1BQWlfbB3+C3eSZrjsvBgJ5MTp+YE F0QlIJapYMxt+PfW9K8eA5lwDjLbq5RhrBqfzwyp7DKlr65cswQ89KT4XlVHN7LU+7lC MU9GbQDmW7Ksp5u2TUFKm/0Bal3F4k9Aq22N5eO71g2wxE6fHOZTM6AIVmJxxfslRjMa QFKtFGSC7EyHtO4NwDz2jSts04XNduUuY6lEkbBK6ldI6s616BAdnoHxCNhYiXh/2loN VCKr1UGFremJvoREeuHdSmsTwaPzeRdV2OEjMPEY3d+xZYv0WIzK5fm4l+zRF+dpH4Ih mUmA== 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=s/HYy3aySFTeYwe0B2XB8aV0coXSY3WEqyhGPqGM+Og=; b=qtk2h/bcn83c+qGg6Z1CybQ7JWIPZLkLQCrjZxiXm7Ncqlx9qc1GQOARTS/MNS8sHO +fZaK3xgXl7PxNxDmPfQcBG9L27xXoH/O/RVOGirCfVtI1zhXwrEukaNu9dzAFHurpuB golJTjRQaWXgoQFDKeKns03Qs9z6N49UXgEstUYOklhARyoi+ClzKZq4EIZ0EKFrcEDw qddem2VTYATLJS4wr027ScOusBWQgZHTcQf4EL7TesUYKD1i04t3rw0VRTQgzXSIMkWS 3oJs6zehXcfhAGqz53o9x19tQOPET6C93vGqRWuGTlv9p8DjUv4b6YqmVtAFLNvuaYbQ pP4w== X-Gm-Message-State: AOAM533KCTl4yJZR2cW/goUPMTVTee4KxCOcKOSbFlsMsNsQYtJbP8VH XL/CvDCBFIRexcBbImkvS5Bs//krWrlR/Q== X-Google-Smtp-Source: ABdhPJyG6/62zYvLw4byu1NVtaaRnBhBMvfI8l/bw92rExtCYjy3OrzP5tigCW6+Vuewk4qZK9i+dA== X-Received: by 2002:a7b:c0c4:: with SMTP id s4mr5113325wmh.9.1617123468663; Tue, 30 Mar 2021 09:57:48 -0700 (PDT) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id s13sm3695448wrv.80.2021.03.30.09.57.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Mar 2021 09:57:48 -0700 (PDT) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Tue, 30 Mar 2021 17:57:42 +0100 Message-Id: <20210330165743.4924-1-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 0/1] 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 You may recall a while back I raised a problem where CameraSensor::sensorInfo() produces incorrect min and max frame lengths, resulting in cameras running at incorrect framerates (and sometimes causing AGC wobbles). The reason was that the sensor's min and max vblanking can vary when the format is changed, and our ControlInfo mechanism has no means of knowing that it needs to be updated. We discussed a number of alternatives - I think it's fair to say that there weren't any obvious neat fixes at this time. Among the alternatives was that of updating the ControlInfos directly, and this has to be run at some point after a new format is set, and before sensorInfo() uses the control ranges. Anyway, here is an implenentation of that scheme for folks to have a look at and consider. What do we think, does it fix the problem sufficiently, or are there better alternatives? Opinions welcome! Thanks David David Plowman (1): libcamera: camera_sensor: Fix frame lengths calculated by sensorInfo() include/libcamera/internal/v4l2_device.h | 2 ++ src/libcamera/camera_sensor.cpp | 7 +++++++ src/libcamera/v4l2_device.cpp | 26 ++++++++++++++++++++++++ 3 files changed, 35 insertions(+)