Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5355845imm; Tue, 21 Aug 2018 10:17:14 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxZ/IaKQh91DyMoPNIbvr3EpDe7DQvVbVbq0mr1a26OhqldVbE/u8Skh5s/26qKcsrZ1Bjo X-Received: by 2002:a62:3241:: with SMTP id y62-v6mr53860691pfy.4.1534871834086; Tue, 21 Aug 2018 10:17:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534871834; cv=none; d=google.com; s=arc-20160816; b=Af5M9EFH6ecghjc9SGj6thwDtPOH24BebnqObwZHSqgLBiRje8U8b3diNKjb966khh Bx7Bc1ZdFo9q5o35zgBVvcHi/Zgg0lkKBvK7b2J32sUT6FCKlwCdcJzGa7D+V+pGuxMA zE6kSKtVkHW9duNc1FqyJ60Lu/9CIlwElVnpVBGBT+OIqBdNxTMh0FdCm0wleESuft5u My+y7eO1cRQ8AwYcPBx8XfxrWTdMDZifKPo6YBRX+4oum01zoZcCIL3JnSeC1k0r1svi FVMqQscUX4JRTUtZPdmjP/MJvVHyZf5SeDXZWaXIxDh2RxZ57WrcZIefOhsgq6nyAORt 6ULQ== 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-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=Seh88QffLst90jWENMJL/gTBJR25J7ZTNyB3leZI74M=; b=W5H58sPVW8qJBx6SajyDQnBv3Z1jESFGZxflOErg8uDAgSDmXZ31MglSBZjVx4W8zi JQRkuurHv9/i4IMqFL4M1wD6PoC8oXOEMN2fckOabwevZcPWgFbrHYYCsNHdC2Ft28TH 2VRR/CmIH63U0WcCCqneIoV1hFL9SLlX6krBdqiDQ1RO2bDG7vav2MEwHBezmIXk+jdF +IXRIoIaIQm0wE5RYCfpOHvfHlXTdAVjduACShZbbkZ5mak/HFkTAepQeqcrkm4tP9dQ DGZaz1Pp6sKQgcn5f2KOpLCCyqusP3t4xPQnWLf4Hawee+z518rXeqepCBd5dtPXra5C uhug== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@ffwll.ch header.s=google header.b="ZM3+d5/2"; 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 w4-v6si14169478pfb.52.2018.08.21.10.16.58; Tue, 21 Aug 2018 10:17:14 -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; dkim=fail header.i=@ffwll.ch header.s=google header.b="ZM3+d5/2"; 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 S1726917AbeHUUM0 (ORCPT + 99 others); Tue, 21 Aug 2018 16:12:26 -0400 Received: from mail-ed1-f65.google.com ([209.85.208.65]:43958 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726800AbeHUUM0 (ORCPT ); Tue, 21 Aug 2018 16:12:26 -0400 Received: by mail-ed1-f65.google.com with SMTP id j21-v6so11044640edp.10 for ; Tue, 21 Aug 2018 09:51:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=Seh88QffLst90jWENMJL/gTBJR25J7ZTNyB3leZI74M=; b=ZM3+d5/28VAlppW13o7ILDIEjfkFYZum+Ijj77qai9UMaFTk78pmNV5yjbvrR2+Up3 iBgfKnNZOE6NwPdrT+6duiyQtqzMsw71t6VpkgeSxWJzGGPBYtCu99UxxxbA/tGf4Lt3 GMgGGrs1Sq+jxgrJToU/m9NZBUf7OrquuUt5A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=Seh88QffLst90jWENMJL/gTBJR25J7ZTNyB3leZI74M=; b=BFuLGALZwMWOHDoOr9AY9JaIHRmcKV4OS9lxif9kBDSqZagtBz+c0hMLEklAS6Wmx+ upy0Z7qiSw/k7iv2z4Jyd6fJ2BUFc6FoXyRKk/DbGtm9NtYOamuAiU8EC+IVwdza+M// hFDFRNMY4bVdYRWkTGPuq0rp3IaraTNl4JMBU3dWBhMMniYyZF54xcZ8O8H5AfQVQqZ8 Gs0DAdzU8cMIZLBMdUdaQJBakuURajYBZNW0TuNjBe/1ZoLn2TdG+IzB7lXiV8OddYl2 4GYwwddm3650d7j1oeGWTwOPNV8B9haKwrql1JVwcdbV0T7MkZVOpcQ00yggXR1P4F6+ ss3A== X-Gm-Message-State: AOUpUlG+VdG1QotXcJdGB5lcyN50NASQLxMLK+K1oujKshxPNkpS80xh Wc67vtayAtaiLiwA+tmqGXl3aA== X-Received: by 2002:aa7:d60d:: with SMTP id c13-v6mr61503763edr.301.1534870289910; Tue, 21 Aug 2018 09:51:29 -0700 (PDT) Received: from phenom.ffwll.local (212-51-149-109.fiber7.init7.net. [212.51.149.109]) by smtp.gmail.com with ESMTPSA id x22-v6sm1212201edb.8.2018.08.21.09.51.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 21 Aug 2018 09:51:29 -0700 (PDT) Date: Tue, 21 Aug 2018 18:51:26 +0200 From: Daniel Vetter To: Brian Starkey Cc: dri-devel@lists.freedesktop.org, daniel.vetter@ffwll.ch, airlied@linux.ie, gustavo@padovan.org, maarten.lankhorst@linux.intel.com, seanpaul@chromium.org, corbet@lwn.net, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, alexandru-cosmin.gheorghe@arm.com, liviu.dudau@arm.com, ayan.halder@arm.com Subject: Re: [PATCH] drm/fourcc: Add DOC: overview comment Message-ID: <20180821165126.GL21634@phenom.ffwll.local> Mail-Followup-To: Brian Starkey , dri-devel@lists.freedesktop.org, airlied@linux.ie, gustavo@padovan.org, maarten.lankhorst@linux.intel.com, seanpaul@chromium.org, corbet@lwn.net, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, alexandru-cosmin.gheorghe@arm.com, liviu.dudau@arm.com, ayan.halder@arm.com References: <20180821161611.10424-1-brian.starkey@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180821161611.10424-1-brian.starkey@arm.com> X-Operating-System: Linux phenom 4.14.0-3-amd64 User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 21, 2018 at 05:16:11PM +0100, Brian Starkey wrote: > There's a number of things which haven't previously been documented > around the usage of format modifiers. Capture the current > understanding in an overview comment and add it to the rst > documentation. > > Ideally, the generated documentation would also include documentation > of all of the #defines, but the kernel-doc system doesn't currently > support kernel-doc comments on #define constants. > > Suggested-by: Daniel Vetter > Signed-off-by: Brian Starkey > --- > Documentation/gpu/drm-kms.rst | 6 ++++++ > include/uapi/drm/drm_fourcc.h | 36 ++++++++++++++++++++++++++++++++++++ > 2 files changed, 42 insertions(+) > > diff --git a/Documentation/gpu/drm-kms.rst b/Documentation/gpu/drm-kms.rst > index 1dffd1ac4cd4..1dd9f4824d3b 100644 > --- a/Documentation/gpu/drm-kms.rst > +++ b/Documentation/gpu/drm-kms.rst > @@ -322,6 +322,12 @@ Frame Buffer Functions Reference > DRM Format Handling > =================== > > +.. kernel-doc:: include/uapi/drm/drm_fourcc.h > + :doc: overview > + > +Format Functions Reference > +-------------------------- > + > .. kernel-doc:: include/drm/drm_fourcc.h > :internal: > > diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h > index 894fa2da32fd..3f6c0b499323 100644 > --- a/include/uapi/drm/drm_fourcc.h > +++ b/include/uapi/drm/drm_fourcc.h > @@ -30,6 +30,42 @@ > extern "C" { > #endif > > +/** > + * DOC: overview > + * > + * In the DRM subsystem, framebuffer pixel formats are described using the > + * fourcc codes defined in `include/uapi/drm/drm_fourcc.h`. In addition to the > + * fourcc code, a Format Modifier may optionally be provided, in order to > + * further describe the buffer's format - for example tiling or compression. > + * > + * Format Modifiers > + * ---------------- > + * > + * Format modifiers are used in conjunction with a fourcc code, forming a > + * unique fourcc:modifier pair. This format:modifier pair must fully define the > + * format and data layout of the buffer, and should be the only way to describe > + * that particular buffer. > + * > + * Having multiple fourcc:modifier pairs which describe the same layout should > + * be avoided, as such aliases run the risk of different drivers exposing > + * different names for the same data format, forcing userspace to understand > + * that they are aliases. > + * > + * Format modifiers may change any property of the buffer, including the number > + * of planes and/or the required allocation size. Format modifiers are > + * vendor-namespaced, and as such the relationship between a fourcc code and a > + * modifier is specific to the modifer being used. For example, some modifiers > + * may preserve meaning - such as number of planes - from the fourcc code, > + * whereas others may not. > + * > + * Vendors are encouraged to document their modifier usage in as much detail as I'd go with a slightly stronger "... should document ..." but either way: Reviewed-by: Daniel Vetter I'll leave pushing to one of the arm committers for drm-misc. -Daniel > + * possible, to ensure maximum compatibility across devices, drivers and > + * applications. > + * > + * The authoritative list of format modifier codes is found in > + * `include/uapi/drm/drm_fourcc.h` > + */ > + > #define fourcc_code(a, b, c, d) ((__u32)(a) | ((__u32)(b) << 8) | \ > ((__u32)(c) << 16) | ((__u32)(d) << 24)) > > -- > 2.16.1 > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch