}
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;
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;
}
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);
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;
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)
* struct drm_master - drm master structure
*
* @refcount: Refcount for this master object.
- * @minor: Link back to minor char device we are master for. Immutable.
+ * @dev: Link back to the DRM device
* @unique: Unique identifier: e.g. busid. Protected by drm_global_mutex.
* @unique_len: Length of unique field. Protected by drm_global_mutex.
* @magic_map: Map of used authentication tokens. Protected by struct_mutex.
* @lock: DRI lock information.
* @driver_priv: Pointer to driver-private information.
+ *
+ * Note that master structures are only relevant for the legacy/primary device
+ * nodes, hence there can only be one per device, not one per drm_minor.
*/
struct drm_master {
struct kref refcount;
- struct drm_minor *minor;
+ struct drm_device *dev;
char *unique;
int unique_len;
struct idr magic_map;