Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp761656imu; Sat, 17 Nov 2018 09:01:30 -0800 (PST) X-Google-Smtp-Source: AJdET5eziCgWCrPXWib0Syw3XyC70B/E4fgKgzdu33QCwMAjsS6+VIpfF1VYYf6C6dUMghY5XG+G X-Received: by 2002:a17:902:6b4a:: with SMTP id g10-v6mr7878808plt.19.1542474090781; Sat, 17 Nov 2018 09:01:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542474090; cv=none; d=google.com; s=arc-20160816; b=NOR3uxRHPygBu9tjYD6+tf3kPMAsnryxpRWERQ8o46ftUNgHz2E2I4QC7vRAcvPXd8 hpnl34+0TechVlBQua4e+wQS4uU0apid70L2iT4a7Hjc8btw/xUO2lN1igCdkf1mljBf cGRFLjvyyPOceIrsib2Hz82VNOzMUKpygdAjRJxX6F9j52j6ECrqdVibtpFdr/sNBfyu bFvl+/lfCChw8oU2WuWRc4lQwnyOwlIfzqvxiRk6+x3fXOupvAwxXc9rm6MGBztffMiK b7wt+i+gQS+52ED4yNZ1yrLFmdgjXDv45jyNf4VGHGc+BzOHzbdOZ74TFhja7OTFQKEk Wo9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=b83Jp2y38LXDRAFDce200/H/Lq4PDu7K5jjZpbqgORw=; b=YSnymkvDmPTZi8+bSQ0qGL4I6WESZh5JXe8XHDsZjwEoFuC4+dmOS+2MBiuZIZ9zAx ivTXbzryFjvEit2Tosdn7oxWu9wyaw/e883e1eTjNZoB26rZ+3oJ4XhjVKsyU9G5HQoj M6eJtmWuwa8zf4MeaCD1my8P36YzFD9TEPU6AErWzmVpc5Cuo5WcULqitp8J9iR4A/t6 Jsd09zsO9cbn1dM2DWUznuizi92iGAgCfjp7KbbjxAf5WhVWywKl/jdRjhfwKmv0z1ZM 3QCCxcVqHKAZIiDxF3a3Sl3uWSAbwvPmmJdfyGGioBb2Pq3+9ozbmXusK70PCSKnAViW UNMA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p2si9842103pgh.474.2018.11.17.09.00.58; Sat, 17 Nov 2018 09:01:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726844AbeKRDRI (ORCPT + 99 others); Sat, 17 Nov 2018 22:17:08 -0500 Received: from kozue.soulik.info ([108.61.200.231]:45118 "EHLO kozue.soulik.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726311AbeKRDRI (ORCPT ); Sat, 17 Nov 2018 22:17:08 -0500 X-Greylist: delayed 343 seconds by postgrey-1.27 at vger.kernel.org; Sat, 17 Nov 2018 22:17:05 EST Received: from misaki.sumomo.pri (unknown [192.168.0.134]) by kozue.soulik.info (Postfix) with ESMTPA id EAE7A1012A2; Sun, 18 Nov 2018 01:54:37 +0900 (JST) From: Randy Li To: dri-devel@lists.freedesktop.org Cc: maarten.lankhorst@linux.intel.com, maxime.ripard@bootlin.com, sean@poorly.run, airlied@linux.ie, linux-kernel@vger.kernel.org, hjc@rock-chips.com, heiko@sntech.de, linux-rockchip@lists.infradead.org, Randy Li Subject: [PATCH v4 1/2] drm/fourcc: add a 10bits fully packed variant of NV12 Date: Sun, 18 Nov 2018 00:53:45 +0800 Message-Id: <20181117165346.25091-2-ayaka@soulik.info> X-Mailer: git-send-email 2.14.5 In-Reply-To: <20181117165346.25091-1-ayaka@soulik.info> References: <20181117165346.25091-1-ayaka@soulik.info> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This pixel format is a fully packed and 10bits variant of NV12. A luma pixel would take 10bits in memory, without any filled bits between pixels in a stride. Signed-off-by: Randy Li --- drivers/gpu/drm/drm_fourcc.c | 1 + include/uapi/drm/drm_fourcc.h | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/drivers/gpu/drm/drm_fourcc.c b/drivers/gpu/drm/drm_fourcc.c index f523948c82b1..76d3ce314f31 100644 --- a/drivers/gpu/drm/drm_fourcc.c +++ b/drivers/gpu/drm/drm_fourcc.c @@ -237,6 +237,7 @@ const struct drm_format_info *__drm_format_info(u32 format) { .format = DRM_FORMAT_X0L2, .depth = 0, .num_planes = 1, .char_per_block = { 8, 0, 0 }, .block_w = { 2, 0, 0 }, .block_h = { 2, 0, 0 }, .hsub = 2, .vsub = 2, .is_yuv = true }, + { .format = DRM_FORMAT_NV12_10LE40, .depth = 0, .num_planes = 2, .cpp = { 1, 2, 0 }, .hsub = 2, .vsub = 2 }, }; unsigned int i; diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h index e7e48f1f4a74..5de5aff83d85 100644 --- a/include/uapi/drm/drm_fourcc.h +++ b/include/uapi/drm/drm_fourcc.h @@ -193,6 +193,14 @@ extern "C" { #define DRM_FORMAT_NV61 fourcc_code('N', 'V', '6', '1') /* 2x1 subsampled Cb:Cr plane */ #define DRM_FORMAT_NV24 fourcc_code('N', 'V', '2', '4') /* non-subsampled Cr:Cb plane */ #define DRM_FORMAT_NV42 fourcc_code('N', 'V', '4', '2') /* non-subsampled Cb:Cr plane */ +/* + * A fully packed 2 plane YCbCr + * Y1 0-9, Y2 10-19, Y3 20-29, Y4 20-39 + * .... + * U1V1: 0-19, U2V2: 20-39 + */ +#define DRM_FORMAT_NV12_10LE40 fourcc_code('R', 'K', '2', '0') /* 2x2 subsampled Cr:Cb plane */ + /* * 3 plane YCbCr -- 2.14.5