From ae8edc7544e566084f7b958eb93c9109b471ca30 Mon Sep 17 00:00:00 2001 From: Tvrtko Ursulin Date: Thu, 19 Jun 2014 15:52:03 +0100 Subject: intel: Add support for userptr objects Allow userptr objects to be created and used via libdrm_intel. At the moment tiling and mapping to GTT aperture is not supported due hardware limitations across different generations and uncertainty about its usefulness. v2: Improved error handling in feature detection per review comments. v3: Rebase on top of the drm_public addition, minor whitespace addition. Reviewed-by: Damien Lespiau Signed-off-by: Damien Lespiau (v3) Signed-off-by: Tvrtko Ursulin (v1,v2) --- intel/intel_bufmgr_priv.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'intel/intel_bufmgr_priv.h') diff --git a/intel/intel_bufmgr_priv.h b/intel/intel_bufmgr_priv.h index 2592d42d..59ebd186 100644 --- a/intel/intel_bufmgr_priv.h +++ b/intel/intel_bufmgr_priv.h @@ -61,6 +61,18 @@ struct _drm_intel_bufmgr { unsigned long size, unsigned int alignment); + /** + * Allocate a buffer object from an existing user accessible + * address malloc'd with the provided size. + * Alignment is used when mapping to the gtt. + * Flags may be I915_VMAP_READ_ONLY or I915_USERPTR_UNSYNCHRONIZED + */ + drm_intel_bo *(*bo_alloc_userptr)(drm_intel_bufmgr *bufmgr, + const char *name, void *addr, + uint32_t tiling_mode, uint32_t stride, + unsigned long size, + unsigned long flags); + /** * Allocate a tiled buffer object. * -- cgit v1.2.3