From patchwork Wed Nov 6 20:17:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milan Zamazal X-Patchwork-Id: 21822 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 DC67CBDB13 for ; Wed, 6 Nov 2024 20:17:36 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 1B15765456; Wed, 6 Nov 2024 21:17:36 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="gBiuAjkG"; 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 5FE9965431 for ; Wed, 6 Nov 2024 21:17:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1730924252; 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=a/8UQ5+T3MCEFwE3lsVhJf9kBAb9BwLYtFPxesFOwuQ=; b=gBiuAjkGrcd+OORIUhYxpNDeCserC2K+Z0zIShleKBMhveG2jSRjvUe+U6Uk8kQhPPAKtD J9mVvk1LSjBayGU/ypj1f5DqUQBVAGf/5yDk+90vLQ8ZbSJWlygSEmfgRq2ukbLF4ZIcbv ng5bYp61Z1g7+M4EuzH5E49pm0usRiQ= Received: from mx-prod-mc-04.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-680-EmH_9JPLNUebNW-26pP59A-1; Wed, 06 Nov 2024 15:17:29 -0500 X-MC-Unique: EmH_9JPLNUebNW-26pP59A-1 X-Mimecast-MFC-AGG-ID: EmH_9JPLNUebNW-26pP59A Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (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-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 197141955F69; Wed, 6 Nov 2024 20:17:28 +0000 (UTC) Received: from nuthatch.redhat.com (unknown [10.45.224.4]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6D21D1956088; Wed, 6 Nov 2024 20:17:25 +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, hdegoede@redhat.com Subject: [PATCH v6 0/3] Clean up pending requests on stop in software ISP Date: Wed, 6 Nov 2024 21:17:18 +0100 Message-ID: <20241106201721.1624461-1-mzamazal@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: NJBwzXQCBZaNdV2v1yGE9edO8If7wx2Ty5Zzc5VH9VI_1730924248 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 v6: - Fix the ordering of function declarations and implementations. - Minor code restructuring as suggested by Laurent. - A comment wording improved. - A C++20 construct avoided. 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(-)