From patchwork Thu Oct 27 05:55:08 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: 17691 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 54BE6BD16B for ; Thu, 27 Oct 2022 05:55:26 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 17C2662F77; Thu, 27 Oct 2022 07:55:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1666850126; bh=0m67fw+SrZFwBQwhEdqesJpIEX8+9fgjsIjtQ+CklB8=; 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=cldq/4RRpjuaz+HXPYs2RBCw/WahprLHcj2YTXl5TUOIHgadaT8fZwCYYUp0/TWpS IWpW8FzTh7lXWJyDkDkHsYfkphgBZ80S37w5HtZO7oks/j0MX80QlNOViygmSEG/ZI pmhoYrWmmjeYW3MXpDIAL52LQi/3suL6y82AzWhsIKqH8zVKiyM4l24UyA5dE9CxMj UIiN3f9KMi7dvgsDoGA+Ct6nm47n+mY9LUg+u3boK2hG1u/8/0AeCze9EGlU0rHCHE d6WBKHMZrOXzkLLL1Z0c1qL9nJHhOx9BYma6umnpi7M33IjVYtbLngMl1Aruv2xH1P sZaS7xHuMvOXw== Received: from mail-oa1-x35.google.com (mail-oa1-x35.google.com [IPv6:2001:4860:4864:20::35]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8474B61F4A for ; Thu, 27 Oct 2022 07:55:24 +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="Zsr/77U8"; dkim-atps=neutral Received: by mail-oa1-x35.google.com with SMTP id 586e51a60fabf-13be3ef361dso641338fac.12 for ; Wed, 26 Oct 2022 22:55:24 -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=bddDm6KAUYg6vwJZsSW+qIhD1mJ4mNuTn6ftM1wZAnE=; b=Zsr/77U8td6XZQayEw+fSgKBCczLt6rVh3LAh2RmqMNs5GWTRqyh1kg9hVpeSQdH+s QSQAfMua0Y7cjBG3I8tsIj11SaOT9jFzjwqdN6WS49THez5+a2EqGVK6V/HmHL9aIUR+ UMOHnDI18xXMv1yTqvhy3SFXmd5WGscKIiR54+mg1tZnupwtOAWkt+aT+JhWciseFzAC pt1khF7a9An/KHnlCIGQjfyLsHvidGG8XMwGsJagJs+7wsMrYx9Zg4YEKpCQ09i4eACy Nf+cFH21yno4nUYy664x5cB/JiKj3vX2yQkyGCsHXzuVmKykBD7nqiQ0SWcVn0gJgUai 2NbQ== 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=bddDm6KAUYg6vwJZsSW+qIhD1mJ4mNuTn6ftM1wZAnE=; b=LWCfl5cbXptJcSKkjOk42iM1zFhW83WV8qEfgcrdSaKscUkNjAJWwPW6eiMe8usJb4 sGHlss8EldBqoqT6n7lPJC4tc4F6bSJriBrXtZAwhmtMnjHzdZPyQrgZiQfVEs3wA6Lh 9cJUlD8gM2ycslehJC46DzoEZrQaTFJGK0umNj7NJH9FkOFfbHHJ7c20s0Cyx4jOA4K2 egkITbGqpLqy2hBoUALzp4DcDZX3EwJ1//rAd7sVcr853SNl9SKRXJ9a2MWVx3cpw3UN gf/dqPHABpBQJZ0TcsnUk86lyLD4DRmvj9uKsfG2Huf4ubeKx4P6ImRwB9I1tgFNkdbc d0Yw== X-Gm-Message-State: ACrzQf2pmwPJhlK4WK+wAjXwV/IGXwtmpDinSgkB8Sw7vhjc2+B3dwSd ZAgZNH4UhKlTI+hRa6DVY0uzLdS7nPLcPkLy X-Google-Smtp-Source: AMsMyM7k07vksO2e7mYGv8fSaBKXNXqWjpt/20NIfgD9hmjOijfzlIWSwBSyyEPyD9sma0Ab5Hjh9A== X-Received: by 2002:a05:6870:51f:b0:130:fee6:8295 with SMTP id j31-20020a056870051f00b00130fee68295mr4476868oao.49.1666850123771; Wed, 26 Oct 2022 22:55:23 -0700 (PDT) Received: from nroth-pc.attlocal.net ([2600:1700:20:20c0:6406:fc7a:e46d:1666]) by smtp.gmail.com with ESMTPSA id 9-20020a9d0c09000000b00661a05691fasm140021otr.79.2022.10.26.22.55.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Oct 2022 22:55:23 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Thu, 27 Oct 2022 00:55:08 -0500 Message-Id: <20221027055515.321791-4-nicholas@rothemail.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221027055515.321791-1-nicholas@rothemail.net> References: <20221027055515.321791-1-nicholas@rothemail.net> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 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 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp index ba3c547e..c536852c 100644 --- a/src/ipa/rkisp1/rkisp1.cpp +++ b/src/ipa/rkisp1/rkisp1.cpp @@ -100,6 +100,13 @@ 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::MaxLatency, ControlInfo(0) }, { &controls::draft::NoiseReductionMode, ControlInfo(controls::draft::NoiseReductionModeValues) }, };