WIP: DO NOT MERGE: global fencing over per-context fencing
(EDIT: we should deprecate this in favor of mesa/mesa!10146 (merged))
This MR adds 3 commits on top of !412 (merged). It is both right and wrong.
It is right because the guest kernel assumes a global fence timeline. When the guest kernel submit a command against context A and another command against context B, it assumes the two commands will complete in the submission order. To match the guest kernel's assumption, virgl_renderer_create_fence
should also create fences on a global fence timeline.
It is wrong because the guest kernel has the wrong assumption. It was good enough (but not exactly true) when there was only GL/GLES. It became plain wrong with Vulkan.
This MR reimplements virgl_renderer_create_fence
on top of per-context fencing. When virgl_renderer_create_fence
is called to create a global fence on the global fence timeline, it internally creates a per-context fence for each active context. Only when all per-context fences have signaled, the global fence is considered signaled.