venus: wait on vkQueuePresentKHR

Add vn_renderer_info::has_implicit_fencing.  Force vkQueueWaitIdle
during vkQueuePresentKHR when it is false.

This kills the performance, but we have to do this until the kernel does
implicit fencing.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10146>
This commit is contained in:
Chia-I Wu
2021-04-01 12:31:21 -07:00
committed by Marge Bot
parent 7253e61d9d
commit 37f03a2c4c
4 changed files with 13 additions and 12 deletions
+9 -12
View File
@@ -360,25 +360,22 @@ vn_QueueSubmit(VkQueue _queue,
return vn_error(dev->instance, result);
}
/* XXX The implicit fence won't work because the host is not aware of it.
* It is guest-only and the guest kernel does not wait. We need kernel
* support, or better yet, an explicit fence that the host is aware of.
*
* vn_AcquireNextImage2KHR is also broken.
*/
if (wsi_mem) {
if (!VN_DEBUG(WSI)) {
/* XXX this is always false and kills the performance */
if (dev->instance->renderer_info.has_implicit_fencing) {
vn_renderer_submit(dev->instance->renderer,
&(const struct vn_renderer_submit){
.bos = &wsi_mem->base_bo,
.bo_count = 1,
});
} else {
static uint32_t ratelimit;
if (ratelimit < 10) {
vn_log(dev->instance,
"forcing vkQueueWaitIdle before presenting");
ratelimit++;
if (VN_DEBUG(WSI)) {
static uint32_t ratelimit;
if (ratelimit < 10) {
vn_log(dev->instance,
"forcing vkQueueWaitIdle before presenting");
ratelimit++;
}
}
vn_QueueWaitIdle(submit.queue);
+1
View File
@@ -108,6 +108,7 @@ struct vn_renderer_info {
bool has_cache_management;
bool has_timeline_sync;
bool has_external_sync;
bool has_implicit_fencing;
uint32_t max_sync_queue_count;
+2
View File
@@ -1251,6 +1251,8 @@ virtgpu_get_info(struct vn_renderer *renderer, struct vn_renderer_info *info)
info->has_timeline_sync = false;
info->has_external_sync = false;
info->has_implicit_fencing = false;
info->max_sync_queue_count = gpu->max_sync_queue_count;
const struct virgl_renderer_capset_venus *capset = &gpu->capset.data;
+1
View File
@@ -910,6 +910,7 @@ vtest_get_info(struct vn_renderer *renderer, struct vn_renderer_info *info)
info->has_cache_management = false;
info->has_timeline_sync = true;
info->has_external_sync = false;
info->has_implicit_fencing = false;
info->max_sync_queue_count = vtest->max_sync_queue_count;