From patchwork Fri Oct 18 09:27:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milan Zamazal X-Patchwork-Id: 21673 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 D9555C32FE for ; Fri, 18 Oct 2024 09:27:31 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 86DE56538F; Fri, 18 Oct 2024 11:27:31 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="L3k2frxB"; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8509165379 for ; Fri, 18 Oct 2024 11:27:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1729243649; 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=2dfiij+PIcjXvMfe4UFWDUW7/jH9oS9FuumKiRty9v8=; b=L3k2frxBG9xFi77gG0mzvwdJ1bnGDiUASsedhUpCiRJmcwiv7UGPeq8DeiuMPScWArJcEU iA8GFdvctFe9z293gWO/YA9DMWkPgUQlnhIoDeggVK8LdoAUDRxxNDux5R/l61HwH74L0l s19kq4Nvo+cFDBMPNvgcPWMznr48ZBs= Received: from mx-prod-mc-05.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-655-gr4IkFdnOaS5yc9cZwtDJg-1; Fri, 18 Oct 2024 05:27:24 -0400 X-MC-Unique: gr4IkFdnOaS5yc9cZwtDJg-1 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 58852195609F; Fri, 18 Oct 2024 09:27:23 +0000 (UTC) Received: from nuthatch.redhat.com (unknown [10.45.225.61]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 5A56030001A5; Fri, 18 Oct 2024 09:27:20 +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 v4 0/3] Clean up pending requests on stop in software ISP Date: Fri, 18 Oct 2024 11:27:13 +0200 Message-ID: <20241018092716.295624-1-mzamazal@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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 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 | 32 +++++++++++-------- src/libcamera/pipeline_handler.cpp | 23 +++++++++---- 3 files changed, 36 insertions(+), 20 deletions(-)