From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4367BC6FD20 for ; Fri, 24 Mar 2023 15:18:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; 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=4QbbT6LKfIWiQRoD1EWZHqDWX+qil8NT4k3WczYXwLU=; b=koRNQ6tw9dxnnF jwHzqp/09dtebA1ZoYrei2eRiMlLyWaHcVoGOjyH8P62yT6gXxVSw/SvD7fNHGOQ0hCHnAIKgJkq4 wGOcM7ButFR5dxsMxBJ7nwRJhG9m5ycdZwGxl7Bs2VeKmChvbU4uwF0wIYoXJ0UThy28yOoqtbFqf zJ+5VvFyjbCePIhFtVVXEcA9vYozubHLfnw5onlAYup6Tyw4GU7ea0kXtlKT+sacCcEguPg1f0nki VGZ0RGqYSDqJxMAYzjQKQWnuUiV+zQriBaTg4ye5rm+0ksbcrOtDZA0bjWAiIB37OgRFBAjGBxj2D KvbueOx6UK8vafxqIEsw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pfj6B-004mLP-32; Fri, 24 Mar 2023 15:12:59 +0000 Received: from relay4-d.mail.gandi.net ([217.70.183.196]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pfj60-004mAO-1T for linux-arm-kernel@lists.infradead.org; Fri, 24 Mar 2023 15:12:50 +0000 Received: (Authenticated sender: paul.kocialkowski@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 19EA7E0015; Fri, 24 Mar 2023 15:12:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1679670765; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8gIn39Y6zA0CFaVJ6us4+7VwM4cTlinJOP/M7fEZG7Y=; b=TX4hxQ9RP7XPd8vlAYXjTa8wCMrPziKlOupK2OrOzG5+o3vFMT+sIk3bH+cgHZGrioCslu cUSVKOFWdsQFwRsIBvf6lZNNVLfIlwljTuINbonSNl8WMSzdwFKhB3uBIsbInMZAyBx5rK BibBAi5OW3OuvgvSV4yo9PqsdTEe3PrwAZG8Y75zRgQT05IUfRj8CFOEy/d+B+aXplhooC zPehihj1vvb9fIIcfkwlSR9fC1Tn1r3/HUawg99RgKEYNV93ZL/B6KdK0pMrgNYEOLLOW9 IFT9bttX58/dwOtb3iZz21JbY+hAvBgFkAaprkVe01g0n2YuotYU/YLywPdyTA== From: Paul Kocialkowski To: linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev Cc: Paul Kocialkowski , Mauro Carvalho Chehab , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Laurent Pinchart , Adam Pigg , Thomas Petazzoni Subject: [PATCH 3/9] media: v4l2: Introduce compressed pixel encoding definition and helper Date: Fri, 24 Mar 2023 16:12:22 +0100 Message-Id: <20230324151228.2778112-4-paul.kocialkowski@bootlin.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230324151228.2778112-1-paul.kocialkowski@bootlin.com> References: <20230324151228.2778112-1-paul.kocialkowski@bootlin.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230324_081248_626282_2D81C161 X-CRM114-Status: UNSURE ( 8.95 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Some pixel formats (such as JPEG) have their data compressed and encoded in a specific way, which is not directly YUV, RGB or Bayer. Add a new definition and helper for compressed pixel encoding to represent this situation. Signed-off-by: Paul Kocialkowski --- include/media/v4l2-common.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h index 1bdaea248089..37554bc10e2a 100644 --- a/include/media/v4l2-common.h +++ b/include/media/v4l2-common.h @@ -465,12 +465,14 @@ int v4l2_s_parm_cap(struct video_device *vdev, * @V4L2_PIXEL_ENC_YUV: Pixel encoding is YUV * @V4L2_PIXEL_ENC_RGB: Pixel encoding is RGB * @V4L2_PIXEL_ENC_BAYER: Pixel encoding is Bayer + * @V4L2_PIXEL_ENC_COMPRESSED: Pixel encoding is compressed */ enum v4l2_pixel_encoding { V4L2_PIXEL_ENC_UNKNOWN = 0, V4L2_PIXEL_ENC_YUV = 1, V4L2_PIXEL_ENC_RGB = 2, V4L2_PIXEL_ENC_BAYER = 3, + V4L2_PIXEL_ENC_COMPRESSED = 4, }; /** @@ -512,6 +514,11 @@ static inline bool v4l2_is_format_bayer(const struct v4l2_format_info *f) return f && f->pixel_enc == V4L2_PIXEL_ENC_BAYER; } +static inline bool v4l2_is_format_compressed(const struct v4l2_format_info *f) +{ + return f && f->pixel_enc == V4L2_PIXEL_ENC_COMPRESSED; +} + const struct v4l2_format_info *v4l2_format_info(u32 format); void v4l2_apply_frmsize_constraints(u32 *width, u32 *height, const struct v4l2_frmsize_stepwise *frmsize); -- 2.39.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel