void dri_bo_get_subdata(dri_bo *bo, unsigned long offset,
unsigned long size, void *data);
-dri_bufmgr *dri_bufmgr_ttm_init(int fd, unsigned int fence_type,
- unsigned int fence_type_flush);
-
void dri_bufmgr_fake_contended_lock_take(dri_bufmgr *bufmgr);
dri_bufmgr *dri_bufmgr_fake_init(unsigned long low_offset, void *low_virtual,
unsigned long size,
void *ptr),
void *ptr);
void dri_bufmgr_destroy(dri_bufmgr *bufmgr);
-dri_bo *dri_ttm_bo_create_from_handle(dri_bufmgr *bufmgr, const char *name,
- unsigned int handle);
void dri_emit_reloc(dri_bo *reloc_buf, uint64_t flags, GLuint delta,
GLuint offset, dri_bo *target_buf);
*/
#include <xf86drm.h>
+#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <unistd.h>
-#include "glthread.h"
+#include <assert.h>
+
#include "errno.h"
#include "mtypes.h"
#include "dri_bufmgr.h"
#define DBG(...) do { \
if (bufmgr_ttm->bufmgr.debug) \
- _mesa_printf(__VA_ARGS__); \
+ fprintf(stderr, __VA_ARGS__); \
} while (0)
/*
bufmgr_ttm->validate_array[reloc_entry[2]].bo;
dri_bo_ttm *target_ttm = (dri_bo_ttm *)target_bo;
- DBG("%2d: %s@0x%08x -> %s@0x%08x + 0x%08x\n",
+ DBG("%2d: %s@0x%08x -> %s@0x%08lx + 0x%08x\n",
i,
bo_ttm->name, reloc_entry[0],
target_ttm->name, target_bo->offset,
ttm_buf->delayed_unmap = GL_FALSE;
ttm_buf->validate_index = -1;
- DBG("bo_create: %p (%s) %db\n", &ttm_buf->bo, ttm_buf->name, size);
+ DBG("bo_create: %p (%s) %ldb\n", &ttm_buf->bo, ttm_buf->name, size);
return &ttm_buf->bo;
}
ret = drmFenceWait(bufmgr_ttm->fd, DRM_FENCE_FLAG_WAIT_LAZY, &fence_ttm->drm_fence, 0);
if (ret != 0) {
- _mesa_printf("%s:%d: Error %d waiting for fence %s.\n",
- __FILE__, __LINE__, ret, fence_ttm->name);
+ fprintf(stderr, "%s:%d: Error %d waiting for fence %s.\n",
+ __FILE__, __LINE__, ret, fence_ttm->name);
abort();
}
for (i = 0; i < nr_relocs; i++) {
struct dri_ttm_reloc *r = &bo_ttm->relocs[i];
- dri_bo_ttm *target_ttm = (dri_bo_ttm *)r->target_buf;
- uint32_t *reloc_entry;
/* Continue walking the tree depth-first. */
dri_ttm_bo_process_reloc(r->target_buf);
}
/* Update the buffer offset */
if (rep->bo_info.offset != bo->offset) {
- DBG("BO %s migrated: 0x%08x -> 0x%08x\n",
- bo_ttm->name, bo->offset, rep->bo_info.offset);
+ DBG("BO %s migrated: 0x%08lx -> 0x%08lx\n",
+ bo_ttm->name, bo->offset, (unsigned long)rep->bo_info.offset);
bo->offset = rep->bo_info.offset;
}
}