Lines Matching defs:node
69 * node, you must call drm_vma_node_allow(). Otherwise, an mmap() call on this
70 * open-file with the offset of the node will fail with -EACCES. To revoke
86 * against concurrent access. However, node allocation and destruction is left
87 * for the caller. While calling into the vma-manager, a given node must
116 * drm_vma_offset_lookup_locked() - Find node in offset space
121 * Find a node given a start address and object size. This returns the _best_
122 * match for the given node. That is, @start may point somewhere into a valid
123 * region and the given node will be returned, as long as the node spans the
135 * node = drm_vma_offset_lookup_locked(mgr);
136 * if (node)
137 * kref_get_unless_zero(container_of(node, sth, entr));
141 * Returns NULL if no suitable node can be found. Otherwise, the best match
142 * is returned. It's the caller's responsibility to make sure the node doesn't
149 struct drm_mm_node *node, *best;
157 node = rb_entry(iter, struct drm_mm_node, rb);
158 offset = node->start;
161 best = node;
169 /* verify that the node spans the requested area */
184 * drm_vma_offset_add() - Add offset node to manager
186 * @node: Node to be added
189 * Add a node to the offset-manager. If the node was already added, this does
192 * After this call succeeds, you can access the offset of the node until it
207 struct drm_vma_offset_node *node, unsigned long pages)
213 if (!drm_mm_node_allocated(&node->vm_node))
215 &node->vm_node, pages);
224 * drm_vma_offset_remove() - Remove offset node from manager
226 * @node: Node to be removed
228 * Remove a node from the offset manager. If the node wasn't added before, this
235 struct drm_vma_offset_node *node)
239 if (drm_mm_node_allocated(&node->vm_node)) {
240 drm_mm_remove_node(&node->vm_node);
241 memset(&node->vm_node, 0, sizeof(node->vm_node));
250 * @node: Node to modify
253 * Add @tag to the list of allowed open-files for this node. If @tag is
257 * drm_vma_offset_remove() calls. You may even call it if the node is currently
261 * before destroying the node. Otherwise, you will leak memory.
268 int drm_vma_node_allow(struct drm_vma_offset_node *node, struct drm_file *tag)
276 * unlikely that an open-file is added twice to a single node so we
281 write_lock(&node->vm_lock);
283 iter = &node->vm_files.rb_node;
307 rb_insert_color(&new->vm_rb, &node->vm_files);
311 write_unlock(&node->vm_lock);
319 * @node: Node to modify
322 * Decrement the ref-count of @tag in the list of allowed open-files on @node.
330 void drm_vma_node_revoke(struct drm_vma_offset_node *node,
336 write_lock(&node->vm_lock);
338 iter = node->vm_files.rb_node;
343 rb_erase(&entry->vm_rb, &node->vm_files);
354 write_unlock(&node->vm_lock);
360 * @node: Node to check
363 * Search the list in @node whether @tag is currently on the list of allowed
371 bool drm_vma_node_is_allowed(struct drm_vma_offset_node *node,
377 read_lock(&node->vm_lock);
379 iter = node->vm_files.rb_node;
390 read_unlock(&node->vm_lock);