aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2014-08-29 06:12:30 -0400
committerDave Airlie <airlied@redhat.com>2014-09-10 03:39:50 -0400
commit71d39483de474d9513e23d9e21af7483684f4745 (patch)
tree8fef51a2ace8d9f7971f53b2e50a996c7a0f37b0
parent03decbe57ac6c9e632f7cde0f7d0a54bbcaf8464 (diff)
drm: move "struct drm_magic_entry" to drm_auth.c
In drm_release(), we currently call drm_remove_magic() if the drm_file has a drm-magic attached. Therefore, once drm_master_release() is called, the magic-list _must_ be empty. By dropping the no-op cleanup, we can move "struct drm_magic_entry" to drm_auth.c and avoid exposing it to all of DRM. Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Reviewed-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--drivers/gpu/drm/drm_auth.c6
-rw-r--r--drivers/gpu/drm/drm_drv.c7
-rw-r--r--include/drm/drmP.h6
3 files changed, 6 insertions, 13 deletions
diff --git a/drivers/gpu/drm/drm_auth.c b/drivers/gpu/drm/drm_auth.c
index 3cedae12b3c1..708a2044c631 100644
--- a/drivers/gpu/drm/drm_auth.c
+++ b/drivers/gpu/drm/drm_auth.c
@@ -35,6 +35,12 @@
35 35
36#include <drm/drmP.h> 36#include <drm/drmP.h>
37 37
38struct drm_magic_entry {
39 struct list_head head;
40 struct drm_hash_item hash_item;
41 struct drm_file *priv;
42};
43
38/** 44/**
39 * Find the file with the given magic number. 45 * Find the file with the given magic number.
40 * 46 *
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index b1587e2e10fc..66456698447e 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -133,7 +133,6 @@ EXPORT_SYMBOL(drm_master_get);
133static void drm_master_destroy(struct kref *kref) 133static void drm_master_destroy(struct kref *kref)
134{ 134{
135 struct drm_master *master = container_of(kref, struct drm_master, refcount); 135 struct drm_master *master = container_of(kref, struct drm_master, refcount);
136 struct drm_magic_entry *pt, *next;
137 struct drm_device *dev = master->minor->dev; 136 struct drm_device *dev = master->minor->dev;
138 struct drm_map_list *r_list, *list_temp; 137 struct drm_map_list *r_list, *list_temp;
139 138
@@ -154,12 +153,6 @@ static void drm_master_destroy(struct kref *kref)
154 master->unique_len = 0; 153 master->unique_len = 0;
155 } 154 }
156 155
157 list_for_each_entry_safe(pt, next, &master->magicfree, head) {
158 list_del(&pt->head);
159 drm_ht_remove_item(&master->magiclist, &pt->hash_item);
160 kfree(pt);
161 }
162
163 drm_ht_remove(&master->magiclist); 156 drm_ht_remove(&master->magiclist);
164 157
165 mutex_unlock(&dev->struct_mutex); 158 mutex_unlock(&dev->struct_mutex);
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 11c357534581..0fdd813821cd 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -290,12 +290,6 @@ struct drm_ioctl_desc {
290#define DRM_IOCTL_DEF_DRV(ioctl, _func, _flags) \ 290#define DRM_IOCTL_DEF_DRV(ioctl, _func, _flags) \
291 [DRM_IOCTL_NR(DRM_##ioctl)] = {.cmd = DRM_##ioctl, .func = _func, .flags = _flags, .cmd_drv = DRM_IOCTL_##ioctl, .name = #ioctl} 291 [DRM_IOCTL_NR(DRM_##ioctl)] = {.cmd = DRM_##ioctl, .func = _func, .flags = _flags, .cmd_drv = DRM_IOCTL_##ioctl, .name = #ioctl}
292 292
293struct drm_magic_entry {
294 struct list_head head;
295 struct drm_hash_item hash_item;
296 struct drm_file *priv;
297};
298
299/** 293/**
300 * DMA buffer. 294 * DMA buffer.
301 */ 295 */