From patchwork Fri Oct 2 09:33:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 9898 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 8A76BC3B5B for ; Fri, 2 Oct 2020 09:33:15 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 1E56363AF7; Fri, 2 Oct 2020 11:33:15 +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="cURLDfZT"; 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 E4C3D60394 for ; Fri, 2 Oct 2020 11:33:13 +0200 (CEST) Received: by mail-wm1-x332.google.com with SMTP id w2so947968wmi.1 for ; Fri, 02 Oct 2020 02:33:13 -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=ICiUxvshAnfj1HO7dRQlVd3uXCE26lhA/MqB89nwzM8=; b=cURLDfZTyYxMP/bD/gYtGxITtJiYCb1hGDVfhGkEyF5QVWbc1Lb4ggE5c4JYS5VmCW Ad9LdgSbKyVpOphrTF0KA0d32MxVIoq76FGeOedju0E+PI3fBphiPglYp+CWihxjJj8d 1j+ByO2YbrvEXj/ZaWfb8Vz8Sowd1AXxODFmA6gDzt2OfnZuBf9ZQY/k4iae0pSChwht JgjwjAvoq11gSbPe9ws8d1YDkde2okTY01Wuib2I9nFPKyQkq53UUbNyn7lAMkARbo+l LbCg51yiz8aiaYW72HCQfUwH6N2s1eNryRJJ1Ajeca2ajOeTxPbVXbnSMhxMzwNAVHsm QIVg== 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=ICiUxvshAnfj1HO7dRQlVd3uXCE26lhA/MqB89nwzM8=; b=hzOr6a5fuTipQnF2F6fBG40WNGLduXjqMJr7Tuev8NAB/hTw25BMaesq7VdnEMiy9C zQ2clm2+UKfpVFkP1N9CjoGyr7MZ7M7t5RMNOtxbXYHcoKngqTsFzi4VahbMZ7Mjq68O jSt3hkJFSlSGHzQ2LAqwxV8PkutH5j3/9iy5D2UC0uvMckCbG00XXh27DN01gJ2vrwTh OGnKxSUX+xKz5LuXpaLgLhFinTAd0Iyn1YKW/DrHyL4BlrwO8i6Yl5YmNH+rVsdzzqEI lZuIDksrEuTwHgDSNcENCR5HzBIXglL0FVlw5lYHO/gfdFKeIWtE+LTtvW5zvcnvqhJV G5nQ== X-Gm-Message-State: AOAM5311eAdNc9oLylKQlEQlt0WOTCb9YFUPzNQaaqtp+wqa8wwM4LI1 focgwKNCOUUdO/hNOA4LUO8iqgDceLXHmg== X-Google-Smtp-Source: ABdhPJy95UxQdUMUoyzlMOufT3OMNK2I2vnRrl3LAt1iNAERfwYWW57LSIhfvZiSFBjMgvTbISvDhA== X-Received: by 2002:a1c:7f0f:: with SMTP id a15mr1783751wmd.97.1601631193051; Fri, 02 Oct 2020 02:33:13 -0700 (PDT) Received: from naushir-VirtualBox.pitowers.org ([2a00:1098:3142:14:a00:27ff:fe4d:f6a2]) by smtp.gmail.com with ESMTPSA id t203sm1101145wmg.43.2020.10.02.02.33.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Oct 2020 02:33:12 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Fri, 2 Oct 2020 10:33:04 +0100 Message-Id: <20201002093309.109180-1-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 0/5] RFQ: Pass controls on camera:start() 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 all, I would like to resurrect the topic of passing controls to the pipeline handlers and ipas on startup. We talked about this some time back, and unfortunately it drifted off my radar. Attached is some work I've done to resurrect this discussion. I have added the ability for an application to pass in controls through the camera::start() public API. This is similar to how controls are passed in though Requests, the only difference being that if we do pass it in the latter, we could incur multiple frames of delay before they are applied. This would be unsuitable for a lot of users I feel. This change gives us a huge jump in getting to feature parity with the existing Raspberry Pi camera stack. There are a couple of things to address in these changes: - I have modified the camera::start() public API with the following signature: int start(ControlList *controls = nullptr). I know the convention is to use a reference here, but I wanted to keep API backward compatible, and a pointer can have a default value nullptr. I could also overload start and keep the old and new signature perhaps, but not sure on the policy for public methods having multiple signatures. - the IPA context wrapper code needs the ability to serialise IPAOperationData structures. This is needed for this code, as well as for configure() as part of an earlier set of changes. Please note, this patch set is for discussion to start with and not ready to submit as-is. Happy to hear your thoughts. Regards, Naush Naushir Patuck (5): pipeline: raspberrypi: Sensor flips should be applied unconditionally libcamera: pipeline: Pass libcamera controls into pipeline_handler::start() libcamera: ipa: Pass a set of controls and return results from ipa::start() pipeline: ipa: raspberrypi: Pass controls to IPA on start DNI: qcam: Simple test to pass controls on camera::start() Documentation/guides/pipeline-handler.rst | 4 +- include/libcamera/camera.h | 2 +- .../libcamera/internal/ipa_context_wrapper.h | 3 +- include/libcamera/internal/pipeline_handler.h | 2 +- include/libcamera/ipa/ipa_interface.h | 3 +- include/libcamera/ipa/raspberrypi.h | 1 + src/ipa/libipa/ipa_interface_wrapper.cpp | 4 +- src/ipa/raspberrypi/raspberrypi.cpp | 50 ++++++++++++------- src/ipa/rkisp1/rkisp1.cpp | 3 +- src/ipa/vimc/vimc.cpp | 6 ++- src/libcamera/camera.cpp | 11 ++-- src/libcamera/ipa_context_wrapper.cpp | 6 ++- src/libcamera/ipa_interface.cpp | 7 +++ src/libcamera/pipeline/ipu3/ipu3.cpp | 4 +- .../pipeline/raspberrypi/raspberrypi.cpp | 46 ++++++++++------- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 9 ++-- src/libcamera/pipeline/simple/simple.cpp | 4 +- src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 4 +- src/libcamera/pipeline/vimc/vimc.cpp | 7 +-- src/libcamera/pipeline_handler.cpp | 1 + src/libcamera/proxy/ipa_proxy_linux.cpp | 3 +- src/libcamera/proxy/ipa_proxy_thread.cpp | 13 +++-- src/qcam/main_window.cpp | 7 ++- test/ipa/ipa_interface_test.cpp | 3 +- test/ipa/ipa_wrappers_test.cpp | 5 +- 25 files changed, 134 insertions(+), 74 deletions(-)