From patchwork Mon Oct 3 08:39:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 17487 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 4B9E8C0DA4 for ; Mon, 3 Oct 2022 08:40:00 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C045362CDA; Mon, 3 Oct 2022 10:39:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1664786399; bh=CrtX9S9FEmGaw9pkg5N6rD1IG/06T+mjz9da0eT/Hx4=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=wAFFbxhthFWCy/IlewlkSwshbVHARzyXQWfH8jyn4b2KuspoQIBy6/vRYhPUIiBSb xz5hN+/IkISgalxEBlIe1NSKRRbnFQiwg4mhXLJ9xere0ZT2GEb6ODg9yV46Pox99b 7YOjaZTgGU3Tp/OM1U/LpyvTvhfRh2tOKkj1/YV3aLpip9cDxBuzMeFEm1W9GcxQS3 mSzGABKkwf8rPJdZ8xy91Od16iT91BwzgEOOLNIRV1rbD4N3ddjBV7A3jI8c+7gUOy L8+YS63YyflUf0kMT8RdJmEh35Qn4Oyydu1vUCJIG5PmCHsv5unDuVgOPhGslywEtF Z928rK6CXVQIg== Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A0F2561F74 for ; Mon, 3 Oct 2022 10:39:57 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="PZZvScbs"; dkim-atps=neutral Received: by mail-wm1-x32b.google.com with SMTP id t4so6521121wmj.5 for ; Mon, 03 Oct 2022 01:39:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=eBs52gCHAWuBOQh3E138mW8x6x8yqrMgK4kfz9biCYY=; b=PZZvScbseBU3zpku4tg28XgBf43dkpZMtuwqiUrj1Np8bREdzjTe8bPdVVoYhhApVH GWoqCG10yx5c5+ktuKmi1BR4ifT73+Tb9moHvzURNb8i/aVynVW0/YkHIAZlqIQdhSvq E7ScKQme3tPCUVyw/+pfyVw7cy/KQFmCGSr8JoummZhSmU/XmD43ggLhNdzgmrwEf1ug spXC5izVF6wMugxzsq/41x0zQ7OLkX8FrMjMhdyKS+n5Zus5ZGROK7d6Vs38dnXPP6um o+jKemhumVY4EMYCqxURGQJA5pFAKwv7/vPULLVQAjcGfuqJ2jd/JAlpaTz3jyCHkDCs NrgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=eBs52gCHAWuBOQh3E138mW8x6x8yqrMgK4kfz9biCYY=; b=AI98DztdQ5wzsM5VWWqZj1aKWrLLls6BRN0FADY47NLYIXnrgnOG24fdogX8hCGa0g 8SbdI6UNPmXS/dQ+bDJqjQ6vj5XBHaeBam93KMzcm2ViDLp6fyaDVNbls+s1iPjJI4lq /4qZV/84om3ZPMKBwMOM5UbotLeaiIg0pC24TBDoDDwPXMlmc15J0NvuFcVxEbo42RhF DgA6lGVTB93Lizgn5cwUcwFFUIjKk/NjGWUxSitN8eNc/tKfHM5YQUF8Pf+VBtr2ptMx +f6GMI0sXYUnM0J8gUi8Uv6H9TaWqLw+13uwiT2KqaFT3xKwBKZl1PXXHdcMQSFC9Gwj UhHw== X-Gm-Message-State: ACrzQf2KKVaUOBDAD827xxvtHBQQFj9KRF22TTNraSDJ0ee6+FQ8Alfn UFUw2fn1NF6vTJa69MH2r/GK/TX63E+MSw== X-Google-Smtp-Source: AMsMyM4nffpx5nVHyELAjfGxO8KDI7VsLokuM7oyXoCnssMEj7J8U1VSt7pjjdYcTocaS0pF15xA8A== X-Received: by 2002:a05:600c:1989:b0:3b4:b6b6:737 with SMTP id t9-20020a05600c198900b003b4b6b60737mr6176537wmq.79.1664786397035; Mon, 03 Oct 2022 01:39:57 -0700 (PDT) Received: from naush-laptop.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id i13-20020a5d55cd000000b0022ae59d472esm8922787wrw.112.2022.10.03.01.39.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Oct 2022 01:39:56 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Mon, 3 Oct 2022 09:39:26 +0100 Message-Id: <20221003083934.31629-1-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v1 0/9] Raspberry Pi: Horizontal blanking control 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: Naushir Patuck via libcamera-devel From: Naushir Patuck Reply-To: Naushir Patuck Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Hi, This series adds full automatic sensor horizontal blanking control (to compliment the existing vertical blanking control) for exposure and/or frame duration calculations. In the new calculations, we always prioritise extending vblank until it reaches its limits, then extend hblank to make up the shortfall. This is to minimise the "wobble" effect of the rolling shutter in the sensor. The rkisp1 and ipu3 IPAs are updated to use the minimum reported hblank value in their calculations for the same reason. Patches 1-2 adds a max line length field to the IPACameraSensorInfo and CameraMode structures. Patchs 3-6 update the IPA and pipeline handler to pass around a current line length value. Patches 7-8 update the calculations to return a hblank number to program in the sensor. Patch 9 updates the embedded data parsers to extract current line length values. Regards, Naush Naushir Patuck (9): camera_sensor: Add minimum and maximum line length to IPACameraSensorInfo ipa: raspberrypi: Add minimum and maximum line length fields to CameraMode ipa: raspberrypi: Pass lineLength into the CamHelper API pipeline: ipa: raspberrypi: Add HBLANK control to DelayedControls ipa: raspberrypi: Add pixel clock rate to the CameraMode structure ipa: raspberrypi: Add line length to DeviceStatus ipa: raspberrypi: Add line length calculations helper functions ipa: raspberrypi: Allow full line length control ipa: raspberrypi: Extract line length from the embedded data parser include/libcamera/ipa/core.mojom | 21 +++-- include/libcamera/ipa/raspberrypi.mojom | 1 + src/ipa/ipu3/ipu3.cpp | 2 +- src/ipa/raspberrypi/cam_helper.cpp | 81 ++++++++++++++----- src/ipa/raspberrypi/cam_helper.h | 18 +++-- src/ipa/raspberrypi/cam_helper_imx219.cpp | 10 ++- src/ipa/raspberrypi/cam_helper_imx290.cpp | 5 +- src/ipa/raspberrypi/cam_helper_imx296.cpp | 10 ++- src/ipa/raspberrypi/cam_helper_imx477.cpp | 39 +++++---- src/ipa/raspberrypi/cam_helper_imx519.cpp | 39 +++++---- src/ipa/raspberrypi/cam_helper_ov5647.cpp | 5 +- src/ipa/raspberrypi/cam_helper_ov9281.cpp | 5 +- src/ipa/raspberrypi/controller/camera_mode.h | 6 +- .../raspberrypi/controller/device_status.cpp | 1 + .../raspberrypi/controller/device_status.h | 4 +- src/ipa/raspberrypi/raspberrypi.cpp | 61 ++++++++------ src/ipa/rkisp1/rkisp1.cpp | 2 +- src/libcamera/camera_sensor.cpp | 6 +- .../pipeline/raspberrypi/raspberrypi.cpp | 1 + 19 files changed, 216 insertions(+), 101 deletions(-) Tested-by: Dave Stevenson