mirror of
https://github.com/torvalds/linux.git
synced 2026-06-06 13:37:36 +02:00
Revert "drm: serialize drm_file.master with a new spinlock"
This reverts commit06a553a99bwhich is commit0b0860a3cfupstream and came into the tree in 5.10.67. The original commit broke the abi and isn't needed for Android systems, so revert it. Fixes:faf816b0f8("Linux 5.10.67") Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: I601e116ea2a590f52fe12f59df5288329318ec1c
This commit is contained in:
parent
49faae8510
commit
5b4909f961
|
|
@ -135,18 +135,16 @@ static void drm_set_master(struct drm_device *dev, struct drm_file *fpriv,
|
||||||
static int drm_new_set_master(struct drm_device *dev, struct drm_file *fpriv)
|
static int drm_new_set_master(struct drm_device *dev, struct drm_file *fpriv)
|
||||||
{
|
{
|
||||||
struct drm_master *old_master;
|
struct drm_master *old_master;
|
||||||
struct drm_master *new_master;
|
|
||||||
|
|
||||||
lockdep_assert_held_once(&dev->master_mutex);
|
lockdep_assert_held_once(&dev->master_mutex);
|
||||||
|
|
||||||
WARN_ON(fpriv->is_master);
|
WARN_ON(fpriv->is_master);
|
||||||
old_master = fpriv->master;
|
old_master = fpriv->master;
|
||||||
new_master = drm_master_create(dev);
|
fpriv->master = drm_master_create(dev);
|
||||||
if (!new_master)
|
if (!fpriv->master) {
|
||||||
|
fpriv->master = old_master;
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
spin_lock(&fpriv->master_lookup_lock);
|
}
|
||||||
fpriv->master = new_master;
|
|
||||||
spin_unlock(&fpriv->master_lookup_lock);
|
|
||||||
|
|
||||||
fpriv->is_master = 1;
|
fpriv->is_master = 1;
|
||||||
fpriv->authenticated = 1;
|
fpriv->authenticated = 1;
|
||||||
|
|
@ -304,13 +302,10 @@ int drm_master_open(struct drm_file *file_priv)
|
||||||
/* if there is no current master make this fd it, but do not create
|
/* if there is no current master make this fd it, but do not create
|
||||||
* any master object for render clients */
|
* any master object for render clients */
|
||||||
mutex_lock(&dev->master_mutex);
|
mutex_lock(&dev->master_mutex);
|
||||||
if (!dev->master) {
|
if (!dev->master)
|
||||||
ret = drm_new_set_master(dev, file_priv);
|
ret = drm_new_set_master(dev, file_priv);
|
||||||
} else {
|
else
|
||||||
spin_lock(&file_priv->master_lookup_lock);
|
|
||||||
file_priv->master = drm_master_get(dev->master);
|
file_priv->master = drm_master_get(dev->master);
|
||||||
spin_unlock(&file_priv->master_lookup_lock);
|
|
||||||
}
|
|
||||||
mutex_unlock(&dev->master_mutex);
|
mutex_unlock(&dev->master_mutex);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
||||||
|
|
@ -177,7 +177,6 @@ struct drm_file *drm_file_alloc(struct drm_minor *minor)
|
||||||
init_waitqueue_head(&file->event_wait);
|
init_waitqueue_head(&file->event_wait);
|
||||||
file->event_space = 4096; /* set aside 4k for event buffer */
|
file->event_space = 4096; /* set aside 4k for event buffer */
|
||||||
|
|
||||||
spin_lock_init(&file->master_lookup_lock);
|
|
||||||
mutex_init(&file->event_read_lock);
|
mutex_init(&file->event_read_lock);
|
||||||
|
|
||||||
if (drm_core_check_feature(dev, DRIVER_GEM))
|
if (drm_core_check_feature(dev, DRIVER_GEM))
|
||||||
|
|
|
||||||
|
|
@ -226,21 +226,15 @@ struct drm_file {
|
||||||
/**
|
/**
|
||||||
* @master:
|
* @master:
|
||||||
*
|
*
|
||||||
* Master this node is currently associated with. Protected by struct
|
* Master this node is currently associated with. Only relevant if
|
||||||
* &drm_device.master_mutex, and serialized by @master_lookup_lock.
|
* drm_is_primary_client() returns true. Note that this only
|
||||||
*
|
* matches &drm_device.master if the master is the currently active one.
|
||||||
* Only relevant if drm_is_primary_client() returns true. Note that
|
|
||||||
* this only matches &drm_device.master if the master is the currently
|
|
||||||
* active one.
|
|
||||||
*
|
*
|
||||||
* See also @authentication and @is_master and the :ref:`section on
|
* See also @authentication and @is_master and the :ref:`section on
|
||||||
* primary nodes and authentication <drm_primary_node>`.
|
* primary nodes and authentication <drm_primary_node>`.
|
||||||
*/
|
*/
|
||||||
struct drm_master *master;
|
struct drm_master *master;
|
||||||
|
|
||||||
/** @master_lock: Serializes @master. */
|
|
||||||
spinlock_t master_lookup_lock;
|
|
||||||
|
|
||||||
/** @pid: Process that opened this file. */
|
/** @pid: Process that opened this file. */
|
||||||
struct pid *pid;
|
struct pid *pid;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user