Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp610861ybt; Fri, 26 Jun 2020 07:22:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxWqye171CczqFvCrQCWufhA53waAhOuPc2Ssk/BoqJa/0MUFzKQJZracl3RohQpNw7BKhG X-Received: by 2002:a17:906:c831:: with SMTP id dd17mr2748500ejb.40.1593181323438; Fri, 26 Jun 2020 07:22:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593181323; cv=none; d=google.com; s=arc-20160816; b=z3n8dOT6IjjBU2wKmVBDehY7cTJxa5gpeMs4EwPfXLL0LRyDSk1e0r8wV7LxTVA6Nf BaPalcqiAo8YX0pLgfvVL/xN8Wqpnswu3ydMgFGf6+NX82aOLhRcCPSZ1wCtRrw4rrSR Mc40z+OWhLxTroN8edcM6XnHSXYse7TfDQUh4+MJd8sT8OMTk1Jt3hLMbLPQWJJhCNgh sDz26jt6XiKv/dX2Avh0zGKBwYxbpgNq7twJn2wghFDWxHsTTR/j698dwrQEfWRZB4xl MKuzEZ9cQ9EDL8FVGLeewZFt2eHftFajml74hhSQfydbZNVczEnyoEnaf2zUMcqRVuEk +PIQ== 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 :content-language:cc:to:in-reply-to:mime-version:user-agent:date :message-id:from:references:subject:dkim-signature; bh=FEGBRfIR1s0iOSC2ksl+oI8rZYqeM0zR23Uk0jXoKPc=; b=0XvuoE50AW5WFkkAj5EjxN/YrQ69sdhpSgj5mudkHuo+YDZvMQjPCq5R3oO3mOfEVM 0Z05SjzF4qoYnYJIhCe6pKnTbNgoR7ruhyIKQNJYFAEfFH/nBsUyDGO3wq3hwB6KLEU+ yNTdnhpNQYKzs/1J9KLoPaU2aaHUt45qrkX4XP7WIPoRWTViVyRUNVqQ1YJNkMM2x71W zzqgIdnU8tS9bocsZMmJt/qTwBEnN/mG7ntiXrpK25aUOWI0EEz74Da+zMn7kKNhI2N3 kKGykfHzoYQfEQ0bhZsy+6H39XYXDt61TvLVn+E/w9p0oQdXdgPnOUGExVwSqz0pXAF+ kuTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kwiboo.se header.s=001 header.b=jvWP7omt; 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 g17si16299992ejm.633.2020.06.26.07.21.40; Fri, 26 Jun 2020 07:22:03 -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=@kwiboo.se header.s=001 header.b=jvWP7omt; 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 S1729101AbgFZOT4 (ORCPT + 99 others); Fri, 26 Jun 2020 10:19:56 -0400 Received: from o1.b.az.sendgrid.net ([208.117.55.133]:1079 "EHLO o1.b.az.sendgrid.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728489AbgFZOTz (ORCPT ); Fri, 26 Jun 2020 10:19:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=subject:references:from:mime-version:in-reply-to:to:cc:content-type: content-transfer-encoding; s=001; bh=FEGBRfIR1s0iOSC2ksl+oI8rZYqeM0zR23Uk0jXoKPc=; b=jvWP7omtX/XrEkbtoiUz8aVRP7W6fn2S5YZgNCGD1+yYGeGNnWtDNA3Z/c8OtxpI9Sq2 IkSwSqRj6OMw8PeYGYci25iHhPU0N0BmjB1f96fw1MgFsmFJtwckyFNJBYvQ1JCJsgSubt DeZkN7J3QfX6dZ7ZJ8N49vxrQJKC4/FYI= Received: by filterdrecv-p3las1-7754f7d4cc-h4ckv with SMTP id filterdrecv-p3las1-7754f7d4cc-h4ckv-20-5EF60409-55 2020-06-26 14:19:53.796366727 +0000 UTC m=+72377.440658206 Received: from [10.13.72.114] (unknown) by ismtpd0007p1lon1.sendgrid.net (SG) with ESMTP id zPf15BMQRF-Lidn4m7Cubg Fri, 26 Jun 2020 14:19:53.332 +0000 (UTC) Subject: Re: [PATCH 1/2] drm: drm_fourcc: add NV20 YUV =?UTF-8?B?Zm9ybWF044CQ6K+35rOo5oSP77yM6YKu5Lu255SxbGludXgtcm9ja2NoaXAtYm91bmNlcytzYQ==?= =?us-ascii?Q?ndy=2Ehuang=3Drock-chips=2Ecom=40lists=2Einfradea?= =?UTF-8?B?ZC5vcmfku6Plj5HjgJE=?= References: <20200607202521.18438-1-jonas@kwiboo.se> <20200607202521.18438-2-jonas@kwiboo.se> From: Jonas Karlman Message-ID: Date: Fri, 26 Jun 2020 14:19:53 +0000 (UTC) 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: X-SG-EID: =?us-ascii?Q?TdbjyGynYnRZWhH+7lKUQJL+ZxmxpowvO2O9SQF5CwCVrYgcwUXgU5DKUU3QxA?= =?us-ascii?Q?fZekEeQsTe+RrMu3cja6a0hy6P=2FSOgwow3R0Z8y?= =?us-ascii?Q?W1KoHyhm09b7AooB6A2o7db6A8+5y6zT2UI+303?= =?us-ascii?Q?MS9NESYX+3Km3PkmWA=2FsT9auOwL7KKEVMpd=2Fdez?= =?us-ascii?Q?aC3EZOaq2lSpjg41F=2FbXYR7VxcxjWEnrdlePDgi?= =?us-ascii?Q?HdT6YrlXCS7eSHQ5wOQOqkkDqeLi7TxvYuGawMv?= =?us-ascii?Q?+e5TVzZ0uVapU857oi+Tw=3D=3D?= To: Huang Jiachai , Heiko =?iso-8859-1?q?St=FCbner?= 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 , =?UTF-8?b?6Zer5a2d5Yab?= , Brian Starkey , Ben Davis Content-Type: text/plain; charset=utf-8 Content-Language: sv Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 >> --- >> 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 >