mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jonas Karlman <jonas@kwiboo.se>
To: "Huang Jiachai" <hjc@rock-chips.com>, "Heiko Stübner" <heiko@sntech.de>
Cc: "Daniel Vetter" <daniel@ffwll.ch>,
	"David Airlie" <airlied@linux.ie>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	linux-kernel@vger.kernel.org,
	"Maxime Ripard" <mripard@kernel.org>,
	linux-rockchip@lists.infradead.org,
	dri-devel@lists.freedesktop.org,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	闫孝军 <andy.yan@rock-chips.com>,
	"Brian Starkey" <brian.starkey@arm.com>,
	"Ben Davis" <ben.davis@arm.com>
Subject: Re: [PATCH 1/2] drm: drm_fourcc: add NV20 YUV format【请注意,邮件由linux-rockchip-bounces+sandy.huang=rock-chips.com@lists.infradead.org代发】
Date: Fri, 26 Jun 2020 14:19:53 +0000 (UTC)	[thread overview]
Message-ID: <f5c46547-3278-2226-e194-929fbfa95864@kwiboo.se> (raw)
In-Reply-To: <d503eed1-571f-3e37-858b-b5de04cb79f7@rock-chips.com>

On 2020-06-17 14:07, Huang Jiachai wrote:
> Hi Jonas Karlman,
> 
>      Is there an another yuv 10bit format with 4:4:4 sub-simpling but 
> has no padding?
> 
>   Maybe we can call it DRM_FORMAT_NV30:
> 
> { .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 },
> 
> this format can supported by rockchip rk3288/rk3399... platform, can you 
> add this format at this series patches?

I will send a v2 including this 4:4:4 format later this weekend.

Is there any hw block on rk3288/rk3399 that can produce a buffer in such format?
If I am not mistaken rkvdec only support 10-bit h264 in 4:2:0/4:2:2 and
hevc 4:2:0 10-bit, those are the formats I have been able to test so far.

Regards,
Jonas

> 
> 在 2020/6/8 4:25, Jonas Karlman 写道:
>> DRM_FORMAT_NV20 is a 2 plane format suitable for linear memory layout.
>> The format is similar to P210 with 4:2:2 sub-sampling but 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' suffix refers to the optimum effective bits per pixel which is
>> achieved when the total number of luminance samples is a multiple of 4.
>>
>> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
>> ---
>>   drivers/gpu/drm/drm_fourcc.c  | 4 ++++
>>   include/uapi/drm/drm_fourcc.h | 1 +
>>   2 files changed, 5 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/drm_fourcc.c b/drivers/gpu/drm/drm_fourcc.c
>> index 722c7ebe4e88..2a9c8ae719ed 100644
>> --- a/drivers/gpu/drm/drm_fourcc.c
>> +++ b/drivers/gpu/drm/drm_fourcc.c
>> @@ -278,6 +278,10 @@ 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_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 b5bf1c0e630e..244d32433a67 100644
>> --- a/include/uapi/drm/drm_fourcc.h
>> +++ b/include/uapi/drm/drm_fourcc.h
>> @@ -242,6 +242,7 @@ 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 */
>>   
>>   /*
>>    * 2 plane YCbCr MSB aligned
> 

  reply	other threads:[~2020-06-26 14:19 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-07 20:25 [PATCH 0/2] drm: rockchip: add NV15 and NV20 support Jonas Karlman
2020-06-07 20:25 ` [PATCH 1/2] drm: drm_fourcc: add NV20 YUV format Jonas Karlman
2020-06-08  9:11   ` Brian Starkey
2020-06-17 12:07   ` [PATCH 1/2] drm: drm_fourcc: add NV20 YUV format【请注意,邮件由linux-rockchip-bounces+sandy.huang=rock-chips.com@lists.infradead.org代发】 Huang Jiachai
2020-06-26 14:19     ` Jonas Karlman [this message]
2020-06-28  1:51       ` Huang Jiachai
2020-06-07 20:25 ` [PATCH 2/2] drm: rockchip: add NV15 and NV20 support Jonas Karlman
2020-06-17  9:27   ` Heiko Stübner
2020-07-06 22:30 ` [PATCH v2 0/2] drm: rockchip: add NV15, NV20 and NV30 support Jonas Karlman
2020-07-06 22:30   ` [PATCH v2 1/2] drm: drm_fourcc: add NV20 and NV30 YUV formats Jonas Karlman
2020-07-07 11:44     ` [PATCH v2 1/2] drm: drm_fourcc: add NV20 and NV30 YUV formats【请注意,邮件由linux-rockchip-bounces+sandy.huang=rock-chips.com@lists.infradead.org代发】 Huang Jiachai
2020-07-06 22:30   ` [PATCH v2 2/2] drm: rockchip: add NV15, NV20 and NV30 support Jonas Karlman
2020-07-07 11:45     ` [PATCH v2 2/2] drm: rockchip: add NV15, NV20 and NV30 support【请注意,邮件由linux-rockchip-bounces+sandy.huang=rock-chips.com@lists.infradead.org代发】 Huang Jiachai
2020-07-14  7:34     ` [PATCH v2 2/2] drm: rockchip: add NV15, NV20 and NV30 support Alex Bee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f5c46547-3278-2226-e194-929fbfa95864@kwiboo.se \
    --to=jonas@kwiboo.se \
    --cc=airlied@linux.ie \
    --cc=andy.yan@rock-chips.com \
    --cc=ben.davis@arm.com \
    --cc=brian.starkey@arm.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=heiko@sntech.de \
    --cc=hjc@rock-chips.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®