OSDN Git Service

vulkan/wsi: Add a thread-safe queue implementation
authorKevin Strasser <kevin.strasser@intel.com>
Thu, 3 Nov 2016 01:18:44 +0000 (18:18 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Fri, 11 Nov 2016 06:40:44 +0000 (22:40 -0800)
commit932bb3f0ddf22a9cbdf6d45089547765027b4397
tree978f5b850f8987a3c4ddd9dca658d0fed41b237b
parent3ca600fe71ee505d6e6a4cea6a7a3729168ff78f
vulkan/wsi: Add a thread-safe queue implementation

In order to support FIFO mode without blocking the application on calls
to vkQueuePresentKHR it is necessary to enqueue the request and defer
calling the server until the next vblank period. The xcb present api
doesn't offer a way to register a callback, so we will have to spawn a
worker thread that will wait for a request to be added to the queue, call
to the server, and then make the image available for reuse.  This commit
introduces the queue data structure needed to implement this.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Cc: "13.0" <mesa-stable@lists.freedesktop.org>
src/vulkan/wsi/Makefile.sources
src/vulkan/wsi/wsi_common_queue.h [new file with mode: 0644]