Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp965453ybt; Tue, 7 Jul 2020 04:45:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOM9lrbTj32MGhoFEqgcwknXuJH73oGsQ5Tp9vf2TyyKQlPjsCNsP8ctSsFMVds2aHBNG9 X-Received: by 2002:a17:906:19c9:: with SMTP id h9mr45310731ejd.526.1594122341939; Tue, 07 Jul 2020 04:45:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594122341; cv=none; d=google.com; s=arc-20160816; b=d/HY1/6ZWjkExqWqh5OG09JhnIQL3kCLGgxCkG/GLsLhp2Ca9Oj/LUkDtReogjD3Tb SY9nN7hP9G21sW0BCiPQFYTcwYDh8aTdFvuFPpZ3ItE2gDr1xsCUxvW9otuw4j4poMrW tLxgRaauXETaw7UuAwCXfo+P6pU+gH5JJVhSqMdbhfdwK4mnvVS98/aNvTvWl7ORDjkz fObRT2ci7sJgIBW7k+1WHnHv/smUO2qDLsgz1mngMlxACtg/61aRLmnUpNDKHp4LXzVX dH7/3mz2SG+Y9HVWklCjvVUY7UbrlKR4PinIbCdNayE5MExQDJKHnMA/DmsaRg1A9zqQ dr9A== 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:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=l5R9rzdyqL3BTeRvpRPNRlibN77oyTrL/XVUnfnHUJ0=; b=Tlp8fAitvnrunKFtlYncHktPbYTVZMSZG8BF4IT4BSLnxI7GxuG6JCYigrqgq+C4t5 aQGWbpvjdcKpWeucwPkoMrkBd5UnWKJX87pFtWp836yEWcWxZQgcK0UFmODMCz2/VMZZ IZG2QCgKsPxuvETuR+igu1/jkuePda2FnV1+PiH8Q+q6zFdgSCqUjRIrpqMTKu6eUpD1 kg8kyvLFESEPpB9YNtl2AagKcpdtWvpOWBVGHjrFWNCSLIZQA+EfiQHUVbylL9swKr/e CnD/WYMcPYYkl7igWX24faQBwrXm5sAhUYrfq6yz1At22Fe7n/1BblZNB+igj+zgFJwZ dk+g== ARC-Authentication-Results: i=1; mx.google.com; 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 e18si13156706eji.614.2020.07.07.04.45.18; Tue, 07 Jul 2020 04:45:41 -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; 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 S1728126AbgGGLo5 (ORCPT + 99 others); Tue, 7 Jul 2020 07:44:57 -0400 Received: from lucky1.263xmail.com ([211.157.147.134]:51130 "EHLO lucky1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725944AbgGGLo5 (ORCPT ); Tue, 7 Jul 2020 07:44:57 -0400 Received: from localhost (unknown [192.168.167.16]) by lucky1.263xmail.com (Postfix) with ESMTP id 86B88C0994; Tue, 7 Jul 2020 19:44:53 +0800 (CST) X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-ADDR-CHECKED4: 1 X-SKE-CHECKED: 0 X-ANTISPAM-LEVEL: 2 X-ABS-CHECKED: 0 Received: from [172.16.12.76] (unknown [58.22.7.114]) by smtp.263.net (postfix) whith ESMTP id P22500T140639612159744S1594122293842809_; Tue, 07 Jul 2020 19:44:54 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: <7ed9b2a78b31790478278814a2e85862> X-RL-SENDER: hjc@rock-chips.com X-SENDER: hjc@rock-chips.com X-LOGIN-NAME: hjc@rock-chips.com X-FST-TO: hjc@rock-chips.com X-SENDER-IP: 58.22.7.114 X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 X-System-Flag: 0 Subject: =?UTF-8?Q?Re=3a_=5bPATCH_v2_1/2=5d_drm=3a_drm=5ffourcc=3a_add_NV20_?= =?UTF-8?B?YW5kIE5WMzAgWVVWIGZvcm1hdHPjgJDor7fms6jmhI/vvIzpgq7ku7bnlLFsaW51?= =?UTF-8?Q?x-rockchip-bounces+sandy=2ehuang=3drock-chips=2ecom=40lists=2einf?= =?UTF-8?B?cmFkZWFkLm9yZ+S7o+WPkeOAkQ==?= To: Jonas Karlman , =?UTF-8?Q?Heiko_St=c3=bcbner?= Cc: Daniel Vetter , David Airlie , Maarten Lankhorst , linux-kernel@vger.kernel.org, Maxime Ripard , linux-rockchip@lists.infradead.org, dri-devel@lists.freedesktop.org, Thomas Zimmermann , Ben Davis References: <20200607202521.18438-1-jonas@kwiboo.se> <20200706223009.1200-1-jonas@kwiboo.se> <20200706223009.1200-2-jonas@kwiboo.se> From: Huang Jiachai Message-ID: <8e4966d3-c57c-735a-d0e0-ca769c2d4f0e@rock-chips.com> Date: Tue, 7 Jul 2020 19:44:53 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <20200706223009.1200-2-jonas@kwiboo.se> Content-Type: text/plain; charset=gbk; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ?? 2020/7/7 6:30, Jonas Karlman д??: > DRM_FORMAT_NV20 and DRM_FORMAT_NV30 formats is the 2x1 and non-subsampled > variant of NV15, a 10-bit 2-plane YUV format that has no padding between > components. Instead, luminance and chrominance samples are grouped into 4s > so that each group is packed into an integer number of bytes: > > YYYY = UVUV = 4 * 10 bits = 40 bits = 5 bytes > > The '20' and '30' suffix refers to the optimum effective bits per pixel > which is achieved when the total number of luminance samples is a multiple > of 4. > > V2: Added NV30 format > > Signed-off-by: Jonas Karlman > --- > drivers/gpu/drm/drm_fourcc.c | 8 ++++++++ > include/uapi/drm/drm_fourcc.h | 2 ++ > 2 files changed, 10 insertions(+) > > diff --git a/drivers/gpu/drm/drm_fourcc.c b/drivers/gpu/drm/drm_fourcc.c > index 722c7ebe4e88..2daf8a304b53 100644 > --- a/drivers/gpu/drm/drm_fourcc.c > +++ b/drivers/gpu/drm/drm_fourcc.c > @@ -278,6 +278,14 @@ const struct drm_format_info *__drm_format_info(u32 format) > .num_planes = 2, .char_per_block = { 5, 5, 0 }, > .block_w = { 4, 2, 0 }, .block_h = { 1, 1, 0 }, .hsub = 2, > .vsub = 2, .is_yuv = true }, > + { .format = DRM_FORMAT_NV20, .depth = 0, > + .num_planes = 2, .char_per_block = { 5, 5, 0 }, > + .block_w = { 4, 2, 0 }, .block_h = { 1, 1, 0 }, .hsub = 2, > + .vsub = 1, .is_yuv = true }, > + { .format = DRM_FORMAT_NV30, .depth = 0, > + .num_planes = 2, .char_per_block = { 5, 5, 0 }, > + .block_w = { 4, 2, 0 }, .block_h = { 1, 1, 0 }, .hsub = 1, > + .vsub = 1, .is_yuv = true }, > { .format = DRM_FORMAT_Q410, .depth = 0, > .num_planes = 3, .char_per_block = { 2, 2, 2 }, > .block_w = { 1, 1, 1 }, .block_h = { 1, 1, 1 }, .hsub = 0, > diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h > index cbf92fdf2712..c8695673295c 100644 > --- a/include/uapi/drm/drm_fourcc.h > +++ b/include/uapi/drm/drm_fourcc.h > @@ -242,6 +242,8 @@ extern "C" { > * index 1 = Cr:Cb plane, [39:0] Cr1:Cb1:Cr0:Cb0 little endian > */ > #define DRM_FORMAT_NV15 fourcc_code('N', 'V', '1', '5') /* 2x2 subsampled Cr:Cb plane */ > +#define DRM_FORMAT_NV20 fourcc_code('N', 'V', '2', '0') /* 2x1 subsampled Cr:Cb plane */ > +#define DRM_FORMAT_NV30 fourcc_code('N', 'V', '3', '0') /* non-subsampled Cr:Cb plane */ > > /* > * 2 plane YCbCr MSB aligned Reviewed-by: Sandy Huang -- Best Regard ?Ƽ??? Sandy Huang Addr: ?????й?¥??ͭ??·????????89?Ÿ???????԰A??21??¥(350003) No. 21 Building, A District, No.89,software Boulevard Fuzhou,Fujian,PRC Tel??+86 0591-87884919 8690 E-mail??hjc@rock-chips.com