Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp4604195ybg; Mon, 8 Jun 2020 12:01:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/TtJnEuwqCsEO+xcZbPzec1YK130JjFz8DqZDEdQzAzUBajOqJPKnVxudSSqtdztOmBtd X-Received: by 2002:a05:6402:1a48:: with SMTP id bf8mr23766085edb.133.1591642918506; Mon, 08 Jun 2020 12:01:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591642918; cv=none; d=google.com; s=arc-20160816; b=FYu55mPbL4+Bf60HhClTAtMidykSYxBomYzBoTQx+LOduGonyIQHD4e9BOr1sDgYDg 5xWbf3lBs2rTJi5DCGqBkVU2zwSjB6jftuWLR10vWNM7QcYDg7VuCea+UjbeuKgzh6nq PBm1tg9IL7M7XN4tO9hFcGIINfRVCeyApd3gtRhFpON+KBjxyahA/PXlIaJcTnTb6CI6 WanclKRKWCBRwEJN1RFSCwYLqCdrb5wDh9HkSej6KwzD+EFuBnQmC8Vs+nmzumVBcvH4 SFmQy2x3FBBpQN3bCGfOW8kkwbnMsnKguYv9PoGA/Mk5kpzE5Jdx5EY03hJVYBtur5qs LFRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=1LNXy0gulshDF6Am2ORMrlABkF4RBeFdpjJ6l6ghlxc=; b=cLQuX15tR6BuM23CIXyDuBImiQYqlYk5WKM/12Ll2i0B23fjWHfX3rQ8dYPnCjLYWq fF6Jafbo5Sy6nv1NdApgBA1tPX4aamJr1IAuQ89LyCnDK5kz9Qwp9I5/DZRUkyX6grii Iaz5X+joPrdopPC1Xw6W1hqzYdMQi2071yWs1eJG0YK385nVe5FTtYfKj56GMu5VA88M sXagLl75JZ4UD0+bGh5/0kiHEtQwzTIwKcvyDcVHEvgouI0PcgrDczhhy+0PIhubphd5 BllbZEknLauU1SkvAOq7JHdQBfI5R2L0E57PsUGw0DcxsRf6nby7OvnhH00F3U3SX58T hwcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ndufresne-ca.20150623.gappssmtp.com header.s=20150623 header.b="XKzY/dMo"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t9si8962840ejd.172.2020.06.08.12.01.33; Mon, 08 Jun 2020 12:01:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ndufresne-ca.20150623.gappssmtp.com header.s=20150623 header.b="XKzY/dMo"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726405AbgFHS7g (ORCPT + 99 others); Mon, 8 Jun 2020 14:59:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726197AbgFHS7f (ORCPT ); Mon, 8 Jun 2020 14:59:35 -0400 Received: from mail-qt1-x843.google.com (mail-qt1-x843.google.com [IPv6:2607:f8b0:4864:20::843]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E119EC08C5C2 for ; Mon, 8 Jun 2020 11:59:34 -0700 (PDT) Received: by mail-qt1-x843.google.com with SMTP id z1so15614293qtn.2 for ; Mon, 08 Jun 2020 11:59:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ndufresne-ca.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=1LNXy0gulshDF6Am2ORMrlABkF4RBeFdpjJ6l6ghlxc=; b=XKzY/dMoRNR8g2sNEYdfjb4hTfUUulqOlT+yf47tp2KJzcr32jQMJqtK5NJop2cINl 9Ebd8hsMhE+MWHwkXW/PjQHzQNVi+QxoJYp5ggn+JZbE6bIhHzJaCbg54yeBdVYaKhiU GLOT0fN/40VD6Gf5soYESTPoFMs5u410zhTCtMMxSiTNAF1IeqSGJW4F19rGX+ddm8Lh 2XsHczdkDeRkyYoLm+k6ElJtv/2AnJKWR7j2B8380LonwThSgmeNaioKv+cKsl8yX/fK v69JfJPGaD79z/9nCqUM3LDP+XzmX2bnG5R8IMygXAh/DNaCOzAO7QTc8Jl1vn0W6Czd fQRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=1LNXy0gulshDF6Am2ORMrlABkF4RBeFdpjJ6l6ghlxc=; b=PV4w4V2LHgwfQeFYrhhzaBD7oXzhICAFF0+DXUOpDPwZPA/wzElh501yXkOV3R8joA wuq2VGTqvhbQwhm64xj85eXmD4j4co1sfb8ad4eN6eGUkfQFcnpjpUeaalUU6+IUy2w3 UKeT6DcX7AscKtbOMmeOczmKe78e9FJolj2IlzzAv4rbTQNNiQrGqcOV1mTjqY7AP88B XjirdFTRkbzrOgtdzugT1tYQNGJYsZq2nw77NJHQR/DP8GTQ+Hzdf3iGWg3rl2SsL5sY zEXOwsK5rtOPp1E7OrJvoYVKjxVh7v3+VbSXi40XABsAoobnyNRdKFH3yka2VngE0VFB 1eQA== X-Gm-Message-State: AOAM533Qu0/8UaqwKc2tUlzUNho7rqhNGBgZUHxBqiwX8A3yXOYhIu7M 1toLpdDM7YmKc6A05LfgSQfSwg== X-Received: by 2002:ac8:7350:: with SMTP id q16mr24420939qtp.74.1591642773976; Mon, 08 Jun 2020 11:59:33 -0700 (PDT) Received: from skullcanyon (marriott-chateau-champlain-montreal.sites.intello.com. [66.171.169.34]) by smtp.gmail.com with ESMTPSA id z194sm7357905qkb.73.2020.06.08.11.59.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jun 2020 11:59:33 -0700 (PDT) Message-ID: Subject: Re: [PATCH 1/5] media: videodev2: add Compressed Framebuffer pixel formats From: Nicolas Dufresne To: Hans Verkuil , Neil Armstrong Cc: linux-media@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Maxime Jourdan , Tomasz Figa Date: Mon, 08 Jun 2020 14:59:32 -0400 In-Reply-To: <2a0db0a4-9d04-f20c-39d8-ff25e07e64b7@xs4all.nl> References: <20200604135317.9235-1-narmstrong@baylibre.com> <20200604135317.9235-2-narmstrong@baylibre.com> <02aa06fd8397b77c9a75d3a8399cb55d3b4d39c1.camel@ndufresne.ca> <4d22ff40-11ac-c77a-564d-af9a678f23af@baylibre.com> <2a0db0a4-9d04-f20c-39d8-ff25e07e64b7@xs4all.nl> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.2 (3.36.2-1.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le lundi 08 juin 2020 à 16:43 +0200, Hans Verkuil a écrit : > On 08/06/2020 16:14, Neil Armstrong wrote: > > On 08/06/2020 11:26, Hans Verkuil wrote: > > > On 08/06/2020 10:16, Neil Armstrong wrote: > > > > Hi Nicolas, > > > > > > > > On 05/06/2020 17:35, Nicolas Dufresne wrote: > > > > > Le jeudi 04 juin 2020 à 15:53 +0200, Neil Armstrong a écrit : > > > > > > From: Maxime Jourdan > > > > > > > > > > > > Add two generic Compressed Framebuffer pixel formats to be used > > > > > > with a modifier when imported back in another subsystem like DRM/KMS. > > > > > > > > > > > > These pixel formats represents generic 8bits and 10bits compressed buffers > > > > > > with a vendor specific layout. > > > > > > > > > > > > These are aligned with the DRM_FORMAT_YUV420_8BIT and DRM_FORMAT_YUV420_10BIT > > > > > > used to describe the underlying compressed buffers used for ARM Framebuffer > > > > > > Compression. In the Amlogic case, the compression is different but the > > > > > > underlying buffer components is the same. > > > > > > > > > > > > Signed-off-by: Maxime Jourdan > > > > > > Signed-off-by: Neil Armstrong > > > > > > --- > > > > > > drivers/media/v4l2-core/v4l2-ioctl.c | 2 ++ > > > > > > include/uapi/linux/videodev2.h | 9 +++++++++ > > > > > > 2 files changed, 11 insertions(+) > > > > > > > > > > > > diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c > > > > > > index 2322f08a98be..8f14adfd5bc5 100644 > > > > > > --- a/drivers/media/v4l2-core/v4l2-ioctl.c > > > > > > +++ b/drivers/media/v4l2-core/v4l2-ioctl.c > > > > > > @@ -1447,6 +1447,8 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt) > > > > > > case V4L2_PIX_FMT_S5C_UYVY_JPG: descr = "S5C73MX interleaved UYVY/JPEG"; break; > > > > > > case V4L2_PIX_FMT_MT21C: descr = "Mediatek Compressed Format"; break; > > > > > > case V4L2_PIX_FMT_SUNXI_TILED_NV12: descr = "Sunxi Tiled NV12 Format"; break; > > > > > > + case V4L2_PIX_FMT_YUV420_8BIT: descr = "Compressed YUV 4:2:0 8-bit Format"; break; > > > > > > + case V4L2_PIX_FMT_YUV420_10BIT: descr = "Compressed YUV 4:2:0 10-bit Format"; break; > > > > [..] > > > > > > > I'll remind that the modifier implementation has great value and is > > > > > much more scalable then the current V4L2 approach. There has been some > > > > > early proposal for this, maybe it's time to prioritize because this > > > > > list will starts growing with hundred or even thousands or format, > > > > > which is clearly indicated by the increase of modifier generator macro > > > > > on the DRM side. > > > > > > > > Yes, but until the migration of drm_fourcc and v4l2 fourcc into a common one > > > > is decided, I'm stuck and this is the only intermediate solution I found. > > > > > > We can safely assume that drm fourcc and v4l2 fourcc won't be merged. > > > > > > There is too much divergence and not enough interest in creating common > > > fourccs. > > > > > > But we *do* want to share the modifiers. > > > > > > > We have a working solution with Boris's patchset with ext_fmt passing the > > > > modifier to user-space. > > > > > > > > but anyway, since the goal is to merge the fourcc between DRM & V4L2, these YUV420_*BIT > > > > will still be needed if we pass the modifier with an extended format struct. > > > > > > We tried merging fourccs but that ran into resistance. Frankly, I wouldn't > > > bother with this, it is much easier to just create a conversion table in the > > > kernel docs. > > > > > > So don't block on this, I would really prefer if the ext_fmt series is picked > > > up again and rebased and reposted and then worked on. The stateless codec support > > > is taking less time (it's shaping up well) so there is more time to work on this. > > > > Ok, I already starting discussing with Helen Koike about the ext_fnt re-spin. > > > > Should I re-introduce different v4l2 pixfmt for these DRM YUV420_*BIT or I can keep this > > patch along the new ext_fmt and shared modifiers ? > > So to be clear the DRM_FORMAT_YUV420_8BIT/10BIT fourccs define that this is a > buffer containing compressed YUV420 in 8 or 10 bit and the modifier tells userspace > which compression is used, right? > > And we would add V4L2_PIX_FMT_YUV420_8BIT/_10BIT that, I assume, use the same > fourcc values as the DRM variants? > > Since these fourccs are basically useless without V4L2 modifier support it would > only make sense in combination with the ext_fmt series. I personally still think that adding these fourcc will just create a source of confusion and that fourcc should not be tried to be matched at the cost of tripling the already duplicated pixel formats. Userspace already need to implement translation anyway. On DRM side, new fourcc was not create for NV12+modifier, I don't see why planar YUV420 has to be different, with or without ext_fmt. Nicolas > > Regards, > > Hans > > > Neil > > > > > I believe we really need this since v4l2_buffer and v4l2_format are a real mess. > > > > > > Regards, > > > > > > Hans > > > > > > > > > default: > > > > > > if (fmt->description[0]) > > > > > > return; > > > > > > diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h > > > > > > index c3a1cf1c507f..90b9949acb8a 100644 > > > > > > --- a/include/uapi/linux/videodev2.h > > > > > > +++ b/include/uapi/linux/videodev2.h > > > > > > @@ -705,6 +705,15 @@ struct v4l2_pix_format { > > > > > > #define V4L2_PIX_FMT_FWHT v4l2_fourcc('F', 'W', 'H', 'T') /* Fast Walsh Hadamard Transform (vicodec) */ > > > > > > #define V4L2_PIX_FMT_FWHT_STATELESS v4l2_fourcc('S', 'F', 'W', 'H') /* Stateless FWHT (vicodec) */ > > > > > > > > > > > > +/* > > > > > > + * Compressed Luminance+Chrominance meta-formats > > > > > > + * In these formats, the component ordering is specified (Y, followed by U > > > > > > + * then V), but the exact Linear layout is undefined. > > > > > > + * These formats can only be used with a non-Linear modifier. > > > > > > + */ > > > > > > +#define V4L2_PIX_FMT_YUV420_8BIT v4l2_fourcc('Y', 'U', '0', '8') /* 1-plane YUV 4:2:0 8-bit */ > > > > > > +#define V4L2_PIX_FMT_YUV420_10BIT v4l2_fourcc('Y', 'U', '1', '0') /* 1-plane YUV 4:2:0 10-bit */ > > > > > > + > > > > > > /* Vendor-specific formats */ > > > > > > #define V4L2_PIX_FMT_CPIA1 v4l2_fourcc('C', 'P', 'I', 'A') /* cpia1 YUV */ > > > > > > #define V4L2_PIX_FMT_WNVA v4l2_fourcc('W', 'N', 'V', 'A') /* Winnov hw compress */ > > > > > > > > [1] https://patchwork.freedesktop.org/series/73722/#rev7 > > > >