summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_drv.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2017-10-06 11:10:25 +1000
committerDave Airlie <airlied@redhat.com>2017-10-06 11:10:25 +1000
commit15438ab06515b093d61e2f35bb27d21e5e7f966e (patch)
tree4ec9e341fd470735640423a83e5e6268a6482347 /drivers/gpu/drm/drm_drv.c
parentebec44a2456fbe5fe18aae88f6010f6878f0cb4a (diff)
parent5b9fbfff7644f2d3f42a6c105587b86e29ca9c48 (diff)
downloadop-kernel-dev-15438ab06515b093d61e2f35bb27d21e5e7f966e.zip
op-kernel-dev-15438ab06515b093d61e2f35bb27d21e5e7f966e.tar.gz
Merge tag 'drm-misc-next-2017-10-05' of git://anongit.freedesktop.org/git/drm-misc into drm-next
More drm-misc for 4.15: Cross-subsystem Changes: - bunch more simple outreachy patches (Meghana Madhyastha, Aishwarya Pant, Haneen Mohammed) - Quite a pile of static checker/cocci/spelling fixups all over. - Final driver patches+core cleanup of Noralf's new drm_gem_fb_create helper. Core Changes: - legacy DPMS docs improved - add dri-devel m-l to fbdev to catch people who try to fix fbcon-on-kms bugs in the wrong place Driver Changes: - vc4: prep for dsi panels (Eric) * tag 'drm-misc-next-2017-10-05' of git://anongit.freedesktop.org/git/drm-misc: (34 commits) drm: fix typo in drm_gem_get_pages() comment MAINTAINERS: Add dri-devel as a mailing list for anything fbdev drm/virtio: Replace instances of reference/unreference with get/put drm/fb-cma-helper: Remove unused functions drm/tve200: Use drm_gem_fb_create() and drm_gem_fb_prepare_fb() drm/sun4i: Use drm_gem_fb_create() drm/shmobile: Use drm_gem_fb_create() drm/rcar-du: Use drm_gem_fb_create() drm/mxsfb: Use drm_gem_fb_create() and drm_gem_fb_prepare_fb() drm/meson: Use drm_gem_fb_create() drm/hisilicon/kirin: Use drm_gem_fb_create() drm/fsl-dcu: Use drm_gem_fb_create() drm/tinydrm: Use drm_gem_framebuffer_helper drm: of: always initialize panel in drm_of_find_panel_or_bridge() drm/tve200: Check for IS_ERR instead of NULL in probe drm/tve200: make two functions static drm/armada: Remove unused #include <drmP.h> drm/rockchip: Rely on the default best_encoder() behavior drm/vc4: Set up the DSI host at pdev probe time, not component bind. drm/vc4: Avoid using vrefresh==0 mode in DSI htotal math. ...
Diffstat (limited to 'drivers/gpu/drm/drm_drv.c')
-rw-r--r--drivers/gpu/drm/drm_drv.c51
1 files changed, 32 insertions, 19 deletions
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index be38ac7..c0292e5 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -286,13 +286,13 @@ struct drm_minor *drm_minor_acquire(unsigned int minor_id)
spin_lock_irqsave(&drm_minor_lock, flags);
minor = idr_find(&drm_minors_idr, minor_id);
if (minor)
- drm_dev_ref(minor->dev);
+ drm_dev_get(minor->dev);
spin_unlock_irqrestore(&drm_minor_lock, flags);
if (!minor) {
return ERR_PTR(-ENODEV);
} else if (drm_dev_is_unplugged(minor->dev)) {
- drm_dev_unref(minor->dev);
+ drm_dev_put(minor->dev);
return ERR_PTR(-ENODEV);
}
@@ -301,7 +301,7 @@ struct drm_minor *drm_minor_acquire(unsigned int minor_id)
void drm_minor_release(struct drm_minor *minor)
{
- drm_dev_unref(minor->dev);
+ drm_dev_put(minor->dev);
}
/**
@@ -326,11 +326,11 @@ void drm_minor_release(struct drm_minor *minor)
* When cleaning up a device instance everything needs to be done in reverse:
* First unpublish the device instance with drm_dev_unregister(). Then clean up
* any other resources allocated at device initialization and drop the driver's
- * reference to &drm_device using drm_dev_unref().
+ * reference to &drm_device using drm_dev_put().
*
* Note that the lifetime rules for &drm_device instance has still a lot of
* historical baggage. Hence use the reference counting provided by
- * drm_dev_ref() and drm_dev_unref() only carefully.
+ * drm_dev_get() and drm_dev_put() only carefully.
*
* It is recommended that drivers embed &struct drm_device into their own device
* structure, which is supported through drm_dev_init().
@@ -345,7 +345,7 @@ void drm_minor_release(struct drm_minor *minor)
* Cleans up all DRM device, calling drm_lastclose().
*
* Note: Use of this function is deprecated. It will eventually go away
- * completely. Please use drm_dev_unregister() and drm_dev_unref() explicitly
+ * completely. Please use drm_dev_unregister() and drm_dev_put() explicitly
* instead to make sure that the device isn't userspace accessible any more
* while teardown is in progress, ensuring that userspace can't access an
* inconsistent state.
@@ -360,7 +360,7 @@ void drm_put_dev(struct drm_device *dev)
}
drm_dev_unregister(dev);
- drm_dev_unref(dev);
+ drm_dev_put(dev);
}
EXPORT_SYMBOL(drm_put_dev);
@@ -386,7 +386,7 @@ void drm_dev_unplug(struct drm_device *dev)
mutex_lock(&drm_global_mutex);
drm_device_set_unplugged(dev);
if (dev->open_count == 0)
- drm_dev_unref(dev);
+ drm_dev_put(dev);
mutex_unlock(&drm_global_mutex);
}
EXPORT_SYMBOL(drm_dev_unplug);
@@ -475,8 +475,8 @@ static void drm_fs_inode_free(struct inode *inode)
* initialization sequence to make sure userspace can't access an inconsistent
* state.
*
- * The initial ref-count of the object is 1. Use drm_dev_ref() and
- * drm_dev_unref() to take and drop further ref-counts.
+ * The initial ref-count of the object is 1. Use drm_dev_get() and
+ * drm_dev_put() to take and drop further ref-counts.
*
* Note that for purely virtual devices @parent can be NULL.
*
@@ -626,8 +626,8 @@ EXPORT_SYMBOL(drm_dev_fini);
* initialization sequence to make sure userspace can't access an inconsistent
* state.
*
- * The initial ref-count of the object is 1. Use drm_dev_ref() and
- * drm_dev_unref() to take and drop further ref-counts.
+ * The initial ref-count of the object is 1. Use drm_dev_get() and
+ * drm_dev_put() to take and drop further ref-counts.
*
* Note that for purely virtual devices @parent can be NULL.
*
@@ -670,36 +670,49 @@ static void drm_dev_release(struct kref *ref)
}
/**
- * drm_dev_ref - Take reference of a DRM device
+ * drm_dev_get - Take reference of a DRM device
* @dev: device to take reference of or NULL
*
* This increases the ref-count of @dev by one. You *must* already own a
- * reference when calling this. Use drm_dev_unref() to drop this reference
+ * reference when calling this. Use drm_dev_put() to drop this reference
* again.
*
* This function never fails. However, this function does not provide *any*
* guarantee whether the device is alive or running. It only provides a
* reference to the object and the memory associated with it.
*/
-void drm_dev_ref(struct drm_device *dev)
+void drm_dev_get(struct drm_device *dev)
{
if (dev)
kref_get(&dev->ref);
}
-EXPORT_SYMBOL(drm_dev_ref);
+EXPORT_SYMBOL(drm_dev_get);
/**
- * drm_dev_unref - Drop reference of a DRM device
+ * drm_dev_put - Drop reference of a DRM device
* @dev: device to drop reference of or NULL
*
* This decreases the ref-count of @dev by one. The device is destroyed if the
* ref-count drops to zero.
*/
-void drm_dev_unref(struct drm_device *dev)
+void drm_dev_put(struct drm_device *dev)
{
if (dev)
kref_put(&dev->ref, drm_dev_release);
}
+EXPORT_SYMBOL(drm_dev_put);
+
+/**
+ * drm_dev_unref - Drop reference of a DRM device
+ * @dev: device to drop reference of or NULL
+ *
+ * This is a compatibility alias for drm_dev_put() and should not be used by new
+ * code.
+ */
+void drm_dev_unref(struct drm_device *dev)
+{
+ drm_dev_put(dev);
+}
EXPORT_SYMBOL(drm_dev_unref);
static int create_compat_control_link(struct drm_device *dev)
@@ -839,7 +852,7 @@ EXPORT_SYMBOL(drm_dev_register);
*
* Unregister the DRM device from the system. This does the reverse of
* drm_dev_register() but does not deallocate the device. The caller must call
- * drm_dev_unref() to drop their final reference.
+ * drm_dev_put() to drop their final reference.
*
* A special form of unregistering for hotpluggable devices is drm_dev_unplug(),
* which can be called while there are still open users of @dev.
OpenPOWER on IntegriCloud