From patchwork Wed Dec 4 16:36:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cheng-Hao Yang X-Patchwork-Id: 22168 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 3BE70BDB1C for ; Wed, 4 Dec 2024 16:42:01 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3C0B1660F3; Wed, 4 Dec 2024 17:41:59 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="RQ22hJ8v"; dkim-atps=neutral Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6B8AA660E2 for ; Wed, 4 Dec 2024 17:41:54 +0100 (CET) Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-7252fba4de1so42745b3a.0 for ; Wed, 04 Dec 2024 08:41:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1733330511; x=1733935311; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=37nnvTi9vvdECb0kx0poJ2dB18jSK5vuzdObv0ENTJg=; b=RQ22hJ8vZyl/QIdqKpu9waswyinhyXegJu0MNHysH2YHl7HlnvPlNRU74afFZCoiwm kBKgTH9ba5okxYrWbVGLRlNvV/DST12sJhDJBABwYuJVUIQKqt550ILr4m77fx6guE+3 jgbDsw8VsbWDx1Tu+1ve0dP9yqJVTdciTVNHI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733330511; x=1733935311; h=content-transfer-encoding:mime-version: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=37nnvTi9vvdECb0kx0poJ2dB18jSK5vuzdObv0ENTJg=; b=cC2w037/DjnSFSO9Hw3/B7QNL/2X7c8kMWABJUUX3d6QQB5k9WK3J5zsHyDAY4gSkZ q70GHgsBhu++JuwxpOQat5tNNrqScMDPFrcKjKJ3hHZRLwnmw2Ywn/cPWvK1qWAGjv9v 2OBTIzxeVhTjvVl3J+yLtQyJ7KPRYT9RS7cAoqPFzQYl1fXoDnzwgSEIwa1yn24SLo0i zrrPyu6a/zWHZXT0xzKjwuX2Er0PS3yefZsnJ6AXAHOyiLte/CETkKk2tOb43FoOBTY1 rbqf9q4/cRfLx969oANY6V+W34jJ16FUkkK4WiK5GYGjqdFYJyQ7v9gh0Kf8Af4UMCwH Ce3Q== X-Gm-Message-State: AOJu0YzMaxiiCRwxsgxyRvil5GBpLJ1QuX1EFq62YXE05t0ZWRcYDFCG uoeTrzcX7eNA+lXey+JCaP8x2MNuZLiuhwvXgkF1LGSXWUA8mgg+GgVoVtkPtkJWeHU6sUhr58s = X-Gm-Gg: ASbGncsxf0SeJRqGDuPw/vnGUX4XDtlHkoiBqK8BxrQw7tRfcr4qUt2UjsXfNMCgl7w SEVQUh8ZvJARwnFwEhOph/SpA2fdhnX/YHawQbsBGj8wKKZC9JPAyfq/mH5weGr071rpIPAd1Q8 02lfM+UKKRdZ7aQrofo3J/T0OY+SA1u3W10Sw9gIO5djDh11ENBqCS+Ava3C5Hp6lS2cVP+zfSy LjLA+IJdxzDswnRIfDvmmuQoIInLcYbvQbqO5h0agIj3EcKVqfyndIullJcgcJpvPhLWpeFWzyh pFWnxgHc83GixjLgQQcN4ZUTxA+EkybkTnnn76bUY9aeGAMC9TPW42TJ X-Google-Smtp-Source: AGHT+IH9exai7cVZ1xtRic5GGuqexbN4H4apGhto6REw8K4B0fPJBqZh/pytnN7YTlOz1pYIfd7eQw== X-Received: by 2002:a05:6a00:14d5:b0:71e:60fc:ad11 with SMTP id d2e1a72fcca58-7257fcb04ddmr10464905b3a.16.1733330511625; Wed, 04 Dec 2024 08:41:51 -0800 (PST) Received: from chenghaoyang-low.c.googlers.com.com (112.212.229.35.bc.googleusercontent.com. [35.229.212.112]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-725417725e9sm12551779b3a.80.2024.12.04.08.41.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Dec 2024 08:41:50 -0800 (PST) From: Harvey Yang To: libcamera-devel@lists.libcamera.org Cc: Harvey Yang , Han-Lin Chen Subject: [PATCH v3 6/7] android: notify CAMERA3_MSG_ERROR_REQUEST out of order Date: Wed, 4 Dec 2024 16:36:31 +0000 Message-ID: <20241204164137.3938891-7-chenghaoyang@chromium.org> X-Mailer: git-send-email 2.47.0.338.g60cca15819-goog In-Reply-To: <20241204164137.3938891-1-chenghaoyang@chromium.org> References: <20241204164137.3938891-1-chenghaoyang@chromium.org> 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" When a request hasn't done any processing, CAMERA3_MSG_ERROR_REQUEST and the following process_capture_result don't need to wait for the previous requests' completion. This patch avoids pushing the aborted requests into the request queue. Signed-off-by: Han-Lin Chen Co-developed-by: Harvey Yang Signed-off-by: Harvey Yang Reviewed-by: Jacopo Mondi --- src/android/camera_device.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index dd2c603e0..18e974f56 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -867,6 +867,8 @@ void CameraDevice::abortRequest(Camera3RequestDescriptor *descriptor) const buffer.status = StreamBuffer::Status::Error; descriptor->status_ = Camera3RequestDescriptor::Status::Error; + + sendCaptureResult(descriptor); } bool CameraDevice::isValidRequest(camera3_capture_request_t *camera3Request) const @@ -1136,14 +1138,7 @@ int CameraDevice::processCaptureRequest(camera3_capture_request_t *camera3Reques MutexLocker stateLock(stateMutex_); if (state_ == State::Flushing) { - Camera3RequestDescriptor *rawDescriptor = descriptor.get(); - { - MutexLocker descriptorsLock(descriptorsMutex_); - descriptors_.push(std::move(descriptor)); - } - abortRequest(rawDescriptor); - completeDescriptor(rawDescriptor); - + abortRequest(descriptor.get()); return 0; }