Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp6785919ybn; Mon, 30 Sep 2019 03:50:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqxYWOo3TfrLesCkEqXixGhJ1WnhZ8djRoJunJlA06hvv5p/0aENTGvAyjvtY4HFdEh4esRU X-Received: by 2002:a17:907:4242:: with SMTP id np2mr18839285ejb.102.1569840648666; Mon, 30 Sep 2019 03:50:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569840648; cv=none; d=google.com; s=arc-20160816; b=Cvz57Ti216YZZJZzr+sA7Bp7IPBytv+LLwD/OZp9PkEbt2Ve9IDqT5q2N7DBSCheSF DkNY7X1U2WtUVV2vrto21m7Z/TquI/sRUhCJ5lsHOr4AL7DExf3RDbn7WwCATxIF1Hec N1zPF6GR7+vd8GnJ/vaTZsT8d9+WQ58bfYdUkmCMZ8fTjIuAO3W1hQQJXhvDr/mnhj/I BjKMChCPsz/hnM9+Sh7VxkIWfkmJXzjR47cu/me/M5q/Jb8MeUb6PD8TPoYdzi8Mlym+ v5El3ClSuu362Q+82F9VaJG318sVJkCyrm84ussZD9f7AdpqXLvZ10ELPcyIJRnKs2Of PaCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=KmqbPBoTHBf1veJf1bXbxnODhlU8jtT51Rqcetq9sWY=; b=CWN2+YtRnVi7fn+ILZHJYeqm9AlTSpLu5D7Xarxvcg4DsCqYvpqsZ0Ki56LUkvFOgT CRhhIsPV9tdCcqofHFQSzbmvmBRwUsjSDfnMTtSh0cx22bokvlh3OxuBrekHtNubvVpd W2765cTL5fpYFJuSiT5IdMeYZQW+fsToP+4nBMsVD1lMYeUHQZAdEYOJHeK/UrKB0WZs WtoYgzbWl6zPtpZBRdLqPeOZy/EZ8qGFQ+wBlwFgufteYFTq6usGn39W2xxqKy7KzfCa nsYrYFCNwvAPgCtykxm5NY4VU+PIFhFroBdfCivWVKOm7FpdsD7rDHKDM6SxRv0JyGYi CDXw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c14si6448654edc.81.2019.09.30.03.50.24; Mon, 30 Sep 2019 03:50:48 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730809AbfI3Ksz (ORCPT + 99 others); Mon, 30 Sep 2019 06:48:55 -0400 Received: from mga04.intel.com ([192.55.52.120]:17904 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729870AbfI3Ksz (ORCPT ); Mon, 30 Sep 2019 06:48:55 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Sep 2019 03:48:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,565,1559545200"; d="scan'208";a="191104454" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by fmsmga007.fm.intel.com with SMTP; 30 Sep 2019 03:48:50 -0700 Received: by stinkbox (sSMTP sendmail emulation); Mon, 30 Sep 2019 13:48:49 +0300 Date: Mon, 30 Sep 2019 13:48:49 +0300 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: Sandy Huang Cc: dri-devel@lists.freedesktop.org, Maarten Lankhorst , Maxime Ripard , Sean Paul , David Airlie , Daniel Vetter , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/3] drm: Add some new format DRM_FORMAT_NVXX_10 Message-ID: <20190930104849.GA1208@intel.com> References: <1569486289-152061-1-git-send-email-hjc@rock-chips.com> <1569486289-152061-2-git-send-email-hjc@rock-chips.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1569486289-152061-2-git-send-email-hjc@rock-chips.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 26, 2019 at 04:24:47PM +0800, Sandy Huang wrote: > 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 So now you're defining it as some kind of byte aligned block. With that specifying endianness would now make sense since otherwise this tells us absolutely nothing about the memory layout. So I'd either do that, or go back to not specifying anything and use some weasel words like "mamory layout is implementation defined" which of course means no one can use it for anything that involves any kind of cross vendor stuff. > + */ > +#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 > > > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Ville Syrj?l? Intel