Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp3874729ybg; Sun, 7 Jun 2020 13:28:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCCP/lZUORsiaRItvcGsvf4ZbMq7FQwliMhj+GTyj8BgB/ACsSR+Zb6ILArwq3LJDMbJYY X-Received: by 2002:a50:cdc6:: with SMTP id h6mr18775665edj.111.1591561695167; Sun, 07 Jun 2020 13:28:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591561695; cv=none; d=google.com; s=arc-20160816; b=d2pEqfP/jeRiKgHb+c7NjOPoPw/4EKNR2SsnW7H+Limogf8AxgSNgIXo7glaA4P4WJ IuqKWVxu7Lj7Z4ZTMLL3O7NGR0qTgGfU/pG7uS2H3h5UzbdTL8qICsnU/A93uxTujUeR bxekL0w/3YUT43dWEZUbt6xi4gEnyEi7ykAixOs6x/YuJhz8gtOC7PmWj8R7g0yPgkGF dF8j6nOYNcxdw0iY57firxxKf3iJkfPkyp2Q5ZjTJHIe0u7aGM5DKKNtZq8d4GdpuFZg YQQc8tn/Kvul4y/ImlDFoC9QUGahIjT9PGALoLzKlQ+wuz7I4U8NZZqibiW4CJmPiyJz Yqnw== 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:cc:to :references:in-reply-to:message-id:date:subject:from:dkim-signature; bh=y4cPh0/f3xkxdbgS5qj6WkCOPZvcYGJkTGyjKr6sOYA=; b=uySTShp26D/ukJjt6o+a0doG3XQ1QcO9VkhIBNg2MZhpnCiHXnZPHfVYfLbYAW1tpV ys85t67wmM8LksF1nFRB6D8UPv30SWAAbFq9XFxFDvTgSx7wzLXZGy3cSPCjU6hUUsbE nGqXXRBolbtyvHR/MzPg0S/xHF5rOofgxoRV2vHPveojwUfi2WEkiHPYar59OArHugYN saEx6v2xjlplMJLHT5c3wQYTyUeNaufEo9TVWnLI5XmQrnyskTGXwxbo77lj8P3pMpVu J8Yo8cFBpZsOEodHDf4ztYe/5CyvpGXeGYAkWd8oF9/ijIhB83c00efAUDgtGwnJHjwM YZQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kwiboo.se header.s=001 header.b="V/UDgp0f"; 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 e13si7226311ejd.417.2020.06.07.13.27.52; Sun, 07 Jun 2020 13:28:15 -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="V/UDgp0f"; 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 S1728009AbgFGUZ0 (ORCPT + 99 others); Sun, 7 Jun 2020 16:25:26 -0400 Received: from o1.b.az.sendgrid.net ([208.117.55.133]:27347 "EHLO o1.b.az.sendgrid.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726872AbgFGUZ0 (ORCPT ); Sun, 7 Jun 2020 16:25:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=from:subject:in-reply-to:references:to:cc:content-type: content-transfer-encoding; s=001; bh=y4cPh0/f3xkxdbgS5qj6WkCOPZvcYGJkTGyjKr6sOYA=; b=V/UDgp0fOZoYYqSnEV7WYd1bN1V0iJF7T9go8ZR4/oRHNdJYs8t2JHrHab3Uh36JHfQt rnv2kaJZuVnYJDvc1Z6KMDn6Xr9nZEWxXrXNzX9xuz8sZODjxaEVZgfgbMjTwrle+xRbcr SAzf6iHLcMiPL9is3bJFs87OEGRim1rxI= Received: by filterdrecv-p3mdw1-6f5df8956d-dtkn2 with SMTP id filterdrecv-p3mdw1-6f5df8956d-dtkn2-21-5EDD4D35-1F 2020-06-07 20:25:25.615165994 +0000 UTC m=+346301.434158460 Received: from bionic.localdomain (unknown) by ismtpd0001p1lon1.sendgrid.net (SG) with ESMTP id 8kV6fIRtTkGGPZ3_nSj1Tg Sun, 07 Jun 2020 20:25:25.442 +0000 (UTC) From: Jonas Karlman Subject: [PATCH 1/2] drm: drm_fourcc: add NV20 YUV format Date: Sun, 07 Jun 2020 20:25:25 +0000 (UTC) Message-Id: <20200607202521.18438-2-jonas@kwiboo.se> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200607202521.18438-1-jonas@kwiboo.se> References: <20200607202521.18438-1-jonas@kwiboo.se> X-SG-EID: =?us-ascii?Q?TdbjyGynYnRZWhH+7lKUQJL+ZxmxpowvO2O9SQF5CwCVrYgcwUXgU5DKUU3QxA?= =?us-ascii?Q?fZekEeQsTe+RrMu3cja6a0h=2FtF3WwO9txVSXf8F?= =?us-ascii?Q?HjIX=2FR2s7i+VJch9=2FwdL08LjEKxGfZ3lRwZHytH?= =?us-ascii?Q?crArFghPPbRhR21qGzFBxRRVKhycnM0=2F5WHlRIT?= =?us-ascii?Q?6nKT5f+SrOxVNM5N0PT5iPJ2SJDTNvTXqxofFWG?= =?us-ascii?Q?UQUkK0ZKV4eHdAld5ZgylJIE4es1iu0dVO+mKx0?= =?us-ascii?Q?L7z9P73ZpKFsM=2F9ZqDlqw=3D=3D?= To: Sandy Huang , Heiko =?iso-8859-1?q?St=FCbner?= Cc: Jonas Karlman , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Ben Davis , Brian Starkey , dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 -- 2.17.1