From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1296BC433B4 for ; Thu, 6 May 2021 06:37:13 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8F252613FC for ; Thu, 6 May 2021 06:37:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8F252613FC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 755D56EC9E; Thu, 6 May 2021 06:37:09 +0000 (UTC) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id CCFCB6EC9D; Thu, 6 May 2021 06:37:07 +0000 (UTC) IronPort-SDR: sIzkhP3bhZAz5ni3TSXRYHvBhFqLpOygExbeKaiIvpD31sTN0wivLyNmwpH16clHiwf9pstky4 FKtcdYJYjqQA== X-IronPort-AV: E=McAfee;i="6200,9189,9975"; a="219270229" X-IronPort-AV: E=Sophos;i="5.82,276,1613462400"; d="scan'208";a="219270229" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 May 2021 23:37:07 -0700 IronPort-SDR: TamvkOV3vH3us829oXeRO+W012meaTmIVUxgqa5yHMs6163xf0QjRogBLw3GnUJFHbQtNPqIO7 ISqlBFy5wphQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,276,1613462400"; d="scan'208";a="469322810" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.171]) by orsmga001.jf.intel.com with SMTP; 05 May 2021 23:37:03 -0700 Received: by stinkbox (sSMTP sendmail emulation); Thu, 06 May 2021 09:37:02 +0300 Date: Thu, 6 May 2021 09:37:02 +0300 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: Mario Kleiner Subject: Re: [PATCH 1/5] drm/fourcc: Add 16 bpc fixed point framebuffer formats. Message-ID: References: <20210319210317.32369-1-mario.kleiner.de@gmail.com> <20210319210317.32369-2-mario.kleiner.de@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Patchwork-Hint: comment X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alex Deucher , amd-gfx list , dri-devel , Nicholas Kazlauskas Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Sat, Mar 20, 2021 at 04:09:47AM +0200, Ville Syrjälä wrote: > On Fri, Mar 19, 2021 at 10:45:10PM +0100, Mario Kleiner wrote: > > On Fri, Mar 19, 2021 at 10:16 PM Ville Syrjälä > > wrote: > > > > > > On Fri, Mar 19, 2021 at 10:03:13PM +0100, Mario Kleiner wrote: > > > > These are 16 bits per color channel unsigned normalized formats. > > > > They are supported by at least AMD display hw, and suitable for > > > > direct scanout of Vulkan swapchain images in the format > > > > VK_FORMAT_R16G16B16A16_UNORM. > > > > > > > > Signed-off-by: Mario Kleiner > > > > --- > > > > drivers/gpu/drm/drm_fourcc.c | 4 ++++ > > > > include/uapi/drm/drm_fourcc.h | 7 +++++++ > > > > 2 files changed, 11 insertions(+) > > > > > > > > diff --git a/drivers/gpu/drm/drm_fourcc.c b/drivers/gpu/drm/drm_fourcc.c > > > > index 03262472059c..ce13d2be5d7b 100644 > > > > --- a/drivers/gpu/drm/drm_fourcc.c > > > > +++ b/drivers/gpu/drm/drm_fourcc.c > > > > @@ -203,6 +203,10 @@ const struct drm_format_info *__drm_format_info(u32 format) > > > > { .format = DRM_FORMAT_ARGB16161616F, .depth = 0, .num_planes = 1, .cpp = { 8, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true }, > > > > { .format = DRM_FORMAT_ABGR16161616F, .depth = 0, .num_planes = 1, .cpp = { 8, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true }, > > > > { .format = DRM_FORMAT_AXBXGXRX106106106106, .depth = 0, .num_planes = 1, .cpp = { 8, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true }, > > > > + { .format = DRM_FORMAT_XRGB16161616, .depth = 0, .num_planes = 1, .cpp = { 8, 0, 0 }, .hsub = 1, .vsub = 1 }, > > > > + { .format = DRM_FORMAT_XBGR16161616, .depth = 0, .num_planes = 1, .cpp = { 8, 0, 0 }, .hsub = 1, .vsub = 1 }, > > > > + { .format = DRM_FORMAT_ARGB16161616, .depth = 0, .num_planes = 1, .cpp = { 8, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true }, > > > > + { .format = DRM_FORMAT_ABGR16161616, .depth = 0, .num_planes = 1, .cpp = { 8, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true }, > > > > { .format = DRM_FORMAT_RGB888_A8, .depth = 32, .num_planes = 2, .cpp = { 3, 1, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true }, > > > > { .format = DRM_FORMAT_BGR888_A8, .depth = 32, .num_planes = 2, .cpp = { 3, 1, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true }, > > > > { .format = DRM_FORMAT_XRGB8888_A8, .depth = 32, .num_planes = 2, .cpp = { 4, 1, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true }, > > > > diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h > > > > index f76de49c768f..f7156322aba5 100644 > > > > --- a/include/uapi/drm/drm_fourcc.h > > > > +++ b/include/uapi/drm/drm_fourcc.h > > > > @@ -168,6 +168,13 @@ extern "C" { > > > > #define DRM_FORMAT_RGBA1010102 fourcc_code('R', 'A', '3', '0') /* [31:0] R:G:B:A 10:10:10:2 little endian */ > > > > #define DRM_FORMAT_BGRA1010102 fourcc_code('B', 'A', '3', '0') /* [31:0] B:G:R:A 10:10:10:2 little endian */ > > > > > > > > +/* 64 bpp RGB */ > > > > +#define DRM_FORMAT_XRGB16161616 fourcc_code('X', 'R', '4', '8') /* [63:0] x:R:G:B 16:16:16:16 little endian */ > > > > +#define DRM_FORMAT_XBGR16161616 fourcc_code('X', 'B', '4', '8') /* [63:0] x:B:G:R 16:16:16:16 little endian */ > > > > + > > > > +#define DRM_FORMAT_ARGB16161616 fourcc_code('A', 'R', '4', '8') /* [63:0] A:R:G:B 16:16:16:16 little endian */ > > > > +#define DRM_FORMAT_ABGR16161616 fourcc_code('A', 'B', '4', '8') /* [63:0] A:B:G:R 16:16:16:16 little endian */ > > > > > > These look reasonable enough to me. IIRC we should be able to expose > > > them on some recent Intel hw as well. > > > > > > Reviewed-by: Ville Syrjälä > > > > > > > Thanks Ville! > > > > Indeed i looked over the Intel PRM's, and while fp16 support seems to > > be rather recent (Gen8? Gen9? Gen10? Can't remember atm.), iirc, I > > found references to rgb16 fixed point back to gen5 / Ironlake. > > fp16 has been around since forever (gen4+) > uint16 is much more recent, IIRC is something ~glk+ FYI I just hacked something together for i915: git://github.com/vsyrjala/linux.git uint16 Tests seem to pass on a glk here at least. -- Ville Syrjälä Intel