From patchwork Tue Dec 8 08:49:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 7795701 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D51CCBEEE1 for ; Tue, 8 Dec 2015 08:49:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DCF5F204B0 for ; Tue, 8 Dec 2015 08:49:37 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id B6544204B5 for ; Tue, 8 Dec 2015 08:49:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1CFCA6E4BF; Tue, 8 Dec 2015 00:49:33 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-f46.google.com (mail-wm0-f46.google.com [74.125.82.46]) by gabe.freedesktop.org (Postfix) with ESMTPS id 26D186E4B4 for ; Tue, 8 Dec 2015 00:49:32 -0800 (PST) Received: by wmec201 with SMTP id c201so202131623wme.0 for ; Tue, 08 Dec 2015 00:49:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id; bh=GJilXbVimR+vEP02bB2AnTLp2qxoZNuWoaP3QanRbHY=; b=FfCv0fcjWnSrOMv9p9WfEMchjVlMuv0zSZFk/+CfLerfjhKuVxX5Xfabw1xBFZuqu3 HzFp8ZT6e/CqeUSID0QP691W7EC0sg29xmBPwVo4qwSrRrFBpfc8Kmk/vfXhlgwnGbGw sMAEENYW0re9iSf89kHoJl7LKf2kd3qPBFbXI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=GJilXbVimR+vEP02bB2AnTLp2qxoZNuWoaP3QanRbHY=; b=Op/1kqeDlPPvOkZYcXg29kh6iBwoYqmUwqMvWj50wDTEjdIiWixF04oyQmNzsLhywl 0OGj3Czb29TN3tEyl5ccBzQjcY0TJCbvQor34upz91oAryAHfGOsbapt0tHIcrITGM+Q 3uy7pkiiuYMekNPCkjBQWbeIGbNwYefT7juPZUFGEKS4DU/VmDc4BTNgLQO0Y5K5orei iHnb6sKgIdXIm3j1a7ApUrs0Zu8uA30OPWWPCKkqmptBZ4BMm383dOwwd0k9qO/rG5mH Si0eZoYHATJsx1vvCoNLw3FdDA5SRBc22kZbNZh51mwDg7olQ8Nn7AVo3kBANC3xe5Mh qmRw== X-Gm-Message-State: ALoCoQnB8IbMoCEdZn13uwvpZ+lCkL5kj13yIe2PB64Vi6KJJJ9Z4yH6tOjIMeuAehc6CMkAclX0MNrO6eCGi95PrgT93PKh+A== X-Received: by 10.194.11.70 with SMTP id o6mr2796145wjb.64.1449564569338; Tue, 08 Dec 2015 00:49:29 -0800 (PST) Received: from phenom.ffwll.local (212-51-149-109.fiber7.init7.net. [212.51.149.109]) by smtp.gmail.com with ESMTPSA id e83sm2393423wmc.23.2015.12.08.00.49.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 08 Dec 2015 00:49:28 -0800 (PST) From: Daniel Vetter To: DRI Development Subject: [PATCH 1/5] [RFC] drm: Documentation style guide Date: Tue, 8 Dec 2015 09:49:17 +0100 Message-Id: <1449564561-3896-1-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.5.1 Cc: Daniel Vetter , Intel Graphics Development , Daniel Vetter X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Every time I type or review docs this seems a bit different. Try to document the common style so we can try to unify at least new docs. Signed-off-by: Daniel Vetter Acked-by: Laurent Pinchart --- Documentation/DocBook/gpu.tmpl | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/Documentation/DocBook/gpu.tmpl b/Documentation/DocBook/gpu.tmpl index 86e5b12a49ba..5698c93dae8b 100644 --- a/Documentation/DocBook/gpu.tmpl +++ b/Documentation/DocBook/gpu.tmpl @@ -124,6 +124,43 @@ [Insert diagram of typical DRM stack here] + + Style Guidelines + + For consistency these documentations use American English. Abbreviations + are written as all-uppercase, for example: DRM, KMS, IOCTL, CRTC, and so + on. To aid in reading documentations make full use of the markup + characters kerneldoc provides: @parameter for function paramters, @member + for structure members, &structure to refernce structures and + function() for functions. These all get automatically hyperlinked if + kerneldoc for the referencec objects exists When referencing entries in + function vtables please use -<vfunc(). Note that with kerneldoc does + not support referncing struct members directly, so please add a reference + to the vtable struct somewhere in the same paragraph or at least section. + + + Except in special situations (to separate locked from unlocked variants) + locking requirements for functions aren't documented in the kerneldoc. + Instead locking should be check at runtime using e.g. + WARN_ON(!mutex_is_locked(...));. Since it's much easier to + ignore documentation than runtime noise this provides more value. And on + top of that runtime checks do need to be updated when the locking rules + change, increasing the changes that they're correct. Within the + documentation the locking rules should be explained in the relevant + structures: Either in the comment for the lock explaining what it + protects, or data fields need a note about which lock protects them, or + both. + + + Functions which have a non-void return value should have a + section called "Returns" explaining the expected return values in + different cases an their meanings. Currently there's no consensus whether + that section name should be all upper-case or not, and whether it should + end in a colon or not. Go with the file-local style. Other common section + names are "Notes" with information for dangerous or tricky corner cases, + and "FIXME" where the interface could be cleaned up. + +