virgl: rework queries
authorChia-I Wu <olvaffe@gmail.com>
Mon, 18 Mar 2019 22:56:35 +0000 (15:56 -0700)
committerChia-I Wu <olvaffe@gmail.com>
Mon, 6 May 2019 17:20:40 +0000 (10:20 -0700)
commit898be8036d05eedc11903f5c7d08d330284c7cb9
treefb4060e039e495a0fc3be910cdf344bdb6f2a6e2
parentb4da53b0c342eaa0dee522e3a3859a93cb77aa84
virgl: rework queries

virglrender has been changed such that

 - VIRGL_CCMD_GET_QUERY_RESULT is fenced
 - query buffers (PIPE_BIND_CUSTOM) are coherent

We can check if a query is ready using DRM_IOCTL_VIRTGPU_WAIT, and also
avoid a synchronized transfer to retrieve the query result.  When
running against an older virglrenderer, it falls back to the old
behavior automatically.

TF2 @ 640x480 for pts4.dem went from 17fps to 40fps on my testing
machine.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
src/gallium/drivers/virgl/virgl_query.c