From patchwork Thu May 22 10:21:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 4221451 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id EC4C89F50F for ; Thu, 22 May 2014 10:23:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 12750202E6 for ; Thu, 22 May 2014 10:23:54 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 2821F2026C for ; Thu, 22 May 2014 10:23:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 83D646EBA0; Thu, 22 May 2014 03:23:52 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ee0-f45.google.com (mail-ee0-f45.google.com [74.125.83.45]) by gabe.freedesktop.org (Postfix) with ESMTP id 9C6976E3E9 for ; Thu, 22 May 2014 03:23:49 -0700 (PDT) Received: by mail-ee0-f45.google.com with SMTP id d49so2465691eek.4 for ; Thu, 22 May 2014 03:23:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=rhhgd0LVoU6jwpriifIhRWuX/nKCuujR1ppJRZq8Ppg=; b=yIAUFoNfFs66Ne+zmGvK590VrErCFhN94ISanjDfeg+NYccOQli4CVSyLPrBtUtTcF T2sUgfrTmY8vqOHjaCRN8osP3Z/EM6HMMSq8A+IYbbvWMlZpDMA5eQxF2dDaPWr3CKol JtE/Sh3jBqW37zc1ftEzBRm8CrAJ7OUD1PL2TgZ4r2N6brjR4yWngA7AJ5l4QMkGPvHg /8kUvS8DgvTm86ZoyxV2XiJu+OtBy8Pu3OrO0+IhP5hO6Z7GqApd1HcfCV2vmnMxbLU8 hK8WyYdimPabjBiAOcAWrgU3HiX74WC+msiLpiWEuGqv7m8VaOjBShlNxdZPBrXl2/4Z s1ow== X-Received: by 10.15.51.70 with SMTP id m46mr12610355eew.30.1400754228908; Thu, 22 May 2014 03:23:48 -0700 (PDT) Received: from localhost (port-1914.pppoe.wtnet.de. [84.46.7.129]) by mx.google.com with ESMTPSA id w48sm18695107eel.9.2014.05.22.03.23.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 May 2014 03:23:48 -0700 (PDT) From: Thierry Reding To: dri-devel@lists.freedesktop.org Subject: [PATCH v3 3/4] drm: Document how to register devices without struct drm_bus Date: Thu, 22 May 2014 12:21:23 +0200 Message-Id: <1400754084-25707-4-git-send-email-thierry.reding@gmail.com> X-Mailer: git-send-email 1.9.2 In-Reply-To: <1400754084-25707-1-git-send-email-thierry.reding@gmail.com> References: <1400754084-25707-1-git-send-email-thierry.reding@gmail.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 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.7 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 From: Thierry Reding With the recent addition of the drm_set_unique() function, devices can now be registered without requiring a drm_bus. Add a brief description to the DRM docbook to show how that can be achieved. Signed-off-by: Thierry Reding Reviewed-by: Daniel Vetter --- Changes in v3: - replace drm_dev_put() recommendation by explicit drm_dev_unregister() followed by drm_dev_unref() - use !E in DocBook to insert kernel-doc for all exported symbols Documentation/DocBook/drm.tmpl | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/Documentation/DocBook/drm.tmpl b/Documentation/DocBook/drm.tmpl index 438edcd566b5..09f8788fec3f 100644 --- a/Documentation/DocBook/drm.tmpl +++ b/Documentation/DocBook/drm.tmpl @@ -142,6 +142,12 @@ to register it with the DRM subsystem. + Newer drivers that no longer require a drm_bus + structure can alternatively use the low-level device initialization and + registration functions such as drm_dev_alloc() and + drm_dev_register() directly. + + The drm_driver structure contains static information that describes the driver and features it supports, and pointers to methods that the DRM core will call to implement the DRM API. @@ -290,6 +296,26 @@ char *date; !Edrivers/gpu/drm/drm_pci.c !Edrivers/gpu/drm/drm_usb.c !Edrivers/gpu/drm/drm_platform.c + + New drivers that no longer rely on the services provided by the + drm_bus structure can call the low-level + device registration functions directly. The + drm_dev_alloc() function can be used to allocate + and initialize a new drm_device structure. + Drivers will typically want to perform some additional setup on this + structure, such as allocating driver-specific data and storing a + pointer to it in the DRM device's dev_private + field. Drivers should also set the device's unique name using the + drm_dev_set_unique() function. After it has been + set up a device can be registered with the DRM subsystem by calling + drm_dev_register(). This will cause the device to + be exposed to userspace and will call the driver's + .load() implementation. When a device is + removed, the DRM device can safely be unregistered and freed by calling + drm_dev_unregister() followed by a call to + drm_dev_unref(). + +!Edrivers/gpu/drm/drm_stub.c Driver Load