void vrend_get_query_result(struct vrend_context *ctx, uint32_t handle,
                            UNUSED uint32_t wait)
{
   struct vrend_query *q;
   bool ret;

   q = vrend_object_lookup(ctx->sub->object_hash, handle, VIRGL_OBJECT_QUERY);
   if (!q)
      return;

   lock_sync();
   ret = vrend_check_query_locked(q);
   if (ret) {
      list_delinit(&q->waiting_queries);
   } else if (LIST_IS_EMPTY(&q->waiting_queries)) {
      list_addtail(&q->waiting_queries, &vrend_state.waiting_query_list);
   }
   unlock_sync();
}
void vrend_get_query_result(struct vrend_context *ctx, uint32_t handle,
                            UNUSED uint32_t wait)
{
   struct vrend_query *q;
   bool ret;

   q = vrend_object_lookup(ctx->sub->object_hash, handle, VIRGL_OBJECT_QUERY);
   if (!q)
      return;

   lock_sync();
   ret = vrend_check_query_locked(q);
   if (ret) {
      list_delinit(&q->waiting_queries);
   } else if (LIST_IS_EMPTY(&q->waiting_queries)) {
      list_addtail(&q->waiting_queries, &vrend_state.waiting_query_list);
   }
   unlock_sync();
}