Commit fd2450a7 authored by Lucas Stach's avatar Lucas Stach

drm/etnaviv: clean up etnaviv_gem_new_handle

Setting the GFP flags does not need a new code block if moved to
the right location, which makes this function a bit easier to read.
Signed-off-by: default avatarLucas Stach <l.stach@pengutronix.de>
Reviewed-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: default avatarChristian Gmeiner <christian.gmeiner@gmail.com>
parent 1262cc88
...@@ -628,23 +628,17 @@ int etnaviv_gem_new_handle(struct drm_device *dev, struct drm_file *file, ...@@ -628,23 +628,17 @@ int etnaviv_gem_new_handle(struct drm_device *dev, struct drm_file *file,
lockdep_set_class(&to_etnaviv_bo(obj)->lock, &etnaviv_shm_lock_class); lockdep_set_class(&to_etnaviv_bo(obj)->lock, &etnaviv_shm_lock_class);
ret = drm_gem_object_init(dev, obj, size); ret = drm_gem_object_init(dev, obj, size);
if (ret == 0) { if (ret)
struct address_space *mapping; goto fail;
/* /*
* Our buffers are kept pinned, so allocating them * Our buffers are kept pinned, so allocating them from the MOVABLE
* from the MOVABLE zone is a really bad idea, and * zone is a really bad idea, and conflicts with CMA. See comments
* conflicts with CMA. See comments above new_inode() * above new_inode() why this is required _and_ expected if you're
* why this is required _and_ expected if you're
* going to pin these pages. * going to pin these pages.
*/ */
mapping = obj->filp->f_mapping; mapping_set_gfp_mask(obj->filp->f_mapping, GFP_HIGHUSER |
mapping_set_gfp_mask(mapping, GFP_HIGHUSER |
__GFP_RETRY_MAYFAIL | __GFP_NOWARN); __GFP_RETRY_MAYFAIL | __GFP_NOWARN);
}
if (ret)
goto fail;
etnaviv_gem_obj_add(dev, obj); etnaviv_gem_obj_add(dev, obj);
......
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