dri_bo *
dri_bo_alloc(dri_bufmgr *bufmgr, const char *name, unsigned long size,
- unsigned int alignment, unsigned int location_mask)
+ unsigned int alignment, uint64_t location_mask)
{
assert((location_mask & ~(DRM_BO_FLAG_MEM_LOCAL | DRM_BO_FLAG_MEM_TT |
DRM_BO_FLAG_MEM_VRAM | DRM_BO_FLAG_MEM_PRIV0 |
dri_bo *
dri_bo_alloc_static(dri_bufmgr *bufmgr, const char *name, unsigned long offset,
unsigned long size, void *virtual,
- unsigned int location_mask)
+ uint64_t location_mask)
{
assert((location_mask & ~(DRM_BO_FLAG_MEM_LOCAL | DRM_BO_FLAG_MEM_TT |
DRM_BO_FLAG_MEM_VRAM | DRM_BO_FLAG_MEM_PRIV0 |
}
-void dri_emit_reloc(dri_bo *batch_buf, GLuint flags, GLuint delta, GLuint offset, dri_bo *relocatee)
+void dri_emit_reloc(dri_bo *reloc_buf, uint64_t flags, GLuint delta,
+ GLuint offset, dri_bo *target_buf)
{
- batch_buf->bufmgr->emit_reloc(batch_buf, flags, delta, offset, relocatee);
+ reloc_buf->bufmgr->emit_reloc(reloc_buf, flags, delta, offset, target_buf);
}
void *dri_process_relocs(dri_bo *batch_buf, GLuint *count)
*/
dri_bo *(*bo_alloc)(dri_bufmgr *bufmgr_ctx, const char *name,
unsigned long size, unsigned int alignment,
- unsigned int location_mask);
+ uint64_t location_mask);
/**
* Allocates a buffer object for a static allocation.
*/
dri_bo *(*bo_alloc_static)(dri_bufmgr *bufmgr_ctx, const char *name,
unsigned long offset, unsigned long size,
- void *virtual, unsigned int location_mask);
+ void *virtual, uint64_t location_mask);
/** Takes a reference on a buffer object */
void (*bo_reference)(dri_bo *bo);
* \param target Buffer whose offset should be written into the relocation
* entry.
*/
- void (*emit_reloc)(dri_bo *reloc_buf, GLuint flags, GLuint delta,
+ void (*emit_reloc)(dri_bo *reloc_buf, uint64_t flags, GLuint delta,
GLuint offset, dri_bo *target);
/**
};
dri_bo *dri_bo_alloc(dri_bufmgr *bufmgr, const char *name, unsigned long size,
- unsigned int alignment, unsigned int location_mask);
+ unsigned int alignment, uint64_t location_mask);
dri_bo *dri_bo_alloc_static(dri_bufmgr *bufmgr, const char *name,
unsigned long offset, unsigned long size,
- void *virtual, unsigned int location_mask);
+ void *virtual, uint64_t location_mask);
void dri_bo_reference(dri_bo *bo);
void dri_bo_unreference(dri_bo *bo);
int dri_bo_map(dri_bo *buf, GLboolean write_enable);
dri_bo *dri_ttm_bo_create_from_handle(dri_bufmgr *bufmgr, const char *name,
unsigned int handle);
-void dri_emit_reloc(dri_bo *batch_buf, GLuint flags, GLuint delta, GLuint offset, dri_bo *relocatee);
+void dri_emit_reloc(dri_bo *reloc_buf, uint64_t flags, GLuint delta,
+ GLuint offset, dri_bo *target_buf);
void *dri_process_relocs(dri_bo *batch_buf, uint32_t *count);
void dri_post_process_relocs(dri_bo *batch_buf);
void dri_post_submit(dri_bo *batch_buf, dri_fence **last_fence);
dri_bo *target_buf;
GLuint offset;
GLuint delta;
- GLuint validate_flags;
+ uint64_t validate_flags;
GLboolean relocated;
};
* DRM_BO_NO_BACKING_STORE and BM_NO_FENCE_SUBDATA, which are the first two
* driver private flags.
*/
- unsigned int flags;
+ uint64_t flags;
unsigned int alignment;
GLboolean is_static, validated;
unsigned int map_count;
static dri_bo *
dri_fake_bo_alloc(dri_bufmgr *bufmgr, const char *name,
unsigned long size, unsigned int alignment,
- unsigned int location_mask)
+ uint64_t location_mask)
{
dri_bufmgr_fake *bufmgr_fake;
dri_bo_fake *bo_fake;
static dri_bo *
dri_fake_bo_alloc_static(dri_bufmgr *bufmgr, const char *name,
unsigned long offset, unsigned long size,
- void *virtual, unsigned int location_mask)
+ void *virtual, uint64_t location_mask)
{
dri_bufmgr_fake *bufmgr_fake;
dri_bo_fake *bo_fake;
}
static int
-dri_fake_bo_validate(dri_bo *bo, unsigned int flags)
+dri_fake_bo_validate(dri_bo *bo, uint64_t flags)
{
dri_bufmgr_fake *bufmgr_fake;
dri_bo_fake *bo_fake = (dri_bo_fake *)bo;
}
static void
-dri_fake_emit_reloc(dri_bo *reloc_buf, GLuint flags, GLuint delta,
+dri_fake_emit_reloc(dri_bo *reloc_buf, uint64_t flags, GLuint delta,
GLuint offset, dri_bo *target_buf)
{
dri_bufmgr_fake *bufmgr_fake = (dri_bufmgr_fake *)reloc_buf->bufmgr;
{
GLuint type;
GLuint reloc;
- GLuint delta; /* not needed? */
+ GLuint delta;
GLuint index;
drm_handle_t handle;
};
drmMMListHead head;
drmBO *buf;
struct drm_i915_op_arg bo_arg;
- unsigned long arg0;
- unsigned long arg1;
+ uint64_t flags;
+ uint64_t mask;
void (*destroy)(void *);
void *priv;
};
prevNext = &arg->next;
req->bo_req.handle = node->buf->handle;
req->op = drm_bo_validate;
- req->bo_req.flags = node->arg0;
+ req->bo_req.flags = node->flags;
req->bo_req.hint = 0;
- req->bo_req.mask = node->arg1;
+ req->bo_req.mask = node->mask;
req->bo_req.fence_class = 0; /* Backwards compat. */
arg->reloc_handle = 0;
static int
intel_add_validate_buffer(struct intel_bo_list *list, dri_bo *buf,
- unsigned flags, unsigned mask,
+ uint64_t flags, uint64_t mask,
int *itemLoc, void (*destroy_cb)(void *))
{
struct intel_bo_node *node, *cur;
}
cur->buf = buf_bo;
cur->priv = buf;
- cur->arg0 = flags;
- cur->arg1 = mask;
+ cur->flags = flags;
+ cur->mask = mask;
cur->destroy = destroy_cb;
ret = 1;
DRMLISTADDTAIL(&cur->head, &list->list);
} else {
- unsigned memMask = (cur->arg1 | mask) & DRM_BO_MASK_MEM;
- unsigned memFlags = cur->arg0 & flags & memMask;
+ uint64_t memMask = (cur->mask | mask) & DRM_BO_MASK_MEM;
+ uint64_t memFlags = cur->flags & flags & memMask;
if (!memFlags) {
return -EINVAL;
}
- if (mask & cur->arg1 & ~DRM_BO_MASK_MEM & (cur->arg0 ^ flags)) {
+ if (mask & cur->mask & ~DRM_BO_MASK_MEM & (cur->flags ^ flags)) {
return -EINVAL;
}
- cur->arg1 |= mask;
- cur->arg0 = memFlags | ((cur->arg0 | flags) &
- cur->arg1 & ~DRM_BO_MASK_MEM);
+ cur->mask |= mask;
+ cur->flags = memFlags | ((cur->flags | flags) &
+ cur->mask & ~DRM_BO_MASK_MEM);
}
*itemLoc = count;
return ret;
return 0;
}
-
static int
intel_add_validate_reloc(int fd, struct intel_bo_list *reloc_list,
struct intel_reloc_info *reloc_info,
static dri_bo *
dri_ttm_alloc(dri_bufmgr *bufmgr, const char *name,
unsigned long size, unsigned int alignment,
- unsigned int location_mask)
+ uint64_t location_mask)
{
dri_bufmgr_ttm *ttm_bufmgr;
dri_bo_ttm *ttm_buf;
static dri_bo *
dri_ttm_alloc_static(dri_bufmgr *bufmgr, const char *name,
unsigned long offset, unsigned long size, void *virtual,
- unsigned int location_mask)
+ uint64_t location_mask)
{
return NULL;
}
}
static void
-dri_ttm_emit_reloc(dri_bo *reloc_buf, GLuint flags, GLuint delta,
+dri_ttm_emit_reloc(dri_bo *reloc_buf, uint64_t flags, GLuint delta,
GLuint offset, dri_bo *target_buf)
{
dri_bo_ttm *ttm_buf = (dri_bo_ttm *)reloc_buf;
intel_add_validate_reloc(bufmgr_ttm->fd, &bufmgr_ttm->reloc_list, &reloc,
bufmgr_ttm->max_relocs);
- return;
}