From patchwork Fri Oct 28 03:17:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Dufresne via libcamera-devel X-Patchwork-Id: 17715 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 B7CA2BD16B for ; Fri, 28 Oct 2022 03:17:38 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 56B2862FC6; Fri, 28 Oct 2022 05:17:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1666927058; bh=GFM5bzyejFGdCmfumkg5WZW+OFQTbKxh3hfs8kuuDvY=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=h4DGxSwQA0nIqZSAIunwl2NGhmQJ1BWgPkMSFstPABEebUImRVIPOWGZKjVjUmLvU XkASA/JUPfyFqX5ogGDx85zdYX1IFN3QOLlJhjmCtt28bBkis4TQpOxCuinGa1MoOz ATMlIAU5D0w1eDlr0vsaFnf1nkay6dKifRoeMKZyG2c1WESdMPpd6JNntA6x3qV6k+ 1WH9K/kOGkPA8skuKJCumuXtB9CfcC3NJ/uBJP8V/vgeU12mYpFOySvSMMcUOqfpJI prRynBq5T+xfjDxnb8CdmJqfB7i4vuUm0saSbQp35ZyKndPNxWT737sSuLFE3lYpvQ 7UDdTW2vinPIg== Received: from mail-oi1-x234.google.com (mail-oi1-x234.google.com [IPv6:2607:f8b0:4864:20::234]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id AD05962FAA for ; Fri, 28 Oct 2022 05:17:33 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=rothemail-net.20210112.gappssmtp.com header.i=@rothemail-net.20210112.gappssmtp.com header.b="M+XxCly7"; dkim-atps=neutral Received: by mail-oi1-x234.google.com with SMTP id t10so4922432oib.5 for ; Thu, 27 Oct 2022 20:17:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rothemail-net.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=o0jPoObmv+RL/G51+tYqdL0a/lbBQwESyygD2hJKwPI=; b=M+XxCly7EOWPRmGfTsH0gTFtlbPC4B1Q9boO48n5/qBpkAtm8NYDehxMQqlXn7dSH8 npaHv4LEsCViOywAjW9RCIq5HJwEZYUhwxUreSHOZ81UEFFACLNzQR3SSMCjWNcF2aZ5 t3JiWKneYTOcWJPNEemZh3UjhMCoJGH+QvjjJMxme+hAccCgMBwBitpNskO13S11zdrT 4B1us1wxQjelWlId52COdWdOnOTWxbTFA0snV88iNRd5zPTXpq+JI/ohhaZKRoONHbvt oNE5+PkW8tbrxRSpnfdnVlSE+fJ8YQmzY17t2VOj7Hr+0LTTU6grsJNQi2lACcNi6WOM w+nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=o0jPoObmv+RL/G51+tYqdL0a/lbBQwESyygD2hJKwPI=; b=bPXUUfmFYtZluVllnc1+IqPBU9Ix15Jle8zKNT0+UCt1Cgu1Nf++BTRMnNn6TIliEm teKyQDcPa9cOFYaUR0FFOyzlyOVwcur7q78Tt2jZtbG9Ro3stHMEfIrhTQlG5AhJNYTW Okcn/Ergm1mmev9EF3pjyX+63wc1WXCVSmJAoSb26pOewDKyLSQJqGNg1R5x8cDvRS30 2i/9QZNeRlQIZDmLn+S8UGbQliO++3k8bmehzg/0TTJzIgW4ytu/+cnNItrFVaJe92/E O7GAFDMVtWmZZGPd3qwpqU5SaECxbiO0LHHUndySUA8SfB6pSK6AwSBHJdVZUfVKb665 KBnQ== X-Gm-Message-State: ACrzQf3JyJtRqGwZUP3MJ/BUIWs95y7r81L3VxPK260qgzaAgH2KNwDi OCMO0hscYZ2gTfzoOP2OhECR4kISiEpcXXdyX/I= X-Google-Smtp-Source: AMsMyM5kt5yFiksTUut6yw0Z0r6cZxQp2Um5R4oZl7YeSlFGjaRhpR1DeudpB9tW3exaQtPS59Qqfw== X-Received: by 2002:a05:6808:128b:b0:354:c73a:7241 with SMTP id a11-20020a056808128b00b00354c73a7241mr6745729oiw.34.1666927052031; Thu, 27 Oct 2022 20:17:32 -0700 (PDT) Received: from nroth-pc.attlocal.net ([2600:1700:20:20c0:293a:90ce:6463:244d]) by smtp.gmail.com with ESMTPSA id fp19-20020a056870659300b0013626c1a5f6sm1527738oab.10.2022.10.27.20.17.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Oct 2022 20:17:31 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Thu, 27 Oct 2022 22:17:19 -0500 Message-Id: <20221028031726.4849-4-nicholas@rothemail.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221028031726.4849-1-nicholas@rothemail.net> References: <20221027224135.348115-1-nicholas@rothemail.net> <20221028031726.4849-1-nicholas@rothemail.net> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v5 03/10] ipa: add rkisp1 metadata to fix Android HAL 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: Nicholas Roth via libcamera-devel From: Nicolas Dufresne via libcamera-devel Reply-To: libcamera-devel@lists.libcamera.org Cc: nicholas@rothemail.net Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" From: Nicholas Roth Currently, the Android HAL does not work on rkisp1-based devices because required FrameDurationLimits metadata is missing from the ISP implementation. This change introduces sensible defaults for FrameDurationLimits that should generally work most of the time. In theory, it should be possible to implement more sophisticated logic to detect frame durations. The appropriate API hooks for doing so exist and are used in IPAIPU3::updateControls(), although the implementation may be suspect. This is left as future work. Signed-off-by: Nicholas Roth --- src/ipa/rkisp1/rkisp1.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp index ba3c547e..dd12c341 100644 --- a/src/ipa/rkisp1/rkisp1.cpp +++ b/src/ipa/rkisp1/rkisp1.cpp @@ -100,6 +100,12 @@ const ControlInfoMap::Map rkisp1Controls{ { &controls::Contrast, ControlInfo(0.0f, 1.993f) }, { &controls::Saturation, ControlInfo(0.0f, 1.993f) }, { &controls::Sharpness, ControlInfo(0.0f, 10.0f, 1.0f) }, + /* libcamera requires a fixed value for minimum frame duration, + * but this depends on the frame size and the rkisp1 device datasheets + * measure this in pixels per second. Neither the datasheets nor the driver + * specify a maximum. The minimum below is for 1920x1920. The maximum + * corresponds to two seconds. */ + { &controls::FrameDurationLimits, ControlInfo(48505, 2000000) }, { &controls::draft::NoiseReductionMode, ControlInfo(controls::draft::NoiseReductionModeValues) }, };