From patchwork Sun Apr 23 20:39:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 18545 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 EAED1C32A4 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 2AA83627DD; Sun, 23 Apr 2023 22:39:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1682282386; bh=oXhEjAjmutFNoV/O0ifo+PR6BmGIsSy9LuVJVWCofBI=; 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=QidL5/qel9LzgQdhVCcaEM4NRntPWlA0HwqlpuzLo6h8/kMGYh9U4fFqSPaTHrBVL ulHJS29hSmG22L4OYDWKNqvniroQiYe2cFr0orZh5hUrwoC5r5F6CtdPR8I3SSuZyd zyzSuhS+xSNabFoi4lk58YMlK/p2Ak8mz9YGZYxlEec/8Jt7xnCJiMkM78M8N0ZKnV XrMzNuKY+xKdqxJBB4pKgC14l/T2JWFTGP1JTUVSEIWfNGAYsI+QGnYY1yJM/SSAFz U+RvADOR2l4vB4wA13C+Ul/vjeSXOB/hM+R6V2JHuLX9eOWCUOqxQDE0sNvipwHQK2 Qplw4vXaez5Hg== 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 2380D627D1 for ; Sun, 23 Apr 2023 22:39:42 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="WIsfyDTC"; 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 91669C7E; Sun, 23 Apr 2023 22:39:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1682282372; bh=oXhEjAjmutFNoV/O0ifo+PR6BmGIsSy9LuVJVWCofBI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WIsfyDTCHYnxM0aUixT5BesmdoWeyOW8+NcGPRYFLN6oeikQAYYQiSmcqcdSzhWXh E9z86x+EYwiT5caczsj9l2CHAQmdJdUuq1KDNG2KCGb8MZc3HhHRyBC+OENqoJ10bL 41JogvI8Clowqk91EMHs1KFPD0YHPoaCXaX0iKXw= To: libcamera-devel@lists.libcamera.org Date: Mon, 24 Apr 2023 02:09:30 +0530 Message-Id: <20230423203931.108022-3-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 2/3] apps: cam: kms_sink: Drop unique_ptr<> from DRM::AtomicRequest 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" There is no need to wrap DRM::AtomicRequest in std::unique_ptr<> in KMSSink::start(). Remove it so that the syntax becomes similar to what we have in KMSSink::stop(). No functional changes intended. Signed-off-by: Umang Jain Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- src/apps/cam/kms_sink.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/apps/cam/kms_sink.cpp b/src/apps/cam/kms_sink.cpp index a508977d..2aefec06 100644 --- a/src/apps/cam/kms_sink.cpp +++ b/src/apps/cam/kms_sink.cpp @@ -302,24 +302,22 @@ int KMSSink::configurePipeline(const libcamera::PixelFormat &format) int KMSSink::start() { - std::unique_ptr request; + DRM::AtomicRequest request(&dev_); int ret = FrameSink::start(); if (ret < 0) return ret; /* Disable all CRTCs and planes to start from a known valid state. */ - request = std::make_unique(&dev_); - for (const DRM::Crtc &crtc : dev_.crtcs()) - request->addProperty(&crtc, "ACTIVE", 0); + request.addProperty(&crtc, "ACTIVE", 0); for (const DRM::Plane &plane : dev_.planes()) { - request->addProperty(&plane, "CRTC_ID", 0); - request->addProperty(&plane, "FB_ID", 0); + request.addProperty(&plane, "CRTC_ID", 0); + request.addProperty(&plane, "FB_ID", 0); } - ret = request->commit(DRM::AtomicRequest::FlagAllowModeset); + ret = request.commit(DRM::AtomicRequest::FlagAllowModeset); if (ret < 0) { std::cerr << "Failed to disable CRTCs and planes: "