Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1263408rwl; Fri, 24 Mar 2023 08:16:14 -0700 (PDT) X-Google-Smtp-Source: AKy350ZuyZCCZT+wXIID1MfuYFr2TeWiBPS1YIaBD5iz2VnRscMmeZ+YaZqWYWYNU1KxAv79q/AI X-Received: by 2002:a17:907:10c4:b0:90b:53f6:fd8b with SMTP id rv4-20020a17090710c400b0090b53f6fd8bmr3129139ejb.31.1679670974344; Fri, 24 Mar 2023 08:16:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679670974; cv=none; d=google.com; s=arc-20160816; b=yyIsniZWbmjFdwjYY05NDbyDyB2cTUm2VKPfu/63TQWANpIq8BOsINllf6Rjj4EP70 wWb+qRd/sZKZbpDXT0kNhU/W+bjbvQGDxy5D1GWNI/8q0+Cp5bkHvIEE6f9GdC94XWT5 Qbz/wtBWq1Mz84Gimn9aWOVpkGJMY7HkdNmKol2KTIl7Opd9dtbofrZbrAs2ZUWaNNz4 S77W8DpAlxPBlNtyoGiFbQ8drys3RO4symVDqveq4Zu9fnrP8nP/LK8upx0ckJf8NSRa utVYbV004qf+xAjvBXNIQEaXM4DX8MzK+/Ym75uOKhIL+R3mC4hwM1l/xEV7Fepwjg/k u7fA== 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=8gIn39Y6zA0CFaVJ6us4+7VwM4cTlinJOP/M7fEZG7Y=; b=jeg3hMluDVDz0nW8HQufzGWT5VHgvYsNXlduj39zY8nv24Esl0gxszAZQIrnn/rX2m 5ecPg9cOJTLxloJfdYDtsJ5uzQogtK0ATRCVd29xBMXjVTCLzsxaX3jr5lZQ9NF6t0Ao ns9gZJ7PcpWwgKDTCAKsy8tExbp0wlbAPpYtVsvDXHImeCLfVyw/kp5tYQcP9M+X74eX evB00OatBz/ctaugNM1NJ+zlFRCrPJlYD7qo96oN3+KU45mNU4YArQ3BI6J5165n7XuA yrSAef1ClTO9+JhCFNZ+FEp0JzByLopQap7ZMMS8vsEuydNog55D4c1XA6czdFMvYrH4 h91g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=TX4hxQ9R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ww3-20020a170907084300b00933f85809b4si16920409ejb.490.2023.03.24.08.15.36; Fri, 24 Mar 2023 08:16:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=TX4hxQ9R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232457AbjCXPNP (ORCPT + 99 others); Fri, 24 Mar 2023 11:13:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232067AbjCXPND (ORCPT ); Fri, 24 Mar 2023 11:13:03 -0400 Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 914B41D92D; Fri, 24 Mar 2023 08:12:46 -0700 (PDT) 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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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