mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 21:38:32 +08:00
drm/prime: Unconditionally set up the prime file private
It's tiny, already embedded, and setup/teardown cost is trivial. Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190614203615.12639-5-daniel.vetter@ffwll.ch
This commit is contained in:
parent
805dc614d5
commit
ae75f83680
@ -147,7 +147,6 @@ struct drm_file *drm_file_alloc(struct drm_minor *minor)
|
||||
if (drm_core_check_feature(dev, DRIVER_SYNCOBJ))
|
||||
drm_syncobj_open(file);
|
||||
|
||||
if (drm_core_check_feature(dev, DRIVER_PRIME))
|
||||
drm_prime_init_file_private(&file->prime);
|
||||
|
||||
if (dev->driver->open) {
|
||||
@ -159,7 +158,6 @@ struct drm_file *drm_file_alloc(struct drm_minor *minor)
|
||||
return file;
|
||||
|
||||
out_prime_destroy:
|
||||
if (drm_core_check_feature(dev, DRIVER_PRIME))
|
||||
drm_prime_destroy_file_private(&file->prime);
|
||||
if (drm_core_check_feature(dev, DRIVER_SYNCOBJ))
|
||||
drm_syncobj_release(file);
|
||||
@ -253,7 +251,6 @@ void drm_file_free(struct drm_file *file)
|
||||
if (dev->driver->postclose)
|
||||
dev->driver->postclose(dev, file);
|
||||
|
||||
if (drm_core_check_feature(dev, DRIVER_PRIME))
|
||||
drm_prime_destroy_file_private(&file->prime);
|
||||
|
||||
WARN_ON(!list_empty(&file->event_list));
|
||||
|
@ -254,7 +254,6 @@ drm_gem_object_release_handle(int id, void *ptr, void *data)
|
||||
else if (dev->driver->gem_close_object)
|
||||
dev->driver->gem_close_object(obj, file_priv);
|
||||
|
||||
if (drm_core_check_feature(dev, DRIVER_PRIME))
|
||||
drm_gem_remove_prime_handles(obj, file_priv);
|
||||
drm_vma_node_revoke(&obj->vma_node, file_priv);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user