diff options
author | Eric Anholt <eric@anholt.net> | 2007-07-05 11:36:44 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2007-07-05 11:36:44 -0700 |
commit | 3cf20ddbfc9d3a1dad4c058050595c54589257d3 (patch) | |
tree | 57de53410bb0fb40979eed20d3c80d4c0ed68664 /src/mesa/drivers/dri/common/dri_bufmgr_ttm.c | |
parent | 2ac17c68e2d64260168a54a275e839775828f534 (diff) | |
parent | 4fe48b4e8568896cdbc822323aeec0a41c72ff2a (diff) |
Merge branch 'i915-unification' of git+ssh://people.freedesktop.org/~anholt/mesa into i915-unification
Diffstat (limited to 'src/mesa/drivers/dri/common/dri_bufmgr_ttm.c')
-rw-r--r-- | src/mesa/drivers/dri/common/dri_bufmgr_ttm.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/common/dri_bufmgr_ttm.c b/src/mesa/drivers/dri/common/dri_bufmgr_ttm.c index 64248a1d87..fd432ba3f7 100644 --- a/src/mesa/drivers/dri/common/dri_bufmgr_ttm.c +++ b/src/mesa/drivers/dri/common/dri_bufmgr_ttm.c @@ -150,7 +150,7 @@ dri_ttm_alloc_static(dri_bufmgr *bufmgr, const char *name, * pass all of the allocation class flags. */ flags = location_mask | DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE | - DRM_BO_FLAG_EXE | DRM_BO_FLAG_NO_EVICT | DRM_BO_FLAG_NO_MOVE; + DRM_BO_FLAG_EXE | DRM_BO_FLAG_NO_MOVE; /* No hints we want to use. */ hint = 0; @@ -362,6 +362,7 @@ dri_bufmgr_ttm_init(int fd, unsigned int fence_type, unsigned int fence_type_flush) { dri_bufmgr_ttm *bufmgr_ttm; + dri_bo *test_alloc; bufmgr_ttm = malloc(sizeof(*bufmgr_ttm)); bufmgr_ttm->fd = fd; @@ -381,5 +382,17 @@ dri_bufmgr_ttm_init(int fd, unsigned int fence_type, bufmgr_ttm->bufmgr.fence_unreference = dri_ttm_fence_unreference; bufmgr_ttm->bufmgr.fence_wait = dri_ttm_fence_wait; + /* Attempt an allocation to make sure that the DRM was actually set up for + * TTM. + */ + test_alloc = dri_bo_alloc((dri_bufmgr *)bufmgr_ttm, "test allocation", + 4096, 4096, DRM_BO_FLAG_MEM_LOCAL | DRM_BO_FLAG_MEM_TT); + if (test_alloc == NULL) { + _glthread_DESTROY_MUTEX(bufmgr_ttm->mutex); + free(bufmgr_ttm); + return NULL; + } + dri_bo_unreference(test_alloc); + return &bufmgr_ttm->bufmgr; } |