summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorUmang Jain <umang.jain@ideasonboard.com>2023-04-24 00:15:49 +0530
committerUmang Jain <umang.jain@ideasonboard.com>2023-04-26 12:07:03 +0530
commite191001939c1a6c3dc22ad195d61f062a0ddc5f5 (patch)
treec5f3606fa271613ce2215ba3e9bde91a28ae4a44 /src
parent683c6da83f078d09fc020d2b48a4abe471853b2b (diff)
apps: cam: kms_sink: Drop unique_ptr<> from DRM::AtomicRequest
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 <umang.jain@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src')
-rw-r--r--src/apps/cam/kms_sink.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/apps/cam/kms_sink.cpp b/src/apps/cam/kms_sink.cpp
index 353209cd..6991c3fa 100644
--- a/src/apps/cam/kms_sink.cpp
+++ b/src/apps/cam/kms_sink.cpp
@@ -303,24 +303,22 @@ int KMSSink::configurePipeline(const libcamera::PixelFormat &format)
int KMSSink::start()
{
- std::unique_ptr<DRM::AtomicRequest> request;
-
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<DRM::AtomicRequest>(&dev_);
+ DRM::AtomicRequest request(&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: "