From patchwork Wed Sep 30 20:08:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 9884 X-Patchwork-Delegate: niklas.soderlund@ragnatech.se 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 3BC88C3B5C for ; Wed, 30 Sep 2020 20:08:44 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4445A6239C; Wed, 30 Sep 2020 22:08:42 +0200 (CEST) Received: from bin-mail-out-06.binero.net (bin-mail-out-06.binero.net [195.74.38.229]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7F65660BCD for ; Wed, 30 Sep 2020 22:08:40 +0200 (CEST) X-Halon-ID: b7e6cd68-0358-11eb-b295-0050569116f7 Authorized-sender: niklas.soderlund@fsdn.se Received: from bismarck.berto.se (p54ac52a8.dip0.t-ipconnect.de [84.172.82.168]) by bin-vsp-out-03.atm.binero.net (Halon) with ESMTPA id b7e6cd68-0358-11eb-b295-0050569116f7; Wed, 30 Sep 2020 22:08:34 +0200 (CEST) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Wed, 30 Sep 2020 22:08:27 +0200 Message-Id: <20200930200831.2066751-3-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200930200831.2066751-1-niklas.soderlund@ragnatech.se> References: <20200930200831.2066751-1-niklas.soderlund@ragnatech.se> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 2/6] libcamera: pipeline: rkisp1: Fix media bus propagation for NV{12, 21} 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The upstream driver have changed how the link formats are validated when starting to stream [1]. This revealed that libcamera did not adjust the media bus format from the link between {main,self} resizer source pad and the capture video device as expected by the driver. The media bus code YUYV8_2X8 was hardcoded to MEDIA_BUS_FMT_YUYV8_2X8 for all pixel formats while it must be adjusted to YUYV8_1_5X8 for NV12 and NV21, fix this. 1. 6803a9e0e1e43e9e ("media: staging: rkisp1: cap: simplify link validation by comparing media bus code") Signed-off-by: Niklas Söderlund Reviewed-by: Paul Elder --- src/libcamera/pipeline/rkisp1/rkisp1_path.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp index 410e9f5d94607f44..63c643f22affc74a 100644 --- a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp +++ b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp @@ -7,6 +7,8 @@ #include "rkisp1_path.h" +#include + #include #include @@ -125,6 +127,16 @@ int RkISP1Path::configure(const StreamConfiguration &config, << "Configuring " << name_ << " resizer output pad with " << ispFormat.toString(); + switch (config.pixelFormat) { + case formats::NV12: + case formats::NV21: + ispFormat.mbus_code = MEDIA_BUS_FMT_YUYV8_1_5X8; + break; + default: + ispFormat.mbus_code = MEDIA_BUS_FMT_YUYV8_2X8; + break; + } + ret = resizer_->setFormat(1, &ispFormat); if (ret < 0) return ret;