{
struct radeon_bo_pb *buf = radeon_bo_pb(_buf);
+ LIST_DEL(&buf->maplist);
+
if (buf->bo->data != NULL) {
- LIST_DEL(&buf->maplist);
radeon_bo_unmap(buf->mgr->radeon, buf->bo);
}
radeon_bo_reference(buf->mgr->radeon, &buf->bo, NULL);
if (p_atomic_read(&buf->bo->reference.count) > 1)
return NULL;
}
- if (buf->bo->data != NULL)
+ if (buf->bo->data != NULL) {
+ LIST_DELINIT(&buf->maplist);
return buf->bo->data;
+ }
if (flags & PB_USAGE_DONTBLOCK) {
uint32_t domain;
if (radeon_bo_map(buf->mgr->radeon, buf->bo)) {
return NULL;
}
- LIST_ADDTAIL(&buf->maplist, &buf->mgr->buffer_map_list);
+ LIST_DELINIT(&buf->maplist);
return buf->bo->data;
}
static void radeon_bo_pb_unmap_internal(struct pb_buffer *_buf)
{
- (void)_buf;
+ struct radeon_bo_pb *buf = radeon_bo_pb(_buf);
+ LIST_ADDTAIL(&buf->maplist, &buf->mgr->buffer_map_list);
}
static void
LIST_FOR_EACH_ENTRY_SAFE(rpb, t_rpb, &mgr->buffer_map_list, maplist) {
radeon_bo_unmap(mgr->radeon, rpb->bo);
- LIST_DEL(&rpb->maplist);
+ LIST_DELINIT(&rpb->maplist);
}
LIST_INITHEAD(&mgr->buffer_map_list);