From patchwork Thu Nov 9 21:02:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 163588 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp705426vqs; Thu, 9 Nov 2023 13:04:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IES9TsvTy+tVBBH5oM2A4Y0xqZV2d8rar6aXw6PHSSJttV2ghYC1ScyYX0E0JIwB/+ro8LP X-Received: by 2002:a05:6a00:158a:b0:6c3:ab46:1eaa with SMTP id u10-20020a056a00158a00b006c3ab461eaamr6568402pfk.5.1699563847100; Thu, 09 Nov 2023 13:04:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699563847; cv=none; d=google.com; s=arc-20160816; b=itaKAAQZH6EHz7dGbiRJmLipiC3s2JnNu/FoxLk7AWGXFFBSk7t1R2RgAPY9DWk/yr cPJoL7oE6DCNpsKRMRDWL/Z1baJV0LZkjESYbLAkc4K35a8HvlBC2qce6jNng9MUdL+9 bStRyCA6b5TkLrG19AYR8vAnyvdr7M7HzqIJCxcRZnROEeaFG3ABtQxY82Sch8KULujn UMSJd9WDWHk090yuQ5iYJUtCh8q924xinYeelGLdUF3kEp4SOfb1Tt3McDgGqyhrwxoU +mrLu1rj/y2GsYVcBoao2+wPqhW0oAcmUZbIyHoxrfNOvdFUoBbTUK6tXSmH5u8pmhJV aing== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=tj0XaqhoNEBIfOk5d3Le1MgjxknYd7C1TAmgQ5Pe+vQ=; fh=jB4ZJnu48Rd5A9Gw+jJTxc8V04xPsHLMeRevtz00HEY=; b=AWdFv6jWUApFgh+6lDkVJA8IzW1izKzQrdETM4mBvzT6LuPkwDfCcEGdWuWYqpNgcy rlUVL7QYL2/459JBoM1Z75U6PKH933JgdnxaYlh9SoeFQhEJ2WJ+JrjgffYU2ctdvuBP PLhb6xXLUttPu4h/Rbgm6LZ2zSJrD4CfihTmtDYf5hexoXzwsQMx8qX6Q2jzOdbkpVXK mnX5KCP58GzNrPiEfgMJ+RQfLphCn6H3gzTpf6wq40JrDTnuDYRaatDA9JZPiIIBsB2V fHxT9plftQSuwWsyzqLYuk7iFAkAvfoAK1RJvVf6OTFK23fuPgqEa1v67HCkvGaGv3Nb n14A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=gqmL81hA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id eg25-20020a056a00801900b006b618af5cd5si17647448pfb.300.2023.11.09.13.04.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Nov 2023 13:04:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=gqmL81hA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 91D8D839C84A; Thu, 9 Nov 2023 13:04:02 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345286AbjKIVDm (ORCPT + 30 others); Thu, 9 Nov 2023 16:03:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345254AbjKIVDh (ORCPT ); Thu, 9 Nov 2023 16:03:37 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0976C3C0C; Thu, 9 Nov 2023 13:03:35 -0800 (PST) Received: from umang.jain (unknown [103.251.226.64]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 66E056EF; Thu, 9 Nov 2023 22:03:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1699563791; bh=A6r4SQOAK5Or0kMaxq2CUJLyYkisnRMaRenw7zGC+G4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gqmL81hA9pj4WYeVK/fypGJ3kZDrGth0EkIMHYNzJ9y0DK9AENcnDbk6fwgE2ozUD y8ja3lWQ27XXNLgR9zTVPaHDoYK3BTKDogwDUouUTsfzKbdeKCVLkBDInNixmk2ebL FAdyZSJrXwg8PfGQIF/ikmL77hh3peeaPevktzDI= From: Umang Jain To: linux-media@vger.kernel.org, kernel-list@raspberrypi.com, linux-kernel@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-staging@lists.linux.dev Cc: Dave Stevenson , Kieran Bingham , Laurent Pinchart , "Ricardo B . Marliere" , Dan Carpenter , Stefan Wahren , Umang Jain Subject: [PATCH v2 06/15] staging: mmal_vchiq: Add image formats to be used by bcm2835-isp Date: Thu, 9 Nov 2023 16:02:58 -0500 Message-ID: <20231109210309.638594-7-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231109210309.638594-1-umang.jain@ideasonboard.com> References: <20231109210309.638594-1-umang.jain@ideasonboard.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 09 Nov 2023 13:04:02 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782121860382981013 X-GMAIL-MSGID: 1782121860382981013 From: Dave Stevenson The bcm2835-isp supports Bayer, so add in the encodings for them. Also, Add support for monochrome image formats in the various MIPI packings. Signed-off-by: Dave Stevenson Signed-off-by: Umang Jain --- .../vc04_services/vchiq-mmal/mmal-encodings.h | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-encodings.h b/drivers/staging/vc04_services/vchiq-mmal/mmal-encodings.h index e15ae7b24f73..4711877a9711 100644 --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-encodings.h +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-encodings.h @@ -69,6 +69,68 @@ */ #define MMAL_ENCODING_OPAQUE MMAL_FOURCC('O', 'P', 'Q', 'V') +/* Bayer formats + * FourCC values copied from V4L2 where defined. + */ +/* 8 bit per pixel Bayer formats. */ +#define MMAL_ENCODING_BAYER_SBGGR8 MMAL_FOURCC('B', 'A', '8', '1') +#define MMAL_ENCODING_BAYER_SGBRG8 MMAL_FOURCC('G', 'B', 'R', 'G') +#define MMAL_ENCODING_BAYER_SGRBG8 MMAL_FOURCC('G', 'R', 'B', 'G') +#define MMAL_ENCODING_BAYER_SRGGB8 MMAL_FOURCC('R', 'G', 'G', 'B') + +/* 10 bit per pixel packed Bayer formats. */ +#define MMAL_ENCODING_BAYER_SBGGR10P MMAL_FOURCC('p', 'B', 'A', 'A') +#define MMAL_ENCODING_BAYER_SGRBG10P MMAL_FOURCC('p', 'g', 'A', 'A') +#define MMAL_ENCODING_BAYER_SGBRG10P MMAL_FOURCC('p', 'G', 'A', 'A') +#define MMAL_ENCODING_BAYER_SRGGB10P MMAL_FOURCC('p', 'R', 'A', 'A') + +/* 12 bit per pixel packed Bayer formats. */ +#define MMAL_ENCODING_BAYER_SBGGR12P MMAL_FOURCC('p', 'B', '1', '2') +#define MMAL_ENCODING_BAYER_SGRBG12P MMAL_FOURCC('p', 'g', '1', '2') +#define MMAL_ENCODING_BAYER_SGBRG12P MMAL_FOURCC('p', 'G', '1', '2') +#define MMAL_ENCODING_BAYER_SRGGB12P MMAL_FOURCC('p', 'R', '1', '2') + +/* 14 bit per pixel Bayer formats. */ +#define MMAL_ENCODING_BAYER_SBGGR14P MMAL_FOURCC('p', 'B', 'E', 'E') +#define MMAL_ENCODING_BAYER_SGBRG14P MMAL_FOURCC('p', 'G', 'E', 'E') +#define MMAL_ENCODING_BAYER_SGRBG14P MMAL_FOURCC('p', 'g', 'E', 'E') +#define MMAL_ENCODING_BAYER_SRGGB14P MMAL_FOURCC('p', 'R', 'E', 'E') + +/* 16 bit per pixel Bayer formats. */ +#define MMAL_ENCODING_BAYER_SBGGR16 MMAL_FOURCC('B', 'G', '1', '6') +#define MMAL_ENCODING_BAYER_SGBRG16 MMAL_FOURCC('G', 'B', '1', '6') +#define MMAL_ENCODING_BAYER_SGRBG16 MMAL_FOURCC('G', 'R', '1', '6') +#define MMAL_ENCODING_BAYER_SRGGB16 MMAL_FOURCC('R', 'G', '1', '6') + +/* 10 bit per pixel unpacked (16bit) Bayer formats. */ +#define MMAL_ENCODING_BAYER_SBGGR10 MMAL_FOURCC('B', 'G', '1', '0') +#define MMAL_ENCODING_BAYER_SGRBG10 MMAL_FOURCC('B', 'A', '1', '0') +#define MMAL_ENCODING_BAYER_SGBRG10 MMAL_FOURCC('G', 'B', '1', '0') +#define MMAL_ENCODING_BAYER_SRGGB10 MMAL_FOURCC('R', 'G', '1', '0') + +/* 12 bit per pixel unpacked (16bit) Bayer formats */ +#define MMAL_ENCODING_BAYER_SBGGR12 MMAL_FOURCC('B', 'G', '1', '2') +#define MMAL_ENCODING_BAYER_SGRBG12 MMAL_FOURCC('B', 'A', '1', '2') +#define MMAL_ENCODING_BAYER_SGBRG12 MMAL_FOURCC('G', 'B', '1', '2') +#define MMAL_ENCODING_BAYER_SRGGB12 MMAL_FOURCC('R', 'G', '1', '2') + +/* 14 bit per pixel unpacked (16bit) Bayer formats */ +#define MMAL_ENCODING_BAYER_SBGGR14 MMAL_FOURCC('B', 'G', '1', '4') +#define MMAL_ENCODING_BAYER_SGBRG14 MMAL_FOURCC('G', 'B', '1', '4') +#define MMAL_ENCODING_BAYER_SGRBG14 MMAL_FOURCC('G', 'R', '1', '4') +#define MMAL_ENCODING_BAYER_SRGGB14 MMAL_FOURCC('R', 'G', '1', '4') + +/* MIPI packed monochrome images */ +#define MMAL_ENCODING_GREY MMAL_FOURCC('G', 'R', 'E', 'Y') +#define MMAL_ENCODING_Y10P MMAL_FOURCC('Y', '1', '0', 'P') +#define MMAL_ENCODING_Y12P MMAL_FOURCC('Y', '1', '2', 'P') +#define MMAL_ENCODING_Y14P MMAL_FOURCC('Y', '1', '4', 'P') +#define MMAL_ENCODING_Y16 MMAL_FOURCC('Y', '1', '6', ' ') +/* Unpacked monochrome formats (16bit per sample, but only N LSBs used) */ +#define MMAL_ENCODING_Y10 MMAL_FOURCC('Y', '1', '0', ' ') +#define MMAL_ENCODING_Y12 MMAL_FOURCC('Y', '1', '2', ' ') +#define MMAL_ENCODING_Y14 MMAL_FOURCC('Y', '1', '4', ' ') + /** An EGL image handle */ #define MMAL_ENCODING_EGL_IMAGE MMAL_FOURCC('E', 'G', 'L', 'I')