From patchwork Tue Apr 21 20:39:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Konovalov X-Patchwork-Id: 3506 Return-Path: Received: from mail-lf1-x142.google.com (mail-lf1-x142.google.com [IPv6:2a00:1450:4864:20::142]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id BFAB462E67 for ; Tue, 21 Apr 2020 22:40:15 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="WgZKmtnS"; dkim-atps=neutral Received: by mail-lf1-x142.google.com with SMTP id x23so12232885lfq.1 for ; Tue, 21 Apr 2020 13:40:15 -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:in-reply-to:references; bh=Km8odjCrSkpyc4WjaccZ2TZziaQHbv4cKBm5v4L6khc=; b=WgZKmtnSQcz72xytlB4WAVjzocijojULiEnS0b0fnxkzMvsIEn5WtEfonCrufxzVgm 888icIIVPszySHZclPL/DOZcWi/tqydYF7uKpchGmSESWZLsoZexSa5/praIEoWpA/GX zI2QGoncBjCkr5nWSUL/zOWmpkgY21VyLlYg7g8ckR6CC0k+dCKYiKQ5zzb9NMKLSNGF pgyzT8Ml/pbyuUSw7Es8QZcYHF0KdwssklW6NXlec1G/Hl/8IMvBqCT0jzJ+sIo/x0oK 6vQ1Z649dpTKrG9E9SDdaSlMAMzCGdYKW4LHC0x/qk104manN2o2k5wkVTgEI9JusyZA sNuA== 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:in-reply-to :references; bh=Km8odjCrSkpyc4WjaccZ2TZziaQHbv4cKBm5v4L6khc=; b=m/MMoxf4iUzlKcicFpLILkRVwAjjPya0B5nKyWviM4x0F5Pnj5md/kVGCbKNXHMRlo uWOk4mCRCir9VWQw1IcL0Ay+B7vYQ8Hm8uMm9y0MSSr6tzY8wfHxAu1bVI7nYxqp98CY +oo2FA1ci9EBPqunOsNHfts0cbOsTs9DcmM3Frxom8ZS6UvZlRxO8EG2Lm/cxWE0OqIO kQcKZRt3RAJZaEOU3kVIYB0DPsiwENOhAf0ObE2bpARcsNd7ysJSgjF5eCpM8KwCwS2D knQywezHbsSu+kIBwHrahRyiFYoSh0yiXlSGtBXAPjggCyoAaduvWD2Xbf60kRu1kb/+ 9oiQ== X-Gm-Message-State: AGi0PuaE2SQXJ89yeDDYhgFRr2f9TIS89SKyw2r5eg5dTQDF8SHDodWq mJYf89mI4vGfn8sC/O0BgPgiROGp6XI= X-Google-Smtp-Source: APiQypKZBEI3mKPkRYIeZo3j22Dg/myA3KUVUVMKApHORjnLdJvRKWEIVZyGrJAE3ca20hVtyeZe0Q== X-Received: by 2002:a19:f614:: with SMTP id x20mr14806309lfe.84.1587501614791; Tue, 21 Apr 2020 13:40:14 -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.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Apr 2020 13:40:14 -0700 (PDT) From: Andrey Konovalov To: libcamera-devel@lists.libcamera.org Date: Tue, 21 Apr 2020 23:39:54 +0300 Message-Id: <20200421203954.15585-3-andrey.konovalov@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200421203954.15585-1-andrey.konovalov@linaro.org> References: <20200421203954.15585-1-andrey.konovalov@linaro.org> Subject: [libcamera-devel] [PATCH 2/2] libcamera: pipeline: simple: try next mbus code if setupFormats() fails 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:16 -0000 Now SimpleCameraData::setupFormats() can fail if the camera sensor supports media bus code which some entities down the pipeline don't. When this happens continue with the next media bus code instead of aborting the enumeration of the possible pipeline configurations. Signed-off-by: Andrey Konovalov Reviewed-by: Laurent Pinchart --- src/libcamera/pipeline/simple/simple.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp index 8212bd9..1a31e18 100644 --- a/src/libcamera/pipeline/simple/simple.cpp +++ b/src/libcamera/pipeline/simple/simple.cpp @@ -265,10 +265,11 @@ int SimpleCameraData::init() ret = setupFormats(&format, V4L2Subdevice::TryFormat); if (ret < 0) { - LOG(SimplePipeline, Error) + LOG(SimplePipeline, Warning) << "Failed to setup pipeline for media bus code " << utils::hex(code, 4); - return ret; + /* Try next mbus_code supported by the sensor */ + continue; } std::map> videoFormats =