diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2016-06-14 21:50:58 +0300 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2016-06-16 11:16:58 +0300 |
commit | 34a839c689b093dac6bccc4e0aa6feffcf4c970e (patch) | |
tree | 4a6a6414c47a98daae69d218c100a6a8a846d736 /drivers/gpu | |
parent | 1a75a222f5ca1063249b5c92972d32dcc3c8966e (diff) | |
download | linux-34a839c689b093dac6bccc4e0aa6feffcf4c970e.tar.xz |
drm: Link directly from drm_master to drm_device
Master-based auth only exists for the legacy/primary drm_minor, hence
there can only be one per device. The goal here is to untangle the
epic dereference games of minor->master and master->minor which is
just massively confusing.
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1465930269-7883-4-git-send-email-daniel.vetter@ffwll.ch
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/drm_drv.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_fops.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_internal.h | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 8b2582aeaab6..3c01a16bbb77 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -93,7 +93,7 @@ void drm_ut_debug_printk(const char *function_name, const char *format, ...) } EXPORT_SYMBOL(drm_ut_debug_printk); -struct drm_master *drm_master_create(struct drm_minor *minor) +struct drm_master *drm_master_create(struct drm_device *dev) { struct drm_master *master; @@ -105,7 +105,7 @@ struct drm_master *drm_master_create(struct drm_minor *minor) spin_lock_init(&master->lock.spinlock); init_waitqueue_head(&master->lock.lock_queue); idr_init(&master->magic_map); - master->minor = minor; + master->dev = dev; return master; } @@ -120,7 +120,7 @@ EXPORT_SYMBOL(drm_master_get); static void drm_master_destroy(struct kref *kref) { struct drm_master *master = container_of(kref, struct drm_master, refcount); - struct drm_device *dev = master->minor->dev; + struct drm_device *dev = master->dev; if (dev->driver->master_destroy) dev->driver->master_destroy(dev, master); diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c index 2fd4f42b907a..bfbf1381f55d 100644 --- a/drivers/gpu/drm/drm_fops.c +++ b/drivers/gpu/drm/drm_fops.c @@ -185,7 +185,7 @@ int drm_new_set_master(struct drm_device *dev, struct drm_file *fpriv) lockdep_assert_held_once(&dev->master_mutex); /* create a new master */ - fpriv->minor->master = drm_master_create(fpriv->minor); + fpriv->minor->master = drm_master_create(fpriv->minor->dev); if (!fpriv->minor->master) return -ENOMEM; diff --git a/drivers/gpu/drm/drm_internal.h b/drivers/gpu/drm/drm_internal.h index 56a9b1cf99d7..f5c1d17fa51f 100644 --- a/drivers/gpu/drm/drm_internal.h +++ b/drivers/gpu/drm/drm_internal.h @@ -92,7 +92,7 @@ int drm_setmaster_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv); int drm_dropmaster_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv); -struct drm_master *drm_master_create(struct drm_minor *minor); +struct drm_master *drm_master_create(struct drm_device *dev); /* drm_debugfs.c */ #if defined(CONFIG_DEBUG_FS) |