From patchwork Sun Apr 23 20:39:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 18544 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 12F65C3275 for ; Sun, 23 Apr 2023 20:39:46 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id F3098627D8; Sun, 23 Apr 2023 22:39:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1682282385; bh=O99b22zRRxhn1HqjojfhgRQklC4ldF/F1VRhN1jLGVY=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=GiArD9sils8BM5OODMnTKeYzp8sA1NlXOhd0dn17FNHkYxPDVK3NvLJE9oHn5/5oN 8s86QeYERTVBQCr6Hhl3tH7Et9Gz0+f2sXdwPmE/9c/Qh1mXm6i1z3fHSFS7FtJQ2/ eda8PY0QO84yrG8PmoDW/cewpXc3jlBf1es/rKbO5c0MjAJlEySpgBmo883kUToOM5 3h0pcDzslkbXShbk0B37wtftDCXvzWwXWbot4iL1LKxjUmsAX46FRPf9gfrakpF08C vm2d/Y6lW45hbirpBsdE7Z0UmNnDgyGBPmCPXDM7R6AoH7QaOWnxQ2AYpQYANoCeyt RUuBLltTrOjIQ== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id AFA85627CF for ; Sun, 23 Apr 2023 22:39:40 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="HaQoJHt7"; dkim-atps=neutral Received: from umang.jainideasonboard.com (unknown [IPv6:2401:4900:1f3f:df01:2ad:735a:b54c:741d]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 59C199B9; Sun, 23 Apr 2023 22:39:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1682282371; bh=O99b22zRRxhn1HqjojfhgRQklC4ldF/F1VRhN1jLGVY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HaQoJHt7lScIk2DPO8gUDh8npaXd1EG40OK4wddpwdqYTHLdXPgdzwJaiEXyVR85F 4iu4l9i8iq4onyceOe/0YoAYcEL/CNSO4NKMC4rhV6z03gK+DQxIv4kcK489NmZFUP s2qN9u2n30voEablfJ+DJNdY6ArEtXW65gVgXpSU= To: libcamera-devel@lists.libcamera.org Date: Mon, 24 Apr 2023 02:09:29 +0530 Message-Id: <20230423203931.108022-2-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230423203931.108022-1-umang.jain@ideasonboard.com> References: <20230423203931.108022-1-umang.jain@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 1/3] apps: cam: kms_sink: Do not process requests after stop() 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: Umang Jain via libcamera-devel From: Umang Jain Reply-To: Umang Jain Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" KMSSink might process completed page flip requests from DRM after stop() has been called. This is not right hence connect the Device::requestCompleted signal on start() and disconnect it on stop(). Signed-off-by: Umang Jain --- src/apps/cam/kms_sink.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/apps/cam/kms_sink.cpp b/src/apps/cam/kms_sink.cpp index 353209cd..a508977d 100644 --- a/src/apps/cam/kms_sink.cpp +++ b/src/apps/cam/kms_sink.cpp @@ -63,7 +63,6 @@ KMSSink::KMSSink(const std::string &connectorName) return; } - dev_.requestComplete.connect(this, &KMSSink::requestComplete); } void KMSSink::mapBuffer(libcamera::FrameBuffer *buffer) @@ -328,11 +327,15 @@ int KMSSink::start() return ret; } + dev_.requestComplete.connect(this, &KMSSink::requestComplete); + return 0; } int KMSSink::stop() { + dev_.requestComplete.disconnect(); + /* Display pipeline. */ DRM::AtomicRequest request(&dev_);