diff options
author | Eric Anholt <[email protected]> | 2007-07-06 12:01:33 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2007-07-06 12:01:33 -0700 |
commit | d086f7ab2e38fc2b5398aed6823453ae53e5dcb8 (patch) | |
tree | c79503359cb74d309f21c10516548a41b022191e /src/mesa/drivers/dri/common | |
parent | f7643b96e9e526a7610dec51650546e4b916ccd2 (diff) |
bufmgr_ttm: hook up destroy function, track buffer names.
Diffstat (limited to 'src/mesa/drivers/dri/common')
-rw-r--r-- | src/mesa/drivers/dri/common/dri_bufmgr_ttm.c | 6 |
1 files changed, 5 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 fd432ba3f72..4c3624382c7 100644 --- a/src/mesa/drivers/dri/common/dri_bufmgr_ttm.c +++ b/src/mesa/drivers/dri/common/dri_bufmgr_ttm.c @@ -56,6 +56,7 @@ typedef struct _dri_bo_ttm { int refcount; /* Protected by bufmgr->mutex */ drmBO drm_bo; + const char *name; } dri_bo_ttm; typedef struct _dri_fence_ttm @@ -124,6 +125,7 @@ dri_ttm_alloc(dri_bufmgr *bufmgr, const char *name, ttm_buf->bo.offset = ttm_buf->drm_bo.offset; ttm_buf->bo.virtual = NULL; ttm_buf->bo.bufmgr = bufmgr; + ttm_buf->name = name; ttm_buf->refcount = 1; return &ttm_buf->bo; @@ -165,6 +167,7 @@ dri_ttm_alloc_static(dri_bufmgr *bufmgr, const char *name, ttm_buf->bo.offset = ttm_buf->drm_bo.offset; ttm_buf->bo.virtual = virtual; ttm_buf->bo.bufmgr = bufmgr; + ttm_buf->name = name; ttm_buf->refcount = 1; return &ttm_buf->bo; @@ -340,7 +343,7 @@ dri_ttm_fence_wait(dri_fence *fence) } static void -dri_fake_destroy(dri_bufmgr *bufmgr) +dri_bufmgr_ttm_destroy(dri_bufmgr *bufmgr) { dri_bufmgr_ttm *bufmgr_ttm = (dri_bufmgr_ttm *)bufmgr; @@ -381,6 +384,7 @@ dri_bufmgr_ttm_init(int fd, unsigned int fence_type, bufmgr_ttm->bufmgr.fence_reference = dri_ttm_fence_reference; bufmgr_ttm->bufmgr.fence_unreference = dri_ttm_fence_unreference; bufmgr_ttm->bufmgr.fence_wait = dri_ttm_fence_wait; + bufmgr_ttm->bufmgr.destroy = dri_bufmgr_ttm_destroy; /* Attempt an allocation to make sure that the DRM was actually set up for * TTM. |