From patchwork Sun Jan 29 13:58:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 18217 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 6E403BEFBE for ; Sun, 29 Jan 2023 13:58:49 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9E8B7625EA; Sun, 29 Jan 2023 14:58:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1675000728; bh=rJahV7jI5TXKLVPGM5GXBlnFPHw8ZDeN2Wf7VZJU2Qg=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=RbyojZ6okGC2ALr9G00YCVRSJk2vullEaJP1U2bL169FJ4AL/NFyETn/JnEmXdCxo 3RpH8v1rn72aXWaw2fbeQTC5CiM339tQ4Tyxx+VxZKokRK9geO5BmZWEwUtcEKzoST gczrJWVufZ6xMGrSTTCkQyuhMeD60m0BtWSJhPqLchfVy0IZmDWya5GH9uDtX1/v7r tdqIOyA8RVfVpLlrQc7aYeaiofMDqFafXhkJuySBMDReN0PatAYad8JfByQz6hfoMF AJRPKwYOUEnXQ/yFNQa9P4w0MzTivc9VJpM2jx7EhdPz1OmDpbVylAHYNSxg7NtYR4 52QAkqsR05OBA== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2232F600FE for ; Sun, 29 Jan 2023 14:58:47 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="c9Zl54QN"; dkim-atps=neutral Received: from uno.localdomain (mob-5-90-54-203.net.vodafone.it [5.90.54.203]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 42DCB327; Sun, 29 Jan 2023 14:58:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1675000726; bh=rJahV7jI5TXKLVPGM5GXBlnFPHw8ZDeN2Wf7VZJU2Qg=; h=From:To:Cc:Subject:Date:From; b=c9Zl54QN/s0OSxiQkvBI0TUxdW3GEBzK1aflNFvWZMkDu03vuTkADxzov2FcsZdyh GGRfolkHWBiUfkdlC+gXcDdZSDtxehi9PXiC/Aj7mpmqCsxQEyNBFs/dLoNlewYG/w Zh/sLRoLK9Ki6B1rJeJbeZvyXzbry8ywJQIGlQxw= To: libcamera-devel@lists.libcamera.org Date: Sun, 29 Jan 2023 14:58:25 +0100 Message-Id: <20230129135830.27490-1-jacopo.mondi@ideasonboard.com> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 0/5] libcamera: imx8-isi: Remove pixelformat-2-media-bus map 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-Patchwork-Original-From: Jacopo Mondi via libcamera-devel From: Jacopo Mondi Reply-To: Jacopo Mondi Cc: Jacopo Mondi Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The ISI pipeline handler currently associates the output PixelFormat with the media bus code that can produce it. This mapping is however limiting as the ISI can produce any YUV/RGB format from any non-RAW media bus format. Rework the format selection procedures in order to remove the association between pixel formats and mbus codes by introducing 4 new functions. This fixes the problem originally pointed out by Laurent that when used with RAW sensors, the generated CameraConfiguration does not work as it assumes a YUV media bus code is available. Tested with ov5640 which can produce UYVY8, RGB565 and SBGGR8. $ cam -c1 Selected sensor format: 1920x1080-UYVY8_1X16 $ cam -c1 --stream role=raw Selected sensor format: 2592x1944-SBGGR8_1X8 $ cam -c1 --stream pixelformat=RGB565 Selected sensor format: 1920x1080-RGB565_ Tested with imx219 which can only produce SRGGB10 $ cam -c1 Selected sensor format: 3280x2464-SRGGB10_1X10 $ cam -c1 --stream pixelformat=YUV WARN ISI imx8-isi.cpp:278 Cannot find a supported YUV/RGB format $ cam -c1 --stream role=viewfinder Selected sensor format: 3280x2464-SRGGB10_1X10 Also fix the available stream formats list for both YUV and RAW use cases. Jacopo Mondi (5): libcamera: imx8-isi: Break-out RAW format selection libcamera: imx8-isi: Break out YUV format selection libcamera: imx8-isi: Automatically select media bus code libcamera: imx8-isi: Split Bayer/YUV config generation libcamera: imx8-isi: Remove mbusCode from formatsMap_ include/libcamera/internal/camera_sensor.h | 1 + src/libcamera/camera_sensor.cpp | 14 + src/libcamera/pipeline/imx8-isi/imx8-isi.cpp | 612 +++++++++++-------- 3 files changed, 378 insertions(+), 249 deletions(-) --- 2.39.0