[PATCH RFC 05/24] Revert "drm: Nerf the preclose callback for modern drivers"

Qiang Yu yuq825 at gmail.com
Thu May 31 14:04:41 UTC 2018

>> It is OK if evil user free/unmap the buffer when task is not done
>> in my implementation. It will generate a MMU fault in that case and kernel
>> driver will do recovery.
>> So does the Ctrl+C case, if don't deal with it, just get some noisy MMU
>> fault warning and a HW reset recovery.
> How about an app rendering to shared buffers, which glFlush()es and
> exits cleanly but doesn't close the DRI screen?  What would cause that
> app's rendering to get completed succesfully instead of faulting to
> death?
Do you mean the same case as Ctrl+C when an app exit without waiting
all task finished in userspace?

> You really do need to refcount the buffers used in a rendering job so
> they don't get freed early.
Do you mean refcount the buffers in kernel space job? This is OK but
not necessary, I can wait task complete in gem_close_object which
will be called by drm_release for each buffer too (I still think better
waiting in preclose at once but it's gone).

More information about the dri-devel mailing list