From patchwork Tue Oct 24 13:27:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 19182 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 0C94DBDCBD for ; Tue, 24 Oct 2023 13:27:55 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7A78C61DE6; Tue, 24 Oct 2023 15:27:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1698154074; bh=i7rapnZXn/F9XgZF8422vRfU9YWl0vheGPqPU6cqQfs=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=wtUx75COK77mDw2FeGslWzq34m/oVz4WV/0fIARKuFXha0cm/YIMSX7Hwa7OiRm9e iKFeMshBPnA3B7KxVPNeQ7Y4mq/5L1IIjD3aLzezBgPmesk8vhkLfQB3/Rop199zZC LOB5Q0D646PPBwSGUJowlpkyNWCSaTK4GNgGM1J2zt7Mxj0wltlxG8X5iW+Nk9v6G9 /MDiIHsJAn+bMsOyKcqP6MsvYKtOh0HxWauWEUcFBlsiFHPDiPdbV0xc0nciVeW1Zi uoTQS0aVqgpblU9kvl4F3W/W3lW3nS0Qd6MF4g90V1ug14CXsqxC7UWlwv4eG0rfmQ dNorD5MkrDDjw== Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id F23E361DCF for ; Tue, 24 Oct 2023 15:27:52 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="WHWqL2rP"; dkim-atps=neutral Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-507c5249d55so6412578e87.3 for ; Tue, 24 Oct 2023 06:27:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1698154072; x=1698758872; 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=M/Y3LdFn388e8Rg85AqnadwaQmDaJa0rFxYo8xLYyXQ=; b=WHWqL2rP53erdpjE3fwC8HvZMOpfNNHOx7+UDv3jLBieQ7UjId7RTI+zYKlaV/+3A9 h/fsakZcM0DgKYJZIYcQOX8XhTaaFO0V7F0C9KEY4SRdztiRzDubt6VXmrINPqFl8+Q5 pk8T8VHmjCIaVRPJspFSG8Gx/29YLvIhDLeRLnMexIu+Da1J45FM3cXQd9/WQ1rF04rF rMpitsdKJYy93Q4Eo97+t3RQDz55IXRqgiN0p6DjMdzC/v9TKyGlJRDR7Gqh74WrG/7B MXQtU+YPtvguabXVE7P6GDA4e6vxb1j+AYGlBtWgZ4CIkIh/VLACTxb+5xenn7gCbfie vN7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698154072; x=1698758872; 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=M/Y3LdFn388e8Rg85AqnadwaQmDaJa0rFxYo8xLYyXQ=; b=l6Aj/BWZV+M6M8xHrWUl2tW/tiqM8bS9rIeTe7YVZPoglBqp0qmZa+u+r7NE7weag9 F3P/yNiAccfEcaX9D+JX71TRTFLEjjE4dnCFwxQz/3OthlDTNb4PDZb6koJ1t9WoJZ/v GdHlKg235SL4NZswJf79iK4a4pxRfWP6BN3d3L/9++A+j9qbz54JA9NOSLAW10V6w7N/ r0ARZrZvMSmiPU3INlw/S/TX5qiBYpGkKqh4+9Sizd2D8aEEejmiEN2rSMbH7XhCTqYv zO08wPzE+x54PMRqwp6n0niR2zEZypREmXEJo3kRmdK/IC7Bq7+ek0QVkYWER6QsdfKE SsSg== X-Gm-Message-State: AOJu0YySrfEGCpWOZE/dkh+CZaxk/UUwWu6clcYrs7DpkLvHmM32537a 7VoIpG7aMoc+RtsxyLStyYlI3ptlWMqMjxVo8wJrBg== X-Google-Smtp-Source: AGHT+IFmqTQ8RRhLPDReFVPEyNjlidhtjZT2QsnWQrKFHUrGcR5dANFBH28m1nbO/+qelfqJUgbHXA== X-Received: by 2002:a05:6512:70b:b0:507:a1b3:2d47 with SMTP id b11-20020a056512070b00b00507a1b32d47mr8245656lfs.17.1698154071711; Tue, 24 Oct 2023 06:27:51 -0700 (PDT) Received: from localhost.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id o7-20020a056000010700b0032da6f17ffdsm9925987wrx.38.2023.10.24.06.27.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 06:27:51 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Tue, 24 Oct 2023 14:27:46 +0100 Message-Id: <20231024132746.31689-1-naush@raspberrypi.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] pipeline: rpi: Add some useful logging messages 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" Add a bunch of logging messages that have come in handy debugging various issues with the pipeline handler code. Signed-off-by: Naushir Patuck Reviewed-by: Kieran Bingham Reviewed-by: Jacopo Mondi --- src/libcamera/pipeline/rpi/common/pipeline_base.cpp | 11 ++++++++++- src/libcamera/pipeline/rpi/vc4/vc4.cpp | 3 +++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp index 9f788c9d1bc2..8e1cbbe67a52 100644 --- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp +++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp @@ -731,7 +731,8 @@ int PipelineHandlerBase::queueRequestDevice(Camera *camera, Request *request) if (!data->isRunning()) return -EINVAL; - LOG(RPI, Debug) << "queueRequestDevice: New request."; + LOG(RPI, Debug) << "queueRequestDevice: New request sequence: " + << request->sequence(); /* Push all buffers supplied in the Request to the respective streams. */ for (auto stream : data->streams_) { @@ -1436,6 +1437,8 @@ void CameraData::handleStreamBuffer(FrameBuffer *buffer, RPi::Stream *stream) * Tag the buffer as completed, returning it to the * application. */ + LOG(RPI, Debug) << "Completing request buffer for stream " + << stream->name(); pipe()->completeBuffer(request, buffer); } else { /* @@ -1444,6 +1447,8 @@ void CameraData::handleStreamBuffer(FrameBuffer *buffer, RPi::Stream *stream) * unconditionally for internal streams), or there is no pending * request, so we can recycle it. */ + LOG(RPI, Debug) << "Returning buffer to stream " + << stream->name(); stream->returnBuffer(buffer); } } @@ -1487,6 +1492,9 @@ void CameraData::checkRequestCompleted() if (state_ != State::IpaComplete) return; + LOG(RPI, Debug) << "Completing request sequence: " + << request->sequence(); + pipe()->completeRequest(request); requestQueue_.pop(); requestCompleted = true; @@ -1499,6 +1507,7 @@ void CameraData::checkRequestCompleted() if (state_ == State::IpaComplete && ((ispOutputCount_ == ispOutputTotal_ && dropFrameCount_) || requestCompleted)) { + LOG(RPI, Debug) << "Going into Idle state"; state_ = State::Idle; if (dropFrameCount_) { dropFrameCount_--; diff --git a/src/libcamera/pipeline/rpi/vc4/vc4.cpp b/src/libcamera/pipeline/rpi/vc4/vc4.cpp index 616e0bc95021..816de14e5b22 100644 --- a/src/libcamera/pipeline/rpi/vc4/vc4.cpp +++ b/src/libcamera/pipeline/rpi/vc4/vc4.cpp @@ -283,6 +283,9 @@ int PipelineHandlerVc4::prepareBuffers(Camera *camera) numBuffers = 1; } + LOG(RPI, Debug) << "Preparing " << numBuffers + << " buffers for stream " << stream->name(); + ret = stream->prepareBuffers(numBuffers); if (ret < 0) return ret;