obj_surface->flags &= ~SURFACE_REFERENCED;
if ((obj_surface->flags & SURFACE_ALL_MASK) == SURFACE_DISPLAYED) {
- dri_bo_unreference(obj_surface->bo);
- obj_surface->bo = NULL;
obj_surface->flags &= ~SURFACE_REF_DIS_MASK;
+ i965_destroy_surface_storage(obj_surface);
}
- if (obj_surface->free_private_data)
- obj_surface->free_private_data(&obj_surface->private_data);
-
frame_store[i].surface_id = VA_INVALID_ID;
frame_store[i].frame_store_id = -1;
frame_store[i].obj_surface = NULL;
return vaStatus;
}
-static void
-i965_destroy_surface(struct object_heap *heap, struct object_base *obj)
+void
+i965_destroy_surface_storage(struct object_surface *obj_surface)
{
- struct object_surface *obj_surface = (struct object_surface *)obj;
+ if (!obj_surface)
+ return;
dri_bo_unreference(obj_surface->bo);
obj_surface->bo = NULL;
obj_surface->free_private_data(&obj_surface->private_data);
obj_surface->private_data = NULL;
}
+}
+
+static void
+i965_destroy_surface(struct object_heap *heap, struct object_base *obj)
+{
+ struct object_surface *obj_surface = (struct object_surface *)obj;
+ i965_destroy_surface_storage(obj_surface);
object_heap_free(heap, obj);
}
#define I965_SURFACE_MEM_GEM_FLINK 1
#define I965_SURFACE_MEM_DRM_PRIME 2
+void
+i965_destroy_surface_storage(struct object_surface *obj_surface);
+
#endif /* _I965_DRV_VIDEO_H_ */
obj_surface->flags |= SURFACE_DISPLAYED;
if ((obj_surface->flags & SURFACE_ALL_MASK) == SURFACE_DISPLAYED) {
- dri_bo_unreference(obj_surface->bo);
- obj_surface->bo = NULL;
obj_surface->flags &= ~SURFACE_REF_DIS_MASK;
-
- if (obj_surface->free_private_data)
- obj_surface->free_private_data(&obj_surface->private_data);
+ i965_destroy_surface_storage(obj_surface);
}
_i965UnlockMutex(&i965->render_mutex);