From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH v3 3/4] drm: Document how to register devices without struct drm_bus Date: Fri, 23 May 2014 00:43:43 +0200 Message-ID: <20140522224343.GO14357@phenom.ffwll.local> References: <1400754084-25707-1-git-send-email-thierry.reding@gmail.com> <1400754084-25707-4-git-send-email-thierry.reding@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-ee0-f42.google.com (mail-ee0-f42.google.com [74.125.83.42]) by gabe.freedesktop.org (Postfix) with ESMTP id BE3456E4A9 for ; Thu, 22 May 2014 15:43:47 -0700 (PDT) Received: by mail-ee0-f42.google.com with SMTP id d49so3129009eek.29 for ; Thu, 22 May 2014 15:43:46 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1400754084-25707-4-git-send-email-thierry.reding@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Thierry Reding Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On Thu, May 22, 2014 at 12:21:23PM +0200, Thierry Reding wrote: > 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 > -- > 1.9.2 > -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch