From patchwork Tue Apr 27 12:07:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marco Felsch X-Patchwork-Id: 12226617 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 13B1EC43460 for ; Tue, 27 Apr 2021 12:10:21 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BBCAF610FA for ; Tue, 27 Apr 2021 12:10:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BBCAF610FA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=yHCeX4ORkp0QvXdF2hSX/RJyWA7IE6HcLYxqQLUgtqs=; b=ZuKVPoUG+JlWcDEsQNqbMl9ZX PXlCnrmZWZjwSIwC0IsZhUpQNr217cWLnOjnf/fYG1AZhVcd+o+RaJPzUZpzDB7i4GGbQO8QImQRj rHCwU/14+hna5nL8P9fqrhEig3i3wJZ9dDMOc4eiwxxQ6wjQhVon/zh+7k2TAeh3yJLxxpneLgoPS qvBGsxy2MzRQidJwSo4vsM78ohHFPZ5mW/oUKQf9H9qkzN9SOweonZOc+6+CMAhmdO2x+fzEggdo9 AsZIH9FCUe2zBozMM3mQzncMELcpzPKzm4rDwvkPgg9RBfFDg4z7dk8oPkV1LV0cko6/q3EKip4Gy gCLIYCwUQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lbMW0-001aHO-KR; Tue, 27 Apr 2021 12:08:32 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lbMVB-001a6c-7C for linux-arm-kernel@desiato.infradead.org; Tue, 27 Apr 2021 12:07:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=nmq/ytTPRHqz0x03nld/8E/ZmOvyh+LHypdlu3+oi/0=; b=un23On4IqFOtBGGhHVz4EFKsga wIVhg91LrQXjqwQh34XOW1sHsB3BzLemmXvaStmvcM5OREYmQHVSLZF82RgqpQbMQL0FywR+WKqVQ gUhimcYHdcsg9WnI+aC48/oWJN1cy4yRN+pGdgbLu7LyAMRe0oyRZRUBjVskqE1hUpg5PG4fvAInn L4TuPk+QDsKtqG6A/NWwmjbFMmEGlayXZJ9HYBLec29CKRtv604ni/LAJqWMhupKujqONdto5ynY9 h1MKsxuI6ls//QCj4F0lsVMVJi0DlIa4gHL6xzkJYPSoo/kP/5oVr82T0mMG63hG4IXssJqGJIhA2 q+LReLUg==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lbMV8-00GiC2-KB for linux-arm-kernel@lists.infradead.org; Tue, 27 Apr 2021 12:07:40 +0000 Received: from dude02.hi.pengutronix.de ([2001:67c:670:100:1d::28]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lbMUm-0006DK-0F; Tue, 27 Apr 2021 14:07:16 +0200 Received: from mfe by dude02.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1lbMUl-0005ux-Ci; Tue, 27 Apr 2021 14:07:15 +0200 From: Marco Felsch To: p.zabel@pengutronix.de, mchehab@kernel.org, slongerbeam@gmail.com, hverkuil-cisco@xs4all.nl, laurent.pinchart@ideasonboard.com, sakari.ailus@linux.intel.com Cc: linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 5/6] gpu: ipu-v3: add custom SGRGB_IGIG_GBGR_IGIG format support Date: Tue, 27 Apr 2021 14:07:00 +0200 Message-Id: <20210427120701.21809-6-m.felsch@pengutronix.de> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210427120701.21809-1-m.felsch@pengutronix.de> References: <20210427120701.21809-1-m.felsch@pengutronix.de> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::28 X-SA-Exim-Mail-From: mfe@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210427_050738_689619_CC7FE884 X-CRM114-Status: UNSURE ( 9.49 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add custom OnSemi RGB-IR pixel formats to the ipu library functions. This format is used by the OnSemi AR0237IR camera sensor [1]. [1] https://www.framos.com/media/pdf/96/ac/8f/AR0237CS-D-PDF-framos.pdf Signed-off-by: Marco Felsch Reviewed-by: Philipp Zabel --- drivers/gpu/ipu-v3/ipu-cpmem.c | 2 ++ drivers/gpu/ipu-v3/ipu-csi.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/drivers/gpu/ipu-v3/ipu-cpmem.c b/drivers/gpu/ipu-v3/ipu-cpmem.c index a1c85d1521f5..c579aafb60ba 100644 --- a/drivers/gpu/ipu-v3/ipu-cpmem.c +++ b/drivers/gpu/ipu-v3/ipu-cpmem.c @@ -861,6 +861,7 @@ int ipu_cpmem_set_image(struct ipuv3_channel *ch, struct ipu_image *image) case V4L2_PIX_FMT_SGBRG8: case V4L2_PIX_FMT_SGRBG8: case V4L2_PIX_FMT_SRGGB8: + case V4L2_PIX_FMT_SGRGB_IGIG_GBGR_IGIG8: case V4L2_PIX_FMT_GREY: offset = image->rect.left + image->rect.top * pix->bytesperline; break; @@ -868,6 +869,7 @@ int ipu_cpmem_set_image(struct ipuv3_channel *ch, struct ipu_image *image) case V4L2_PIX_FMT_SGBRG16: case V4L2_PIX_FMT_SGRBG16: case V4L2_PIX_FMT_SRGGB16: + case V4L2_PIX_FMT_SGRGB_IGIG_GBGR_IGIG16: case V4L2_PIX_FMT_Y16: offset = image->rect.left * 2 + image->rect.top * pix->bytesperline; diff --git a/drivers/gpu/ipu-v3/ipu-csi.c b/drivers/gpu/ipu-v3/ipu-csi.c index 8ae301eef643..cf7763f50fdf 100644 --- a/drivers/gpu/ipu-v3/ipu-csi.c +++ b/drivers/gpu/ipu-v3/ipu-csi.c @@ -268,6 +268,7 @@ static int mbus_code_to_bus_cfg(struct ipu_csi_bus_config *cfg, u32 mbus_code, case MEDIA_BUS_FMT_SGBRG8_1X8: case MEDIA_BUS_FMT_SGRBG8_1X8: case MEDIA_BUS_FMT_SRGGB8_1X8: + case MEDIA_BUS_FMT_SGRGB_IGIG_GBGR_IGIG8_1X8: case MEDIA_BUS_FMT_Y8_1X8: cfg->data_fmt = CSI_SENS_CONF_DATA_FMT_BAYER; cfg->mipi_dt = MIPI_DT_RAW8; @@ -298,6 +299,7 @@ static int mbus_code_to_bus_cfg(struct ipu_csi_bus_config *cfg, u32 mbus_code, case MEDIA_BUS_FMT_SGBRG12_1X12: case MEDIA_BUS_FMT_SGRBG12_1X12: case MEDIA_BUS_FMT_SRGGB12_1X12: + case MEDIA_BUS_FMT_SGRGB_IGIG_GBGR_IGIG12_1X12: case MEDIA_BUS_FMT_Y12_1X12: cfg->data_fmt = CSI_SENS_CONF_DATA_FMT_BAYER; cfg->mipi_dt = MIPI_DT_RAW12;