aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/udl
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2014-05-25 06:59:47 -0400
committerDavid Herrmann <dh.herrmann@gmail.com>2014-07-07 18:29:53 -0400
commit0cdbe8ac696b5399327f972a1c91263c1a44f1d9 (patch)
tree7ba5705585c5de981a11e41935cd66ad88ce285c /drivers/gpu/drm/udl
parentab5a60c3ee41ff22304e2bcf63c151aa2851df0c (diff)
drm/gem: remove misleading gfp parameter to get_pages()
drm_gem_get_pages() currently allows passing a 'gfp' parameter that is passed to shmem combined with mapping_gfp_mask(). Given that the default mapping_gfp_mask() is GFP_HIGHUSER, it is _very_ unlikely that anyone will ever make use of that parameter. In fact, all drivers currently pass redundant flags or 0. This patch removes the 'gfp' parameter. The only reason to keep it is to remove flags like __GFP_WAIT. But in its current form, it can only be used to add flags. So to remove __GFP_WAIT, you'd have to drop it from the mapping_gfp_mask, which again is stupid as this mask is used by shmem-core for other allocations, too. If any driver ever requires that parameter, we can introduce a new helper that takes the raw 'gfp' parameter. The caller'd be responsible to combine it with mapping_gfp_mask() in a suitable way. The current drm_gem_get_pages() helper would then simply use mapping_gfp_mask() and call the new helper. This is what shmem_read_mapping_pages{_gfp,} does right now. Moreover, the gfp-zone flag-usage is not obvious: If you pass a modified zone, shmem core will WARN() or even BUG(). In other words, the following must be true for 'gfp' passed to shmem_read_mapping_pages_gfp(): gfp_zone(mapping_gfp_mask(mapping)) == gfp_zone(gfp) Add a comment to drm_gem_read_pages() explaining that constraint. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/udl')
-rw-r--r--drivers/gpu/drm/udl/udl_gem.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gpu/drm/udl/udl_gem.c b/drivers/gpu/drm/udl/udl_gem.c
index c041cd73f399..8044f5fb7c49 100644
--- a/drivers/gpu/drm/udl/udl_gem.c
+++ b/drivers/gpu/drm/udl/udl_gem.c
@@ -107,14 +107,14 @@ int udl_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
107 } 107 }
108} 108}
109 109
110static int udl_gem_get_pages(struct udl_gem_object *obj, gfp_t gfpmask) 110static int udl_gem_get_pages(struct udl_gem_object *obj)
111{ 111{
112 struct page **pages; 112 struct page **pages;
113 113
114 if (obj->pages) 114 if (obj->pages)
115 return 0; 115 return 0;
116 116
117 pages = drm_gem_get_pages(&obj->base, gfpmask); 117 pages = drm_gem_get_pages(&obj->base);
118 if (IS_ERR(pages)) 118 if (IS_ERR(pages))
119 return PTR_ERR(pages); 119 return PTR_ERR(pages);
120 120
@@ -147,7 +147,7 @@ int udl_gem_vmap(struct udl_gem_object *obj)
147 return 0; 147 return 0;
148 } 148 }
149 149
150 ret = udl_gem_get_pages(obj, GFP_KERNEL); 150 ret = udl_gem_get_pages(obj);
151 if (ret) 151 if (ret)
152 return ret; 152 return ret;
153 153
@@ -205,7 +205,7 @@ int udl_gem_mmap(struct drm_file *file, struct drm_device *dev,
205 } 205 }
206 gobj = to_udl_bo(obj); 206 gobj = to_udl_bo(obj);
207 207
208 ret = udl_gem_get_pages(gobj, GFP_KERNEL); 208 ret = udl_gem_get_pages(gobj);
209 if (ret) 209 if (ret)
210 goto out; 210 goto out;
211 ret = drm_gem_create_mmap_offset(obj); 211 ret = drm_gem_create_mmap_offset(obj);