aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabriel Krisman Bertazi <krisman@collabora.co.uk>2017-01-02 09:20:08 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2017-01-04 03:55:57 -0500
commit569265002782503d40fb32a45a950f2ac42af353 (patch)
tree301602aca46c2c45078f5bef0d24cb88f75c5215
parenta5ad0fd8524e5144512a5c25eda5a5d6fd55fda8 (diff)
drm: Document deprecated load/unload hook
v2: - Replace discouraged with deprecated - Link to new initialization/teardown functions Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20170102142008.22174-3-krisman@collabora.co.uk
-rw-r--r--include/drm/drm_drv.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h
index c4fc49583dc0..9c2d9f0bb043 100644
--- a/include/drm/drm_drv.h
+++ b/include/drm/drm_drv.h
@@ -64,12 +64,47 @@ struct drm_mode_create_dumb;
64 * structure for GEM drivers. 64 * structure for GEM drivers.
65 */ 65 */
66struct drm_driver { 66struct drm_driver {
67
68 /**
69 * @load:
70 *
71 * Backward-compatible driver callback to complete
72 * initialization steps after the driver is registered. For
73 * this reason, may suffer from race conditions and its use is
74 * deprecated for new drivers. It is therefore only supported
75 * for existing drivers not yet converted to the new scheme.
76 * See drm_dev_init() and drm_dev_register() for proper and
77 * race-free way to set up a &struct drm_device.
78 *
79 * Returns:
80 *
81 * Zero on success, non-zero value on failure.
82 */
67 int (*load) (struct drm_device *, unsigned long flags); 83 int (*load) (struct drm_device *, unsigned long flags);
68 int (*firstopen) (struct drm_device *); 84 int (*firstopen) (struct drm_device *);
69 int (*open) (struct drm_device *, struct drm_file *); 85 int (*open) (struct drm_device *, struct drm_file *);
70 void (*preclose) (struct drm_device *, struct drm_file *file_priv); 86 void (*preclose) (struct drm_device *, struct drm_file *file_priv);
71 void (*postclose) (struct drm_device *, struct drm_file *); 87 void (*postclose) (struct drm_device *, struct drm_file *);
72 void (*lastclose) (struct drm_device *); 88 void (*lastclose) (struct drm_device *);
89
90 /**
91 * @unload:
92 *
93 * Reverse the effects of the driver load callback. Ideally,
94 * the clean up performed by the driver should happen in the
95 * reverse order of the initialization. Similarly to the load
96 * hook, this handler is deprecated and its usage should be
97 * dropped in favor of an open-coded teardown function at the
98 * driver layer. See drm_dev_unregister() and drm_dev_unref()
99 * for the proper way to remove a &struct drm_device.
100 *
101 * The unload() hook is called right after unregistering
102 * the device.
103 *
104 * Returns:
105 *
106 * The return value is ignored.
107 */
73 int (*unload) (struct drm_device *); 108 int (*unload) (struct drm_device *);
74 int (*dma_ioctl) (struct drm_device *dev, void *data, struct drm_file *file_priv); 109 int (*dma_ioctl) (struct drm_device *dev, void *data, struct drm_file *file_priv);
75 int (*dma_quiescent) (struct drm_device *); 110 int (*dma_quiescent) (struct drm_device *);