https://bugs.freedesktop.org/show_bug.cgi?id=45018
--- Comment #97 from Marek Olšák maraeo@gmail.com 2012-08-03 15:20:12 UTC --- (In reply to comment #96)
Created attachment 65093 [details] [review] Possible fix.
It's hard and uneffecient to solve this problem completely in the kernel.
Since we patch the VM table synchronously, but use it asynchronously we will always end up needing to wait for a bo use by the GPU to end before patching in the new VA.
Please take a look at the attached patch it should fix the issue nicely in userspace.
Please use the radeon_bo_is_busy function. Calling DRM_RADEON_GEM_BUSY directly is not reliable because of the thread offloading of the CS ioctl. The same applies to any other kernel queries and commands which depend on the CS ioctl.