mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-14 10:08:05 +02:00
venus: drop vn_call usage on apis without any returns
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33992>
This commit is contained in:
parent
ac0ca63b9d
commit
e2c5435808
4 changed files with 21 additions and 6 deletions
|
|
@ -18,6 +18,7 @@
|
|||
#include "vn_instance.h"
|
||||
#include "vn_physical_device.h"
|
||||
#include "vn_queue.h"
|
||||
#include "vn_ring.h"
|
||||
|
||||
/* device commands */
|
||||
|
||||
|
|
@ -506,7 +507,14 @@ out_queue_family_fini:
|
|||
vn_device_queue_family_fini(dev);
|
||||
|
||||
out_destroy_device:
|
||||
vn_call_vkDestroyDevice(dev->primary_ring, dev_handle, NULL);
|
||||
/* surpress -Wc23-extensions */
|
||||
{
|
||||
struct vn_ring_submit_command ring_submit;
|
||||
vn_submit_vkDestroyDevice(dev->primary_ring, 0, dev_handle, NULL,
|
||||
&ring_submit);
|
||||
if (ring_submit.ring_seqno_valid)
|
||||
vn_ring_wait_seqno(dev->primary_ring, ring_submit.ring_seqno);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
@ -587,9 +595,9 @@ vn_DestroyDevice(VkDevice device, const VkAllocationCallbacks *pAllocator)
|
|||
|
||||
vn_async_vkDestroyDevice(dev->primary_ring, device, NULL);
|
||||
|
||||
/* We must emit vn_call_vkDestroyDevice before releasing bound ring_idx.
|
||||
* Otherwise, another thread might reuse their ring_idx while they
|
||||
* are still bound to the queues in the renderer.
|
||||
/* We must emit vkDestroyDevice before releasing bound ring_idx. Otherwise,
|
||||
* another thread might reuse their ring_idx while they are still bound to
|
||||
* the queues in the renderer.
|
||||
*/
|
||||
for (uint32_t i = 0; i < dev->queue_count; i++) {
|
||||
if (!dev->queues[i].emulated)
|
||||
|
|
|
|||
|
|
@ -424,7 +424,11 @@ vn_DestroyInstance(VkInstance _instance,
|
|||
mtx_destroy(&instance->ring_idx_mutex);
|
||||
|
||||
if (instance->renderer) {
|
||||
vn_call_vkDestroyInstance(instance->ring.ring, _instance, NULL);
|
||||
struct vn_ring_submit_command ring_submit;
|
||||
vn_submit_vkDestroyInstance(instance->ring.ring, 0, _instance, NULL,
|
||||
&ring_submit);
|
||||
if (ring_submit.ring_seqno_valid)
|
||||
vn_ring_wait_seqno(instance->ring.ring, ring_submit.ring_seqno);
|
||||
|
||||
vn_instance_fini_ring(instance);
|
||||
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ vn_ring_get_seqno_status(struct vn_ring *ring, uint32_t seqno)
|
|||
return vn_ring_ge_seqno(ring, vn_ring_load_head(ring), seqno);
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
vn_ring_wait_seqno(struct vn_ring *ring, uint32_t seqno)
|
||||
{
|
||||
/* A renderer wait incurs several hops and the renderer might poll
|
||||
|
|
|
|||
|
|
@ -65,6 +65,9 @@ vn_ring_unset_status_bits(struct vn_ring *ring, uint32_t mask);
|
|||
bool
|
||||
vn_ring_get_seqno_status(struct vn_ring *ring, uint32_t seqno);
|
||||
|
||||
void
|
||||
vn_ring_wait_seqno(struct vn_ring *ring, uint32_t seqno);
|
||||
|
||||
void
|
||||
vn_ring_wait_all(struct vn_ring *ring);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue