Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp2006970ybn; Thu, 26 Sep 2019 05:43:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqxGxMnhK1SLmLwEm9eNfjzkj09oSNtAYdERl4ggUgnpTZUg1GSpb7Ns7v+0HYoMZajCFaM0 X-Received: by 2002:a50:c306:: with SMTP id a6mr3484570edb.108.1569501799872; Thu, 26 Sep 2019 05:43:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569501799; cv=none; d=google.com; s=arc-20160816; b=ppFldOMp7y6vBBSb9LBwwEZgzj3dnFlmULPFnt0KMrCZJidAEQYsqHlAUvf6vLBJnQ GJr33mx83qzWVvNJDfF0eOaY3l1qO8X/ch1Tfa8YlT3xrt3/vJpkaqtNUx9lZvqZQzTO RU+5vQGSTXCK11hBA/eKoIVBpUZVx3Uui7Vj4CijcaQWsmmwYnGtihDSU2keCOaPR+i1 1JX6tWUJG2jj8UiL+ql6nRpm60EZI8adC1UY7W8VABF16ysF/rezAzcmvG49broFG2V9 tPq9ZDL2lpQ3Dm3UNXFU8XtYn3bRrAK1ZE+zbv7A0KJBO43UrsfhkEogUTv8AbLg6QcC TaRQ== 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=fy4jCUZGwd3o2Km7pJiB3xBG0h+jaMdzGbO3h7bt+qg=; b=yBSBl9O2cBxoGzjxHjc06v8LikG02KfHOGz+lWfS1IgOB+IjCulVR42ElJKbGaw1hH to5iZj1QtHQy1ipyN4aFkFxxDiKHvz5+G80tzw/IT94OviU9ffRUINfLHU6hQMTcJDen 8OoeouQO3Qh1g0cn62WDRpEiGVWrnoewwbmmcIe+fTn9gCCooEcVvagTRc60AIXht60q Bwd3X4IK90fMgvy8kJ6xZfL4u4braGQ/VoVtzAZPxekFiwG3Rm6DIjTF4vG/6ctzzbKH mIps5F+9SBhxFOcukgnV6R3ccjrFz57bj1Eevd37+2Vyujsd5XgZq4PzwthNfbcL1/tp Bvvg== 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 k17si930734ejz.227.2019.09.26.05.42.56; Thu, 26 Sep 2019 05:43:19 -0700 (PDT) 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 S1728255AbfIZIZK (ORCPT + 99 others); Thu, 26 Sep 2019 04:25:10 -0400 Received: from lucky1.263xmail.com ([211.157.147.130]:37624 "EHLO lucky1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725787AbfIZIZJ (ORCPT ); Thu, 26 Sep 2019 04:25:09 -0400 Received: from localhost (unknown [192.168.167.193]) by lucky1.263xmail.com (Postfix) with ESMTP id 58F406F948; Thu, 26 Sep 2019 16:25:06 +0800 (CST) X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-ADDR-CHECKED4: 1 X-ANTISPAM-LEVEL: 2 X-ABS-CHECKED: 0 Received: from localhost.localdomain (unknown [58.22.7.114]) by smtp.263.net (postfix) whith ESMTP id P24701T140118476191488S1569486296531843_; Thu, 26 Sep 2019 16:25:05 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: X-RL-SENDER: hjc@rock-chips.com X-SENDER: hjc@rock-chips.com X-LOGIN-NAME: hjc@rock-chips.com X-FST-TO: dri-devel@lists.freedesktop.org X-SENDER-IP: 58.22.7.114 X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 From: Sandy Huang To: dri-devel@lists.freedesktop.org, Maarten Lankhorst , Maxime Ripard , Sean Paul , David Airlie , Daniel Vetter Cc: hjc@rock-chips.com, heiko@sntech.de, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/3] drm: Add some new format DRM_FORMAT_NVXX_10 Date: Thu, 26 Sep 2019 16:24:47 +0800 Message-Id: <1569486289-152061-2-git-send-email-hjc@rock-chips.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1569486289-152061-1-git-send-email-hjc@rock-chips.com> References: <1569486289-152061-1-git-send-email-hjc@rock-chips.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org These new format is supported by some rockchip socs: DRM_FORMAT_NV12_10/DRM_FORMAT_NV21_10 DRM_FORMAT_NV16_10/DRM_FORMAT_NV61_10 DRM_FORMAT_NV24_10/DRM_FORMAT_NV42_10 Signed-off-by: Sandy Huang --- drivers/gpu/drm/drm_fourcc.c | 18 ++++++++++++++++++ include/uapi/drm/drm_fourcc.h | 14 ++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/drivers/gpu/drm/drm_fourcc.c b/drivers/gpu/drm/drm_fourcc.c index c630064..ccd78a3 100644 --- a/drivers/gpu/drm/drm_fourcc.c +++ b/drivers/gpu/drm/drm_fourcc.c @@ -261,6 +261,24 @@ const struct drm_format_info *__drm_format_info(u32 format) { .format = DRM_FORMAT_P016, .depth = 0, .num_planes = 2, .char_per_block = { 2, 4, 0 }, .block_w = { 1, 0, 0 }, .block_h = { 1, 0, 0 }, .hsub = 2, .vsub = 2, .is_yuv = true}, + { .format = DRM_FORMAT_NV12_10, .depth = 0, .num_planes = 2, + .char_per_block = { 5, 10, 0 }, .block_w = { 4, 4, 0 }, .block_h = { 4, 4, 0 }, + .hsub = 2, .vsub = 2, .is_yuv = true}, + { .format = DRM_FORMAT_NV21_10, .depth = 0, .num_planes = 2, + .char_per_block = { 5, 10, 0 }, .block_w = { 4, 4, 0 }, .block_h = { 4, 4, 0 }, + .hsub = 2, .vsub = 2, .is_yuv = true}, + { .format = DRM_FORMAT_NV16_10, .depth = 0, .num_planes = 2, + .char_per_block = { 5, 10, 0 }, .block_w = { 4, 4, 0 }, .block_h = { 4, 4, 0 }, + .hsub = 2, .vsub = 1, .is_yuv = true}, + { .format = DRM_FORMAT_NV61_10, .depth = 0, .num_planes = 2, + .char_per_block = { 5, 10, 0 }, .block_w = { 4, 4, 0 }, .block_h = { 4, 4, 0 }, + .hsub = 2, .vsub = 1, .is_yuv = true}, + { .format = DRM_FORMAT_NV24_10, .depth = 0, .num_planes = 2, + .char_per_block = { 5, 10, 0 }, .block_w = { 4, 4, 0 }, .block_h = { 4, 4, 0 }, + .hsub = 1, .vsub = 1, .is_yuv = true}, + { .format = DRM_FORMAT_NV42_10, .depth = 0, .num_planes = 2, + .char_per_block = { 5, 10, 0 }, .block_w = { 4, 4, 0 }, .block_h = { 4, 4, 0 }, + .hsub = 1, .vsub = 1, .is_yuv = true}, { .format = DRM_FORMAT_P210, .depth = 0, .num_planes = 2, .char_per_block = { 2, 4, 0 }, .block_w = { 1, 0, 0 }, .block_h = { 1, 0, 0 }, .hsub = 2, diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h index 3feeaa3..08e2221 100644 --- a/include/uapi/drm/drm_fourcc.h +++ b/include/uapi/drm/drm_fourcc.h @@ -238,6 +238,20 @@ extern "C" { #define DRM_FORMAT_NV42 fourcc_code('N', 'V', '4', '2') /* non-subsampled Cb:Cr plane */ /* + * 2 plane YCbCr + * index 0 = Y plane, Y3:Y2:Y1:Y0 10:10:10:10 + * index 1 = Cb:Cr plane, Cb3:Cr3:Cb2:Cr2:Cb1:Cr1:Cb0:Cr0 10:10:10:10:10:10:10:10 + * or + * index 1 = Cr:Cb plane, Cr3:Cb3:Cr2:Cb2:Cr1:Cb1:Cr0:Cb0 10:10:10:10:10:10:10:10 + */ +#define DRM_FORMAT_NV12_10 fourcc_code('N', 'A', '1', '2') /* 2x2 subsampled Cr:Cb plane */ +#define DRM_FORMAT_NV21_10 fourcc_code('N', 'A', '2', '1') /* 2x2 subsampled Cb:Cr plane */ +#define DRM_FORMAT_NV16_10 fourcc_code('N', 'A', '1', '6') /* 2x1 subsampled Cr:Cb plane */ +#define DRM_FORMAT_NV61_10 fourcc_code('N', 'A', '6', '1') /* 2x1 subsampled Cb:Cr plane */ +#define DRM_FORMAT_NV24_10 fourcc_code('N', 'A', '2', '4') /* non-subsampled Cr:Cb plane */ +#define DRM_FORMAT_NV42_10 fourcc_code('N', 'A', '4', '2') /* non-subsampled Cb:Cr plane */ + +/* * 2 plane YCbCr MSB aligned * index 0 = Y plane, [15:0] Y:x [10:6] little endian * index 1 = Cr:Cb plane, [31:0] Cr:x:Cb:x [10:6:10:6] little endian -- 2.7.4