From patchwork Thu Jun 16 20:25:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Jernej_=C5=A0krabec?= X-Patchwork-Id: 12884788 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 E6946C43334 for ; Thu, 16 Jun 2022 20:26:42 +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=w2DYf9doXn3YNxGFwlfungH+32EQWnhild++LAMqSIA=; b=HuWvUPhNVh4NGA /rvnhxidmkSH++YZmgjFqPqIBP37afElKdGB6W04DxDiaw1C1vO0MlWW4iLkuZf3F6uJ1SgPjkelq VXrtZ7yl6hTYGz/tdFLZWDplcN1I0skTBzrBrkAkbxBjMvDcYI6CLF3t6EryZ1YLK0IaQm6FxpC1D TLIE1dq2DrBcSb+IkVv05n3868rE5J5iplqbCqtNqZvczdgXtKCaS29UC6ZbriQLmBSFWU9H+3HGD +vCb2V/UIrC2H3I4ldQ3ZtN7PokmXqew3zFcHIux0gRzNj9nUTESpZDUVqIv10kFz/jRUyzZGFwlm Q/657rhnkGQ/y7btQAUg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1w3d-00463e-Uo; Thu, 16 Jun 2022 20:25:38 +0000 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1w3P-0045ty-OW; Thu, 16 Jun 2022 20:25:25 +0000 Received: by mail-ed1-x535.google.com with SMTP id x5so3695823edi.2; Thu, 16 Jun 2022 13:25:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QE0MYJUwogSBWJFF8vYBtgUrw6+DEPr+dnjgCy1KQbk=; b=SgOn8NY50HceKZAiBZ+Z9ohNnPwWQAY2lGLLGempd1U9lPYRxei39w2s7sS94H78FN yu5nPxvAspIRzGQyYcanK/zlfaynkxRs4jb3HRJNB4508sYgu2JOYeXakx91Pld8swP7 Cpehii+c/RvlobGKSU3Q5VyVYJ78C86hsd1lgnYKDtPKK+/GB6cxtgDPF5d1CssVCP1r jkL8s6caBq+aJNlja2SQuFzggoO+ge6ghHBQMuMa07BH6n0mvXAmwSwZVRU7X1FOkK4C Lsl+DNHqvA2tDfYCl/vV9QcGVDK1ZkOPBRhDZ7TIh0bQEfgl3fjVbHJVgRy3WFm6rin9 Zysw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QE0MYJUwogSBWJFF8vYBtgUrw6+DEPr+dnjgCy1KQbk=; b=hTMIR2CQHWyifZQZaDDud577S0MNJ8kbUumNz3RIhNLNdpabAiNZVnCNDWDf0JOcWx aiqynrS+wxbyF2y3UBH9zaXGbqpBHw1MsUR2KpYK37W6wwxD8ran94MP8dcL+ePJ/qv6 npczJEnvXzWSsoJVfLomGdRyHfxbA6m2riQBmsn/HdASj8qcTTVDktlNqiqGt3fHqQMo xdzvChmuLbRbcP039U0TnUiObfWBSdGtCk0hxwabOs9a6fWR8ObKxfV1DE2GIuRBeNs0 id859xM3E5laXQ9mK4pVdJxu+cPCv1r+/wzqcVpGPBjXKeeHpgWP8ZQkw4J37FTV6kBL 7VFw== X-Gm-Message-State: AJIora8fRRRMihRyq3dkOBGF0l6WWitGqKv/GvIXK2NWig10EpM4MCCF iI+DvwQmzmgw7ZYZgnQQxpg= X-Google-Smtp-Source: AGRyM1v/mW4Dj69VCqINYQ+QCfhRUPkkmgyBgddx/rqzX+PtSvzrLplPksRObJi4l8gMhss94Bft8w== X-Received: by 2002:a05:6402:61a:b0:433:406a:8d25 with SMTP id n26-20020a056402061a00b00433406a8d25mr8689705edv.276.1655411120447; Thu, 16 Jun 2022 13:25:20 -0700 (PDT) Received: from kista.localdomain (213-161-3-76.dynamic.telemach.net. [213.161.3.76]) by smtp.gmail.com with ESMTPSA id 21-20020a170906329500b006fe8a4ec62fsm1186760ejw.4.2022.06.16.13.25.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jun 2022 13:25:20 -0700 (PDT) From: Jernej Skrabec To: ezequiel@vanguardiasur.com.ar, p.zabel@pengutronix.de Cc: mchehab@kernel.org, hverkuil-cisco@xs4all.nl, benjamin.gaignard@collabora.com, nicolas.dufresne@collabora.com, gregkh@linuxfoundation.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, Jernej Skrabec Subject: [PATCH v2 1/7] media: Add P010 tiled format Date: Thu, 16 Jun 2022 22:25:07 +0200 Message-Id: <20220616202513.351039-2-jernej.skrabec@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220616202513.351039-1-jernej.skrabec@gmail.com> References: <20220616202513.351039-1-jernej.skrabec@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220616_132523_835496_6F6B527C X-CRM114-Status: GOOD ( 11.88 ) 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 From: Ezequiel Garcia Add P010 tiled format Signed-off-by: Ezequiel Garcia [rebased and updated pixel format name] Signed-off-by: Jernej Skrabec --- drivers/media/v4l2-core/v4l2-common.c | 1 + drivers/media/v4l2-core/v4l2-ioctl.c | 1 + include/uapi/linux/videodev2.h | 1 + 3 files changed, 3 insertions(+) diff --git a/drivers/media/v4l2-core/v4l2-common.c b/drivers/media/v4l2-core/v4l2-common.c index 1e38ad8906a2..e0fbe6ba4b6c 100644 --- a/drivers/media/v4l2-core/v4l2-common.c +++ b/drivers/media/v4l2-core/v4l2-common.c @@ -278,6 +278,7 @@ const struct v4l2_format_info *v4l2_format_info(u32 format) /* Tiled YUV formats */ { .format = V4L2_PIX_FMT_NV12_4L4, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 2, .bpp = { 1, 2, 0, 0 }, .hdiv = 2, .vdiv = 2 }, + { .format = V4L2_PIX_FMT_P010_4L4, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 2, .bpp = { 2, 4, 0, 0 }, .hdiv = 2, .vdiv = 2 }, /* YUV planar formats, non contiguous variant */ { .format = V4L2_PIX_FMT_YUV420M, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 3, .comp_planes = 3, .bpp = { 1, 1, 1, 0 }, .hdiv = 2, .vdiv = 2 }, diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c index e2526701294e..e24d38c0a178 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c @@ -1310,6 +1310,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt) case V4L2_PIX_FMT_NV12_4L4: descr = "Y/CbCr 4:2:0 (4x4 Linear)"; break; case V4L2_PIX_FMT_NV12_16L16: descr = "Y/CbCr 4:2:0 (16x16 Linear)"; break; case V4L2_PIX_FMT_NV12_32L32: descr = "Y/CbCr 4:2:0 (32x32 Linear)"; break; + case V4L2_PIX_FMT_P010_4L4: descr = "P010 tiled"; break; case V4L2_PIX_FMT_NV12M: descr = "Y/CbCr 4:2:0 (N-C)"; break; case V4L2_PIX_FMT_NV21M: descr = "Y/CrCb 4:2:0 (N-C)"; break; case V4L2_PIX_FMT_NV16M: descr = "Y/CbCr 4:2:2 (N-C)"; break; diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index 5311ac4fde35..32bedeb04152 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -630,6 +630,7 @@ struct v4l2_pix_format { #define V4L2_PIX_FMT_NV12_4L4 v4l2_fourcc('V', 'T', '1', '2') /* 12 Y/CbCr 4:2:0 4x4 tiles */ #define V4L2_PIX_FMT_NV12_16L16 v4l2_fourcc('H', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 16x16 tiles */ #define V4L2_PIX_FMT_NV12_32L32 v4l2_fourcc('S', 'T', '1', '2') /* 12 Y/CbCr 4:2:0 32x32 tiles */ +#define V4L2_PIX_FMT_P010_4L4 v4l2_fourcc('T', '0', '1', '0') /* 12 Y/CbCr 4:2:0 10-bit 4x4 macroblocks */ /* Tiled YUV formats, non contiguous planes */ #define V4L2_PIX_FMT_NV12MT v4l2_fourcc('T', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 64x32 tiles */