{"id":15325,"url":"https://patchwork.libcamera.org/api/1.1/patches/15325/?format=json","web_url":"https://patchwork.libcamera.org/patch/15325/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20220204104635.21063-1-ecurtin@redhat.com>","date":"2022-02-04T10:46:35","name":"[libcamera-devel,v2] Once we have found a suitable pipeline to select, return","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"f09a0a19d5995b1fe9d5ba25f021b47ee5d34341","submitter":{"id":101,"url":"https://patchwork.libcamera.org/api/1.1/people/101/?format=json","name":"Eric Curtin","email":"ecurtin@redhat.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/15325/mbox/","series":[{"id":2914,"url":"https://patchwork.libcamera.org/api/1.1/series/2914/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2914","date":"2022-02-04T10:46:35","name":"[libcamera-devel,v2] Once we have found a suitable pipeline to select, return","version":2,"mbox":"https://patchwork.libcamera.org/series/2914/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/15325/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/15325/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id EC2A0BDCBF\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  4 Feb 2022 10:47:29 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 21394609F6;\n\tFri,  4 Feb 2022 11:47:29 +0100 (CET)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.129.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9541C609B5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  4 Feb 2022 11:47:27 +0100 (CET)","from mail-wm1-f72.google.com (mail-wm1-f72.google.com\n\t[209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n\tus-mta-441-N7iG7x71MPqjBCYIS2kRxA-1; Fri, 04 Feb 2022 05:47:25 -0500","by mail-wm1-f72.google.com with SMTP id\n\to3-20020a1c4d03000000b003539520b248so2222601wmh.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 04 Feb 2022 02:47:24 -0800 (PST)","from p1.Home ([2001:8a0:6724:4500:1e3a:8e9c:379e:f6ba])\n\tby smtp.gmail.com with ESMTPSA id\n\tn8sm10678656wmq.42.2022.02.04.02.47.22\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 04 Feb 2022 02:47:23 -0800 (PST)"],"Authentication-Results":["lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"dq0qShnK\"; dkim-atps=neutral","relay.mimecast.com;\n\tauth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ecurtin@redhat.com"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1643971646;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tcontent-transfer-encoding:content-transfer-encoding;\n\tbh=uc94Euv4wk8nRDSVEEprjNykxpD6FL0LwmTxxj3k63A=;\n\tb=dq0qShnKgYzjXT39RqZqL4W9aVJqg15t3QMw1tdfxvV9oU8C256tQ+9qymtmkjKE0mDSrK\n\tNYoL4seOoNYWx8XjGldtxnGIRBJz20A1IHDCwxqouL9tOG4NOjpLsxrblg0YRDW9DrQazj\n\tPSoZH6xx3b7QIroFYM10vD9q6n4/vME=","X-MC-Unique":"N7iG7x71MPqjBCYIS2kRxA-1","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=uc94Euv4wk8nRDSVEEprjNykxpD6FL0LwmTxxj3k63A=;\n\tb=WBC6UoYkYs2u4r/5UWGn31Uy1Nffm+tAdXg84vJFmG7te1h0hUHB0iwxxlZu3HM5fG\n\thcCgpJrtOAuAJ/EuMfhb7ehqHmKd/LHbGyU1g7GUn/KDTW32AAtiW0sYGLftl825JSqv\n\tpR7InBeESuX+eSL/j1TMSSVStad3xZL2E6bdn5ctrKHLMoYdoe9S7EtllZ0G/MAt4Chh\n\tcA4TUnoBNChSgjF97VXghJQ8EPl22qKlaE6+3uAhUM2S7yvrL1/VFUzkN49EKzXnBGET\n\tfc3zJJ6pPSStkWOvplhDX3onMIX/xBLa9HzqhDYJoLKW13s1RkZ05nY/kUMztk8AO8tW\n\tmYeg==","X-Gm-Message-State":"AOAM532BNlWAI+ZtlxtvCTmAWGsDfWaqcmHrnvV7864V9pWQNv+UWkbq\n\tero0h/Mm325+WIRO98JNOnc1A+i6CxmnKPc5kxsjum125zF8e8E2Ov2WKZHHN7OCYMojyssMoxa\n\tKVVKHlD5kEcQKBtsHWaHa2fqbA7qnCfhLYK2VND2wxC8kRmdzrNpT0+jvnCd3jQFaGRtDj+tIGn\n\tGgV4Ux2zUW","X-Received":["by 2002:a05:6000:16c2:: with SMTP id\n\th2mr1904794wrf.642.1643971643720; \n\tFri, 04 Feb 2022 02:47:23 -0800 (PST)","by 2002:a05:6000:16c2:: with SMTP id\n\th2mr1904780wrf.642.1643971643514; \n\tFri, 04 Feb 2022 02:47:23 -0800 (PST)"],"X-Google-Smtp-Source":"ABdhPJzozmSdMBYCq1Kxcz3YfGgoLNMLve3DGK8wSSCrG124wB+6NxatAPzog7v73SuWS23JyBw+cg==","From":"Eric Curtin <ecurtin@redhat.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Fri,  4 Feb 2022 10:46:35 +0000","Message-Id":"<20220204104635.21063-1-ecurtin@redhat.com>","X-Mailer":"git-send-email 2.34.1","MIME-Version":"1.0","X-Mimecast-Spam-Score":"0","X-Mimecast-Originator":"redhat.com","Content-Transfer-Encoding":"8bit","Content-Type":"text/plain; charset=\"US-ASCII\"","Subject":"[libcamera-devel] [PATCH v2] Once we have found a suitable pipeline\n\tto select, return","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"The break only breaks out of the innermost loop which is not the most\noptimal. It also breaks cam on my machines.\n\nFixes: 1de0f90dd432 (\"cam: kms_sink: Print display pipelineconfiguration\")\nSigned-off-by: Eric Curtin <ecurtin@redhat.com>\n---\n\nChanges in v2:\n- Change function name to selectPipeline\n- Return int rather than pointer\n- Formatting\n- Mention in commit message that it fixes a bug on my machine also\n\n src/cam/kms_sink.cpp | 18 ++++++++++++------\n src/cam/kms_sink.h   |  1 +\n 2 files changed, 13 insertions(+), 6 deletions(-)","diff":"diff --git a/src/cam/kms_sink.cpp b/src/cam/kms_sink.cpp\nindex d30fba78..973cd370 100644\n--- a/src/cam/kms_sink.cpp\n+++ b/src/cam/kms_sink.cpp\n@@ -136,7 +136,7 @@ int KMSSink::configure(const libcamera::CameraConfiguration &config)\n \treturn 0;\n }\n \n-int KMSSink::configurePipeline(const libcamera::PixelFormat &format)\n+int KMSSink::selectPipeline(const libcamera::PixelFormat &format)\n {\n \t/*\n \t * If the requested format has an alpha channel, also consider the X\n@@ -174,25 +174,31 @@ int KMSSink::configurePipeline(const libcamera::PixelFormat &format)\n \t\t\t\t\tcrtc_ = crtc;\n \t\t\t\t\tplane_ = plane;\n \t\t\t\t\tformat_ = format;\n-\t\t\t\t\tbreak;\n+\t\t\t\t\treturn 0;\n \t\t\t\t}\n \n \t\t\t\tif (plane->supportsFormat(xFormat)) {\n \t\t\t\t\tcrtc_ = crtc;\n \t\t\t\t\tplane_ = plane;\n \t\t\t\t\tformat_ = xFormat;\n-\t\t\t\t\tbreak;\n+\t\t\t\t\treturn 0;\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t}\n \n-\tif (!crtc_) {\n+\treturn -EPIPE;\n+}\n+\n+int KMSSink::configurePipeline(const libcamera::PixelFormat &format)\n+{\n+\tconst int ret = selectPipeline(format);\n+\tif (ret) {\n \t\tstd::cerr\n \t\t\t<< \"Unable to find display pipeline for format \"\n \t\t\t<< format.toString() << std::endl;\n \n-\t\treturn -EPIPE;\n+\t\treturn ret;\n \t}\n \n \tstd::cout\n@@ -200,7 +206,7 @@ int KMSSink::configurePipeline(const libcamera::PixelFormat &format)\n \t\t<< \", connector \" << connector_->name()\n \t\t<< \" (\" << connector_->id() << \")\" << std::endl;\n \n-\treturn 0;\n+\treturn ret;\n }\n \n int KMSSink::start()\ndiff --git a/src/cam/kms_sink.h b/src/cam/kms_sink.h\nindex 1e4290ad..4a0a872c 100644\n--- a/src/cam/kms_sink.h\n+++ b/src/cam/kms_sink.h\n@@ -47,6 +47,7 @@ private:\n \t\tlibcamera::Request *camRequest_;\n \t};\n \n+\tint selectPipeline(const libcamera::PixelFormat &format);\n \tint configurePipeline(const libcamera::PixelFormat &format);\n \tvoid requestComplete(DRM::AtomicRequest *request);\n \n","prefixes":["libcamera-devel","v2"]}