mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-26 16:41:25 +00:00
drm/cirrus: Don't grab dev->struct_mutex for in mmap offset ioctl
Since David Herrmann's mmap vma manager rework we don't need to grab dev->struct_mutex any more to prevent races when looking up the mmap offset. Drop it and instead don't forget to use the unref_unlocked variant (since the drm core still cares). Reviewed-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
This commit is contained in:
parent
bf89209a6d
commit
6cc56234fe
1 changed files with 4 additions and 11 deletions
|
@ -293,25 +293,18 @@ cirrus_dumb_mmap_offset(struct drm_file *file,
|
||||||
uint64_t *offset)
|
uint64_t *offset)
|
||||||
{
|
{
|
||||||
struct drm_gem_object *obj;
|
struct drm_gem_object *obj;
|
||||||
int ret;
|
|
||||||
struct cirrus_bo *bo;
|
struct cirrus_bo *bo;
|
||||||
|
|
||||||
mutex_lock(&dev->struct_mutex);
|
|
||||||
obj = drm_gem_object_lookup(dev, file, handle);
|
obj = drm_gem_object_lookup(dev, file, handle);
|
||||||
if (obj == NULL) {
|
if (obj == NULL)
|
||||||
ret = -ENOENT;
|
return -ENOENT;
|
||||||
goto out_unlock;
|
|
||||||
}
|
|
||||||
|
|
||||||
bo = gem_to_cirrus_bo(obj);
|
bo = gem_to_cirrus_bo(obj);
|
||||||
*offset = cirrus_bo_mmap_offset(bo);
|
*offset = cirrus_bo_mmap_offset(bo);
|
||||||
|
|
||||||
drm_gem_object_unreference(obj);
|
drm_gem_object_unreference_unlocked(obj);
|
||||||
ret = 0;
|
|
||||||
out_unlock:
|
|
||||||
mutex_unlock(&dev->struct_mutex);
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cirrus_check_framebuffer(struct cirrus_device *cdev, int width, int height,
|
bool cirrus_check_framebuffer(struct cirrus_device *cdev, int width, int height,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue