All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
Cc: daniel.vetter@intel.com, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 5/6] drm: Document deprecated load/unload hook
Date: Fri, 30 Dec 2016 12:43:13 +0100	[thread overview]
Message-ID: <20161230114313.GA8712@dvetter-linux.ger.corp.intel.com> (raw)
In-Reply-To: <20161228143216.26821-6-krisman@collabora.co.uk>

On Wed, Dec 28, 2016 at 12:32:15PM -0200, Gabriel Krisman Bertazi wrote:
> Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
> ---
>  include/drm/drm_drv.h | 30 ++++++++++++++++++++++++++++++
>  1 file changed, 30 insertions(+)
> 
> diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h
> index c4fc49583dc0..0c8e4e979870 100644
> --- a/include/drm/drm_drv.h
> +++ b/include/drm/drm_drv.h
> @@ -64,12 +64,42 @@ struct drm_mode_create_dumb;
>   * structure for GEM drivers.
>   */
>  struct drm_driver {
> +
> +	/**
> +	 * @load:
> +	 *
> +	 * Backward-compatible driver callback to complete
> +	 * initialization steps after the driver is registered.  For
> +	 * this reason, may suffer from race conditions and its use is
> +	 * dicouraged for new drivers.  It is therefore only supported

s/discouraged/deprecated/ ... need some stronger wording here.

> +	 * for existing drivers not yet converted to the new scheme.

I think a link to the new scheme would be good, maybe:

"See drm_dev_init() and drm_dev_register() for proper and race-free way to
set up a &drm_device."

Unload is also deprecated, so similar comments apply for that.
-Daniel

> +	 *
> +	 * Returns:
> +	 * Zero on success, non-zero value on failure.
> +	 */
>  	int (*load) (struct drm_device *, unsigned long flags);
>  	int (*firstopen) (struct drm_device *);
>  	int (*open) (struct drm_device *, struct drm_file *);
>  	void (*preclose) (struct drm_device *, struct drm_file *file_priv);
>  	void (*postclose) (struct drm_device *, struct drm_file *);
>  	void (*lastclose) (struct drm_device *);
> +
> +	/**
> +	 * @unload:
> +	 *
> +	 * Reverse the effects of the driver load callback.  Ideally,
> +	 * the clean up performed by the driver should happen in the
> +	 * reverse order of the initialization.  Similarly to the load
> +	 * hook, this handler is deprecated and its usage should be
> +	 * dropped in favor of an open-coded teardown function at the
> +	 * driver layer.
> +	 *
> +	 * The unload() hook is called immediately after unregistering
> +	 * the device.
> +	 *
> +	 * Returns:
> +	 * The return value is ignored.
> +	 */
>  	int (*unload) (struct drm_device *);
>  	int (*dma_ioctl) (struct drm_device *dev, void *data, struct drm_file *file_priv);
>  	int (*dma_quiescent) (struct drm_device *);
> -- 
> 2.11.0
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2016-12-30 11:43 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-28 14:32 [PATCH 0/6] drm documentation and clean ups Gabriel Krisman Bertazi
2016-12-28 14:32 ` [PATCH 1/6] drm: Deduplicate driver initialization message Gabriel Krisman Bertazi
2016-12-30 11:38   ` Daniel Vetter
2017-05-17 10:06     ` Jani Nikula
2017-05-17 11:41       ` Daniel Vetter
2017-05-17 11:51         ` Jani Nikula
2016-12-28 14:32 ` [PATCH 2/6] exynos_drm: Clean up duplicated assignment in exynos_drm_driver Gabriel Krisman Bertazi
2017-06-19 11:03   ` Andrzej Hajda
2017-06-21  4:58     ` Inki Dae
2016-12-28 14:32 ` [PATCH 3/6] drm: Drop unused forward declaration of drm_version Gabriel Krisman Bertazi
2016-12-28 14:32 ` [PATCH 4/6] drm: Export drm_ioctl_permit to kernel-doc Gabriel Krisman Bertazi
2016-12-28 14:32 ` [PATCH 5/6] drm: Document deprecated load/unload hook Gabriel Krisman Bertazi
2016-12-30 11:43   ` Daniel Vetter [this message]
2016-12-28 14:32 ` [PATCH 6/6] drm: Update TTM initialization documentation Gabriel Krisman Bertazi
2016-12-30 11:49   ` Daniel Vetter
2016-12-30 11:53   ` Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161230114313.GA8712@dvetter-linux.ger.corp.intel.com \
    --to=daniel@ffwll.ch \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=krisman@collabora.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.