From patchwork Tue Apr 21 20:39:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Konovalov X-Patchwork-Id: 3504 Return-Path: Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9008860406 for ; Tue, 21 Apr 2020 22:40:11 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="bPazIDSR"; dkim-atps=neutral Received: by mail-lj1-x244.google.com with SMTP id f18so9414778lja.13 for ; Tue, 21 Apr 2020 13:40:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=QXqWfRYvJW7gxIid/dbDOHWOPkPO4wQML/c57bb8l2A=; b=bPazIDSRrk5WSylNK+IHuWkhO2u4dZu1fSjbhMf6wiGPIBbz5EbQ7x3p0oWlQvAHKa 6VhKO7n/CTsHR70txG3fRoMbyOC3Tb4avgf4LHJRWLSe4EKlvhjRwPy9/mp8GkudxxDM /Wp/xP2cgiKpG29994pS+LzCOk/r1C7pjUykHTrzXFTHuyhITprX23+SUW4GaUfrUGXB 5tDfwlgH0wIsM2L9F/krU1wZ9dOZwZk6jz3ZUF3CrfZjvwix8wIDMMMiNmqLDikb9myn VjQmc65pVzAzH6spjTgH6uO8AlvFg3ryB2zfjE92jbNclw0v/OC94DA1l5j1kXqp/mvX 4/gA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=QXqWfRYvJW7gxIid/dbDOHWOPkPO4wQML/c57bb8l2A=; b=mzg9PQGpPW/kexxLiz6DCa3na42rLGFTRu1ALA1PKmcTh+Sc+KAEPmkzr8OQAvyOrl ILllQHodYCe1DlThmNe1oUL8eMsxCyI+C+BpkZcx3Uka1Av8p1zqmUxwd18/n7C+X+bP 4hSTryxQOQKpFfmok3uE9uWPVsScQescJ/RDizxpVYV3PgjvO4G631P83xFHSPvuxXuY VhhPtbxBjCebIFjcVhGC/2scUk9Oodhdpjnu+C99Gu1jNbs4QuLMjE+XVsbPiTayX1sq xoSdTQ/KDGBGiSRsfwnUZxcdm0hpS9G3o9Do5gwYbZDdkKM3wdaaPyuUkbs6suAkYxEv RSSw== X-Gm-Message-State: AGi0PuYa2thYHoMtnWVN8mk7yxnf0VcdfTrR+37ANHpsa0iVU6dfPzCw aZhVPNgoaGBeFpNzcp0aeEHgqEoDixA= X-Google-Smtp-Source: APiQypJIcFm5e4xcpRW6YSEqYyebwByOZdfD2rarNnJMQ2Mb5MkO3jaJpUznrVJGvhvMSMx//vp8+Q== X-Received: by 2002:a2e:9bc4:: with SMTP id w4mr14936096ljj.178.1587501610403; Tue, 21 Apr 2020 13:40:10 -0700 (PDT) Received: from localhost.localdomain (37-144-159-139.broadband.corbina.ru. [37.144.159.139]) by smtp.googlemail.com with ESMTPSA id g6sm476176ljj.78.2020.04.21.13.40.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Apr 2020 13:40:09 -0700 (PDT) From: Andrey Konovalov To: libcamera-devel@lists.libcamera.org Date: Tue, 21 Apr 2020 23:39:52 +0300 Message-Id: <20200421203954.15585-1-andrey.konovalov@linaro.org> X-Mailer: git-send-email 2.17.1 Subject: [libcamera-devel] [PATCH 0/2] Simple pipeline: skip broken pipeline configurations 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-List-Received-Date: Tue, 21 Apr 2020 20:40:11 -0000 When enumerating the possible pipeline configurations, SimpleCameraData::init() doesn't check if the sink pad uses the same format as the source pad of the same link does. This can result in broken pipeline configurations added to the formats_ map, and if such a configuration is selected the issue reveals late as a failure to start streaming. The first patch adds the check into SimpleCameraData::setupFormats() - now it returns -EINVAL if a link is misconfigured. The second patch prevents the enumeration of the possible pipeline configurations from being aborted on the first broken configuration and proceeds with the next media bus code instead. Andrey Konovalov (2): libcamera: pipeline: simple: make sure the formats at the link's pads match libcamera: pipeline: simple: try next mbus code if setupFormats() fails src/libcamera/pipeline/simple/simple.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-)