From: Thomas H. <th...@tu...> - 2008-04-09 18:35:42
|
Jerome Glisse wrote: > Hi Thomas, > > What should be done when unfenced list is not empty on module > unload, i call drm_bo_mm_cleanup with unfenced not empty end > i trigger : > BUG_ON(!list_empty(&bm->unfenced)) > > Should the core try to flush everythings instead of BUG_ON ? > Or should i make sure my self in the driver that everythings > is clean ? > > Cheers, > Jerome Glisse <gl...@fr...> > Jerome, The unfenced list should only be populated during a superioctl (execbuffer) call. At the end of that call, the driver should either call a) drm_fence_buffer_objects() to fence the buffers, b) drm_putback_buffer_objects() if command submission didn't succeed. (see i915_handle_copyback()) Note that drm_fence_buffer_objects() can fail. In that case, the driver should idle the appropriate engine and call drm_putback_buffer_objects. (see i915_fence_or_sync()) If, in addition, the exebuf() call is made atomic by means of a mutex, (replacing the hardware lock) this will guarantee that the unfenced list is always empty after an execbuf. Strictly speaking, that mutex is protecting the unfenced list. /Thomas |