diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2016-03-30 05:40:52 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2016-04-20 06:58:53 -0400 |
commit | f74418a400c62f382228842fd0ce8a05f9069d8c (patch) | |
tree | 0be631b837de2a008461d8a18072922ecdf69c0a /include/drm | |
parent | 0797ac61810b9b9938516ad9c92701d1639a0867 (diff) |
drm/vma_manage: Drop has_offset
It's racy, creating mmap offsets is a slowpath, so better to remove it
to avoid drivers doing broken things.
The only user is i915, and it's ok there because everything (well
almost) is protected by dev->struct_mutex in i915-gem.
While at it add a note in the create_mmap_offset kerneldoc that
drivers must release it again. And then I also noticed that
drm_gem_object_release entirely lacks kerneldoc.
Cc: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1459330852-27668-14-git-send-email-daniel.vetter@ffwll.ch
Diffstat (limited to 'include/drm')
-rw-r--r-- | include/drm/drm_vma_manager.h | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/include/drm/drm_vma_manager.h b/include/drm/drm_vma_manager.h index 2f63dd5e05eb..06ea8e077ec2 100644 --- a/include/drm/drm_vma_manager.h +++ b/include/drm/drm_vma_manager.h | |||
@@ -176,19 +176,6 @@ static inline unsigned long drm_vma_node_size(struct drm_vma_offset_node *node) | |||
176 | } | 176 | } |
177 | 177 | ||
178 | /** | 178 | /** |
179 | * drm_vma_node_has_offset() - Check whether node is added to offset manager | ||
180 | * @node: Node to be checked | ||
181 | * | ||
182 | * RETURNS: | ||
183 | * true iff the node was previously allocated an offset and added to | ||
184 | * an vma offset manager. | ||
185 | */ | ||
186 | static inline bool drm_vma_node_has_offset(struct drm_vma_offset_node *node) | ||
187 | { | ||
188 | return drm_mm_node_allocated(&node->vm_node); | ||
189 | } | ||
190 | |||
191 | /** | ||
192 | * drm_vma_node_offset_addr() - Return sanitized offset for user-space mmaps | 179 | * drm_vma_node_offset_addr() - Return sanitized offset for user-space mmaps |
193 | * @node: Linked offset node | 180 | * @node: Linked offset node |
194 | * | 181 | * |
@@ -220,7 +207,7 @@ static inline __u64 drm_vma_node_offset_addr(struct drm_vma_offset_node *node) | |||
220 | static inline void drm_vma_node_unmap(struct drm_vma_offset_node *node, | 207 | static inline void drm_vma_node_unmap(struct drm_vma_offset_node *node, |
221 | struct address_space *file_mapping) | 208 | struct address_space *file_mapping) |
222 | { | 209 | { |
223 | if (drm_vma_node_has_offset(node)) | 210 | if (drm_mm_node_allocated(&node->vm_node)) |
224 | unmap_mapping_range(file_mapping, | 211 | unmap_mapping_range(file_mapping, |
225 | drm_vma_node_offset_addr(node), | 212 | drm_vma_node_offset_addr(node), |
226 | drm_vma_node_size(node) << PAGE_SHIFT, 1); | 213 | drm_vma_node_size(node) << PAGE_SHIFT, 1); |