/** * i915_gem_object_lookup_rcu - look up a temporary GEM object from its handle * @file: DRM file private date * @handle: userspace handle * * Returns: * A pointer to the object named by the handle if such exists on @filp, NULL * otherwise. This object is only valid whilst under the RCU read lock, and * note carefully the object may be in the process of being destroyed.
*/ staticinlinestruct drm_i915_gem_object *
i915_gem_object_lookup_rcu(struct drm_file *file, u32 handle)
{ #ifdef CONFIG_LOCKDEP
WARN_ON(debug_locks && !lock_is_held(&rcu_lock_map)); #endif return idr_find(&file->object_idr, handle);
}
/* * If more than one potential simultaneous locker, assert held.
*/ staticinlinevoid assert_object_held_shared(conststruct drm_i915_gem_object *obj)
{ /* * Note mm list lookup is protected by * kref_get_unless_zero().
*/ if (IS_ENABLED(CONFIG_LOCKDEP) &&
kref_read(&obj->base.refcount) > 0)
assert_object_held(obj);
}
int i915_gem_object_set_tiling(struct drm_i915_gem_object *obj, unsignedint tiling, unsignedint stride);
/** * __i915_gem_object_page_iter_get_sg - helper to find the target scatterlist * pointer and the target page position using pgoff_t n input argument and * i915_gem_object_page_iter * @obj: i915 GEM buffer object * @iter: i915 GEM buffer object page iterator * @n: page offset * @offset: searched physical offset, * it will be used for returning physical page offset value * * Context: Takes and releases the mutex lock of the i915_gem_object_page_iter. * Takes and releases the RCU lock to search the radix_tree of * i915_gem_object_page_iter. * * Returns: * The target scatterlist pointer and the target page position. * * Recommended to use wrapper macro: i915_gem_object_page_iter_get_sg()
*/ struct scatterlist *
__i915_gem_object_page_iter_get_sg(struct drm_i915_gem_object *obj, struct i915_gem_object_page_iter *iter,
pgoff_t n, unsignedint *offset);
/** * i915_gem_object_page_iter_get_sg - wrapper macro for * __i915_gem_object_page_iter_get_sg() * @obj: i915 GEM buffer object * @it: i915 GEM buffer object page iterator * @n: page offset * @offset: searched physical offset, * it will be used for returning physical page offset value * * Context: Takes and releases the mutex lock of the i915_gem_object_page_iter. * Takes and releases the RCU lock to search the radix_tree of * i915_gem_object_page_iter. * * Returns: * The target scatterlist pointer and the target page position. * * In order to avoid the truncation of the input parameter, it checks the page * offset n's type from the input parameter before calling * __i915_gem_object_page_iter_get_sg().
*/ #define i915_gem_object_page_iter_get_sg(obj, it, n, offset) ({ \
static_assert(castable_to_type(n, pgoff_t)); \
__i915_gem_object_page_iter_get_sg(obj, it, n, offset); \
})
/** * __i915_gem_object_get_sg - helper to find the target scatterlist * pointer and the target page position using pgoff_t n input argument and * drm_i915_gem_object. It uses an internal shmem scatterlist lookup function. * @obj: i915 GEM buffer object * @n: page offset * @offset: searched physical offset, * it will be used for returning physical page offset value * * It uses drm_i915_gem_object's internal shmem scatterlist lookup function as * i915_gem_object_page_iter and calls __i915_gem_object_page_iter_get_sg(). * * Returns: * The target scatterlist pointer and the target page position. * * Recommended to use wrapper macro: i915_gem_object_get_sg() * See also __i915_gem_object_page_iter_get_sg()
*/ staticinlinestruct scatterlist *
__i915_gem_object_get_sg(struct drm_i915_gem_object *obj, pgoff_t n, unsignedint *offset)
{ return __i915_gem_object_page_iter_get_sg(obj, &obj->mm.get_page, n, offset);
}
/** * i915_gem_object_get_sg - wrapper macro for __i915_gem_object_get_sg() * @obj: i915 GEM buffer object * @n: page offset * @offset: searched physical offset, * it will be used for returning physical page offset value * * Returns: * The target scatterlist pointer and the target page position. * * In order to avoid the truncation of the input parameter, it checks the page * offset n's type from the input parameter before calling * __i915_gem_object_get_sg(). * See also __i915_gem_object_page_iter_get_sg()
*/ #define i915_gem_object_get_sg(obj, n, offset) ({ \
static_assert(castable_to_type(n, pgoff_t)); \
__i915_gem_object_get_sg(obj, n, offset); \
})
/** * __i915_gem_object_get_sg_dma - helper to find the target scatterlist * pointer and the target page position using pgoff_t n input argument and * drm_i915_gem_object. It uses an internal DMA mapped scatterlist lookup function * @obj: i915 GEM buffer object * @n: page offset * @offset: searched physical offset, * it will be used for returning physical page offset value * * It uses drm_i915_gem_object's internal DMA mapped scatterlist lookup function * as i915_gem_object_page_iter and calls __i915_gem_object_page_iter_get_sg(). * * Returns: * The target scatterlist pointer and the target page position. * * Recommended to use wrapper macro: i915_gem_object_get_sg_dma() * See also __i915_gem_object_page_iter_get_sg()
*/ staticinlinestruct scatterlist *
__i915_gem_object_get_sg_dma(struct drm_i915_gem_object *obj, pgoff_t n, unsignedint *offset)
{ return __i915_gem_object_page_iter_get_sg(obj, &obj->mm.get_dma_page, n, offset);
}
/** * i915_gem_object_get_sg_dma - wrapper macro for __i915_gem_object_get_sg_dma() * @obj: i915 GEM buffer object * @n: page offset * @offset: searched physical offset, * it will be used for returning physical page offset value * * Returns: * The target scatterlist pointer and the target page position. * * In order to avoid the truncation of the input parameter, it checks the page * offset n's type from the input parameter before calling * __i915_gem_object_get_sg_dma(). * See also __i915_gem_object_page_iter_get_sg()
*/ #define i915_gem_object_get_sg_dma(obj, n, offset) ({ \
static_assert(castable_to_type(n, pgoff_t)); \
__i915_gem_object_get_sg_dma(obj, n, offset); \
})
/** * __i915_gem_object_get_page - helper to find the target page with a page offset * @obj: i915 GEM buffer object * @n: page offset * * It uses drm_i915_gem_object's internal shmem scatterlist lookup function as * i915_gem_object_page_iter and calls __i915_gem_object_page_iter_get_sg() * internally. * * Returns: * The target page pointer. * * Recommended to use wrapper macro: i915_gem_object_get_page() * See also __i915_gem_object_page_iter_get_sg()
*/ struct page *
__i915_gem_object_get_page(struct drm_i915_gem_object *obj, pgoff_t n);
/** * i915_gem_object_get_page - wrapper macro for __i915_gem_object_get_page * @obj: i915 GEM buffer object * @n: page offset * * Returns: * The target page pointer. * * In order to avoid the truncation of the input parameter, it checks the page * offset n's type from the input parameter before calling * __i915_gem_object_get_page(). * See also __i915_gem_object_page_iter_get_sg()
*/ #define i915_gem_object_get_page(obj, n) ({ \
static_assert(castable_to_type(n, pgoff_t)); \
__i915_gem_object_get_page(obj, n); \
})
/** * __i915_gem_object_get_dirty_page - helper to find the target page with a page * offset * @obj: i915 GEM buffer object * @n: page offset * * It works like i915_gem_object_get_page(), but it marks the returned page dirty. * * Returns: * The target page pointer. * * Recommended to use wrapper macro: i915_gem_object_get_dirty_page() * See also __i915_gem_object_page_iter_get_sg() and __i915_gem_object_get_page()
*/ struct page *
__i915_gem_object_get_dirty_page(struct drm_i915_gem_object *obj, pgoff_t n);
/** * i915_gem_object_get_dirty_page - wrapper macro for __i915_gem_object_get_dirty_page * @obj: i915 GEM buffer object * @n: page offset * * Returns: * The target page pointer. * * In order to avoid the truncation of the input parameter, it checks the page * offset n's type from the input parameter before calling * __i915_gem_object_get_dirty_page(). * See also __i915_gem_object_page_iter_get_sg() and __i915_gem_object_get_page()
*/ #define i915_gem_object_get_dirty_page(obj, n) ({ \
static_assert(castable_to_type(n, pgoff_t)); \
__i915_gem_object_get_dirty_page(obj, n); \
})
/** * __i915_gem_object_get_dma_address_len - helper to get bus addresses of * targeted DMA mapped scatterlist from i915 GEM buffer object and it's length * @obj: i915 GEM buffer object * @n: page offset * @len: DMA mapped scatterlist's DMA bus addresses length to return * * Returns: * Bus addresses of targeted DMA mapped scatterlist * * Recommended to use wrapper macro: i915_gem_object_get_dma_address_len() * See also __i915_gem_object_page_iter_get_sg() and __i915_gem_object_get_sg_dma()
*/
dma_addr_t
__i915_gem_object_get_dma_address_len(struct drm_i915_gem_object *obj, pgoff_t n, unsignedint *len);
/** * i915_gem_object_get_dma_address_len - wrapper macro for * __i915_gem_object_get_dma_address_len * @obj: i915 GEM buffer object * @n: page offset * @len: DMA mapped scatterlist's DMA bus addresses length to return * * Returns: * Bus addresses of targeted DMA mapped scatterlist * * In order to avoid the truncation of the input parameter, it checks the page * offset n's type from the input parameter before calling * __i915_gem_object_get_dma_address_len(). * See also __i915_gem_object_page_iter_get_sg() and * __i915_gem_object_get_dma_address_len()
*/ #define i915_gem_object_get_dma_address_len(obj, n, len) ({ \
static_assert(castable_to_type(n, pgoff_t)); \
__i915_gem_object_get_dma_address_len(obj, n, len); \
})
/** * __i915_gem_object_get_dma_address - helper to get bus addresses of * targeted DMA mapped scatterlist from i915 GEM buffer object * @obj: i915 GEM buffer object * @n: page offset * * Returns: * Bus addresses of targeted DMA mapped scatterlis * * Recommended to use wrapper macro: i915_gem_object_get_dma_address() * See also __i915_gem_object_page_iter_get_sg() and __i915_gem_object_get_sg_dma()
*/
dma_addr_t
__i915_gem_object_get_dma_address(struct drm_i915_gem_object *obj, pgoff_t n);
/** * i915_gem_object_get_dma_address - wrapper macro for * __i915_gem_object_get_dma_address * @obj: i915 GEM buffer object * @n: page offset * * Returns: * Bus addresses of targeted DMA mapped scatterlist * * In order to avoid the truncation of the input parameter, it checks the page * offset n's type from the input parameter before calling * __i915_gem_object_get_dma_address(). * See also __i915_gem_object_page_iter_get_sg() and * __i915_gem_object_get_dma_address()
*/ #define i915_gem_object_get_dma_address(obj, n) ({ \
static_assert(castable_to_type(n, pgoff_t)); \
__i915_gem_object_get_dma_address(obj, n); \
})
/** * i915_gem_object_pin_map - return a contiguous mapping of the entire object * @obj: the object to map into kernel address space * @type: the type of mapping, used to select pgprot_t * * Calls i915_gem_object_pin_pages() to prevent reaping of the object's * pages and then returns a contiguous mapping of the backing storage into * the kernel address space. Based on the @type of mapping, the PTE will be * set to either WriteBack or WriteCombine (via pgprot_t). * * The caller is responsible for calling i915_gem_object_unpin_map() when the * mapping is no longer required. * * Returns the pointer through which to access the mapped object, or an * ERR_PTR() on error.
*/ void *__must_check i915_gem_object_pin_map(struct drm_i915_gem_object *obj, enum i915_map_type type);
/** * i915_gem_object_unpin_map - releases an earlier mapping * @obj: the object to unmap * * After pinning the object and mapping its pages, once you are finished * with your access, call i915_gem_object_unpin_map() to release the pin * upon the mapping. Once the pin count reaches zero, that mapping may be * removed.
*/ staticinlinevoid i915_gem_object_unpin_map(struct drm_i915_gem_object *obj)
{
i915_gem_object_unpin_pages(obj);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.