From patchwork Mon Oct 21 13:37:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milan Zamazal X-Patchwork-Id: 21716 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 743F1C32A3 for ; Mon, 21 Oct 2024 13:37:37 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 633B36538B; Mon, 21 Oct 2024 15:37:36 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="QhTyjeop"; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id DBE616538A for ; Mon, 21 Oct 2024 15:37:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1729517852; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UD1nB4f2Q47S+akUYNBPOQ46JTEevNFYMnmwcdv7HhA=; b=QhTyjeopPAF0WZ7qYAa0rpqgsGRI8P16Mp+anjF1tdlXt8JyzAuziK35QCuHmHGnOuAFbm i0cxYZF9SN7RgScQ36Y8AC2M+RWzcNtBLSR6VQZEayNz/C9wCSwAnyOnZND2ofF14W99LF 1JIb6MCutCxwdHemQjAvNycUn3jtW1g= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-496-aj41HeQKN-2j-UbbwEqKMA-1; Mon, 21 Oct 2024 09:37:29 -0400 X-MC-Unique: aj41HeQKN-2j-UbbwEqKMA-1 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B53C91944DFD; Mon, 21 Oct 2024 13:37:24 +0000 (UTC) Received: from nuthatch.redhat.com (unknown [10.45.225.218]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6591B19560AA; Mon, 21 Oct 2024 13:37:22 +0000 (UTC) From: Milan Zamazal To: libcamera-devel@lists.libcamera.org Cc: Milan Zamazal , robert.mader@posteo.de, kieran.bingham@ideasonboard.com, laurent.pinchart@ideasonboard.com Subject: [PATCH v5 0/3] Clean up pending requests on stop in software ISP Date: Mon, 21 Oct 2024 15:37:15 +0200 Message-ID: <20241021133718.894374-1-mzamazal@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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" Fix for the bug #234 where software ISP may not clean up some pending buffers in stopDevice. Changes in v5: - Use a struct instead of std::pair in conversionQueue_. Changes in v4: - Request explicitly tracked as suggested by Laurent. Changes in v3: - Split to two patches according to different code areas affected. - Added a check for the request status to prevent canceling a request multiple times. - Calling conversionBuffers_.clear() after the cleanup, to be safer. Changes in v2: - The request is additionally canceled. - New helper method PipelineHandler::cancelRequest() introduced. Milan Zamazal (3): libcamera: pipeline_handler: Provide cancelRequest libcamera: simple: Track requests in conversionQueue_ libcamera: software_isp: Clean up pending requests on stop include/libcamera/internal/pipeline_handler.h | 1 + src/libcamera/pipeline/simple/simple.cpp | 36 ++++++++++++------- src/libcamera/pipeline_handler.cpp | 23 ++++++++---- 3 files changed, 40 insertions(+), 20 deletions(-) Tested-by: Stanislaw Gruszka