From patchwork Thu Aug 14 07:28:16 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 24101 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 ABA28BDCC1 for ; Thu, 14 Aug 2025 07:28:24 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 82AD569251; Thu, 14 Aug 2025 09:28:23 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="bMqb2cXz"; dkim-atps=neutral Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id CC75361436 for ; Thu, 14 Aug 2025 09:28:21 +0200 (CEST) Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-45a1b04f8b5so2893425e9.1 for ; Thu, 14 Aug 2025 00:28:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1755156501; x=1755761301; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ItssY86DDWmFeFbp1iF9VNbn4frD85qVGMlXukdCnfE=; b=bMqb2cXzYb9Zp8LkJ2LnqxhcOpUHUX6Hzb34DLWcSnnmYr8AfizXd6CnmiCWAQb5cP S+4NtSfvAbmRWIRhSOSxn0OrM7aPQAYXxlQt/p/NTFeGydjD1KQci0tEPLAdFmbboVSi H652Dh0q/SIK4jmN8AJD01QYjaLxrs6qV03tnAzc54K73rzvv7eqK7173rRrydPvb8aI 8FZ2IyR1Q5DKzGgavmE7xcmTrSvzCfIQUIUTw1+6rY491kb2URz+MtghIZ8T9+3fkh+l ObYqBNSm0GsmptnMwGoVSjFJhsy1GVbANwKXLYcnGm1wc1KwtdljGJlMOfeUXb+rpq9b iLYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755156501; x=1755761301; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ItssY86DDWmFeFbp1iF9VNbn4frD85qVGMlXukdCnfE=; b=naMTkzXJDr7QIYMiYWT2scMEBWpHu/QuMO3hG11u/GETVNWMjGhVs9IVHJU8rICFtQ G+6bd2DZgtzBzyuPi28ezR1R4KNaqhfERrbnAbT7ZJWK5k7WrfOThPaiqFocKYC6k7lA G1CaX8wpVzIRf6/Q5TankSVbCvWtzNpmGX+/r3DkOKV+Q/tp5kPg38+bdEuNuNri/xki J8XdFfZD3LP/X/BwrAh//Cuxc+5mkEs4ah2BE2mkwLSq95UrhviDmW7ZymwzcHvVcSUd BIeqexZXUJ4jpwqU8Q2GzO/SjClSrcwEci+spuYoNw3bQIJJq6R79Me4Eqx3vzv+2Tlw /4cA== X-Gm-Message-State: AOJu0YzyHikmtotMsPgw0QEU/ed712xUwtTHGx7mwDfZ099oOHz2N21G 5dFDv1bCkFtGTjN439QdILc+f+UD6HQK6yeMTs6RfTRD1x+JLw7NYRHxB81LEksMhee3vn/vrFJ Kurbn67g= X-Gm-Gg: ASbGncuspeZMQJM9Kb9OQefsjH3UuQDP9dK/wBPubPSEN4F6F7e9zstbUHl2VEpG56a TzJIfaStmRzDjL37FYiwOKtJY6BDPN7w6DBtYtDsHb1Bqn0CXUk19NguQjQIX++arM97Ho3SanY 6nK+HBJoUxUehtUG9y2Bot4sxAA+GY+uf09B0P8TsLM019ileeFOaWuUD+7qcc7so05GTQ2PKvN 9MsEdFFQWhB+k21EskLhrnSLc/Z7w3sooN9fMViY39KHn1bsDfdpV9iQxoGBF+Evfz0VEhTpSH/ NfxOrcMF2/Rah7w+XAS4cLveBdontoW2qMz0XJRkBlv0Q2nwpUmzVgfZF6vHXUw9sU017Slu2EL 1PpHdiH3yZvlddkNpXFoH8zjeXO/2LB+/M9WxpA/wCLOXDzK8V+++xHTx0Czncuc2 X-Google-Smtp-Source: AGHT+IEDFHLOKyDbloxdS/dg87iSLyNzX1O/sqefxRLCYjMpfNkSYtxEusiVS+CPyoGAwyislmgJvg== X-Received: by 2002:a05:600c:3509:b0:456:19b2:6aa8 with SMTP id 5b1f17b1804b1-45a1b6499e9mr11352585e9.19.1755156500748; Thu, 14 Aug 2025 00:28:20 -0700 (PDT) Received: from raspberrypi.pitowers.org ([2a00:1098:3142:1f:ffc9:aff6:7f7f:893b]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c469319sm48978451f8f.54.2025.08.14.00.28.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Aug 2025 00:28:19 -0700 (PDT) From: David Plowman To: libcamera-devel@lists.libcamera.org Cc: David Plowman Subject: [PATCH] ipa: rpi: sync: Convert wallclock from nanoseconds to microseconds Date: Thu, 14 Aug 2025 08:28:16 +0100 Message-Id: <20250814072816.35592-1-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.39.5 MIME-Version: 1.0 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" The wallclock timestamp has been changed to nanosecond units, and all the calculations here assume it's in microseconds, so add the necessary conversion. Fixes: 29a88d85b730 ("libcamera: controls: Use nanoseconds units for FrameWallClock") Signed-off-by: David Plowman --- src/ipa/rpi/controller/rpi/sync.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ipa/rpi/controller/rpi/sync.cpp b/src/ipa/rpi/controller/rpi/sync.cpp index 39bf5de7..5f9c3c22 100644 --- a/src/ipa/rpi/controller/rpi/sync.cpp +++ b/src/ipa/rpi/controller/rpi/sync.cpp @@ -163,8 +163,8 @@ void Sync::process([[maybe_unused]] StatisticsPtr &stats, Metadata *imageMetadat imageMetadata->get("sync.params", local); - /* The wallclock has already been de-jittered for us. */ - uint64_t wallClockFrameTimestamp = local.wallClock; + /* The wallclock has already been de-jittered for us. Convert from ns into us. */ + uint64_t wallClockFrameTimestamp = local.wallClock / 1000; /* * This is the headline frame duration in microseconds as programmed into the sensor. Strictly,