Commit ee22f763 authored by Dave Airlie's avatar Dave Airlie

drm/legacy: remove some legacy lock struct members

This removes these unless legacy is enabled.

The lock count init is unneeded anyways since it's kzalloc.
Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 83c163f7
...@@ -103,8 +103,7 @@ struct drm_master *drm_master_create(struct drm_device *dev) ...@@ -103,8 +103,7 @@ struct drm_master *drm_master_create(struct drm_device *dev)
return NULL; return NULL;
kref_init(&master->refcount); kref_init(&master->refcount);
spin_lock_init(&master->lock.spinlock); drm_master_legacy_init(master);
init_waitqueue_head(&master->lock.lock_queue);
idr_init(&master->magic_map); idr_init(&master->magic_map);
master->dev = dev; master->dev = dev;
......
...@@ -128,7 +128,6 @@ struct drm_file *drm_file_alloc(struct drm_minor *minor) ...@@ -128,7 +128,6 @@ struct drm_file *drm_file_alloc(struct drm_minor *minor)
/* for compatibility root is always authenticated */ /* for compatibility root is always authenticated */
file->authenticated = capable(CAP_SYS_ADMIN); file->authenticated = capable(CAP_SYS_ADMIN);
file->lock_count = 0;
INIT_LIST_HEAD(&file->lhead); INIT_LIST_HEAD(&file->lhead);
INIT_LIST_HEAD(&file->fbs); INIT_LIST_HEAD(&file->fbs);
......
...@@ -199,4 +199,10 @@ void drm_legacy_lock_master_cleanup(struct drm_device *dev, struct drm_master *m ...@@ -199,4 +199,10 @@ void drm_legacy_lock_master_cleanup(struct drm_device *dev, struct drm_master *m
static inline void drm_legacy_lock_master_cleanup(struct drm_device *dev, struct drm_master *master) {} static inline void drm_legacy_lock_master_cleanup(struct drm_device *dev, struct drm_master *master) {}
#endif #endif
#if IS_ENABLED(CONFIG_DRM_LEGACY)
void drm_master_legacy_init(struct drm_master *master);
#else
static inline void drm_master_legacy_init(struct drm_master *master) {}
#endif
#endif /* __DRM_LEGACY_H__ */ #endif /* __DRM_LEGACY_H__ */
...@@ -74,3 +74,9 @@ void drm_legacy_dev_reinit(struct drm_device *dev) ...@@ -74,3 +74,9 @@ void drm_legacy_dev_reinit(struct drm_device *dev)
DRM_DEBUG("lastclose completed\n"); DRM_DEBUG("lastclose completed\n");
} }
void drm_master_legacy_init(struct drm_master *master)
{
spin_lock_init(&master->lock.spinlock);
init_waitqueue_head(&master->lock.lock_queue);
}
...@@ -50,7 +50,6 @@ struct drm_lock_data { ...@@ -50,7 +50,6 @@ struct drm_lock_data {
* *
* @refcount: Refcount for this master object. * @refcount: Refcount for this master object.
* @dev: Link back to the DRM device * @dev: Link back to the DRM device
* @lock: DRI1 lock information.
* @driver_priv: Pointer to driver-private information. * @driver_priv: Pointer to driver-private information.
* @lessor: Lease holder * @lessor: Lease holder
* @lessee_id: id for lessees. Owners always have id 0 * @lessee_id: id for lessees. Owners always have id 0
...@@ -80,7 +79,6 @@ struct drm_master { ...@@ -80,7 +79,6 @@ struct drm_master {
* &drm_device.master_mutex. * &drm_device.master_mutex.
*/ */
struct idr magic_map; struct idr magic_map;
struct drm_lock_data lock;
void *driver_priv; void *driver_priv;
/* Tree of display resource leases, each of which is a drm_master struct /* Tree of display resource leases, each of which is a drm_master struct
...@@ -95,6 +93,10 @@ struct drm_master { ...@@ -95,6 +93,10 @@ struct drm_master {
struct list_head lessees; struct list_head lessees;
struct idr leases; struct idr leases;
struct idr lessee_idr; struct idr lessee_idr;
/* private: */
#if IS_ENABLED(CONFIG_DRM_LEGACY)
struct drm_lock_data lock;
#endif
}; };
struct drm_master *drm_master_get(struct drm_master *master); struct drm_master *drm_master_get(struct drm_master *master);
......
...@@ -335,7 +335,9 @@ struct drm_file { ...@@ -335,7 +335,9 @@ struct drm_file {
struct drm_prime_file_private prime; struct drm_prime_file_private prime;
/* private: */ /* private: */
#if IS_ENABLED(CONFIG_DRM_LEGACY)
unsigned long lock_count; /* DRI1 legacy lock count */ unsigned long lock_count; /* DRI1 legacy lock count */
#endif
}; };
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment