From patchwork Tue Jul 30 19:10:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helen Koike X-Patchwork-Id: 1719 Return-Path: Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 3F91860E3A for ; Tue, 30 Jul 2019 21:11:11 +0200 (CEST) Received: from floko.floko.floko (unknown [IPv6:2804:431:c7f1:ce2f:ec1:e6e6:2e9f:e76e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: koike) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 62D0928B8A4; Tue, 30 Jul 2019 20:11:09 +0100 (BST) From: Helen Koike To: libcamera-devel@lists.libcamera.org Cc: laurent.pinchart@ideasonboard.com, kernel@collabora.com, Helen Koike Date: Tue, 30 Jul 2019 16:10:07 -0300 Message-Id: <8ad5a0874203dacfd488fe6827e3feab14dc959c.1564513804.git.helen.koike@collabora.com> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2] libcamera: pipeline: RKISP1 configure isp output pad X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jul 2019 19:11:11 -0000 ISP output pad should be set to YUYV8_2X8 for non-bayer output format. Bayer formats are not listed in RkISP1CameraConfiguration::validate(), only non-bayer are listed, so we can set YUYV8_2X8 directly. This need to be changed if we add support for bayer output with libcamera. Signed-off-by: Helen Koike Reviewed-by: Laurent Pinchart --- Hi, I'm re-sending this patch standalone as Laurent suggested. Thanks Helen --- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp index efa9604..bc7cb3f 100644 --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp @@ -286,6 +286,8 @@ int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c) if (ret < 0) return ret; + LOG(RkISP1, Debug) << "Configuring ISP input pad with " << format.toString(); + ret = dphy_->getFormat(1, &format); if (ret < 0) return ret; @@ -294,6 +296,18 @@ int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c) if (ret < 0) return ret; + LOG(RkISP1, Debug) << "ISP input pad configured with " << format.toString(); + + /* YUYV8_2X8 is required in ISP pad 1 for non-bayer output */ + format.mbus_code = MEDIA_BUS_FMT_YUYV8_2X8; + LOG(RkISP1, Debug) << "Configuring ISP output pad with " << format.toString(); + + ret = isp_->setFormat(2, &format); + if (ret < 0) + return ret; + + LOG(RkISP1, Debug) << "ISP output pad configured with " << format.toString(); + V4L2DeviceFormat outputFormat = {}; outputFormat.fourcc = cfg.pixelFormat; outputFormat.size = cfg.size;