OpenGL requires this.
Reviewed-by: Christian König <christian.koenig@amd.com>
struct drm_radeon_gem_mmap args = {0};
void *ptr;
+ /* If the buffer is created from user memory, return the user pointer. */
+ if (bo->user_ptr)
+ return bo->user_ptr;
+
/* Return the pointer if it's already mapped. */
if (bo->ptr)
return bo->ptr;
bo->base.vtbl = &radeon_bo_vtbl;
bo->mgr = mgr;
bo->rws = mgr->rws;
+ bo->user_ptr = pointer;
bo->va = 0;
bo->initial_domain = RADEON_DOMAIN_GTT;
pipe_mutex_init(bo->map_mutex);
struct radeon_bomgr *mgr;
struct radeon_drm_winsys *rws;
+ void *user_ptr; /* from buffer_from_ptr */
void *ptr;
pipe_mutex map_mutex;
unsigned *stride);
/**
- * Get a winsys buffer from a user pointer. The resulting buffer can't be
- * mapped or exported. Both pointer and size must be page aligned.
+ * Get a winsys buffer from a user pointer. The resulting buffer can't
+ * be exported. Both pointer and size must be page aligned.
*
* \param ws The winsys this function is called from.
* \param pointer User pointer to turn into a buffer object.