CtrlQueue: Add fences to

CreateResource
CreateResource3D
ResFlush
TransferToHost2D
TransferToHost3D
AttachBacking
DetachBacking
This commit is contained in:
Ake Rehnman committed 2025-11-09 07:27:50 +01:00
1 parent 1daaff1b80
commit 95fd452dfd
1 file changed
+23
+23
View File
@@ -432,6 +432,10 @@ void CtrlQueue::CreateResource(UINT res_id, UINT format, UINT width, UINT height
cmd->format = format;
cmd->width = width;
cmd->height = height;
cmd->hdr.flags |= VIRTIO_GPU_FLAG_FENCE;
cmd->hdr.fence_id = InterlockedIncrement(&m_FenceIdr);
// FIXME!!! if
QueueBuffer(vbuf);
@@ -462,6 +466,9 @@ void CtrlQueue::CreateResource3D(UINT res_id, VIOGPU_RESOURCE_OPTIONS *options)
cmd->last_level = options->last_level;
cmd->nr_samples = options->nr_samples;
cmd->hdr.flags |= VIRTIO_GPU_FLAG_FENCE;
cmd->hdr.fence_id = InterlockedIncrement(&m_FenceIdr);
// FIXME!!! if
QueueBuffer(vbuf);
@@ -527,6 +534,9 @@ void CtrlQueue::ResFlush(UINT res_id, UINT width, UINT height, UINT x, UINT y)
cmd->r.x = x;
cmd->r.y = y;
cmd->hdr.flags |= VIRTIO_GPU_FLAG_FENCE;
cmd->hdr.fence_id = InterlockedIncrement(&m_FenceIdr);
QueueBuffer(vbuf);
DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__));
@@ -550,6 +560,9 @@ void CtrlQueue::TransferToHost2D(UINT res_id, ULONG offset, UINT width, UINT hei
cmd->r.x = x;
cmd->r.y = y;
cmd->hdr.flags |= VIRTIO_GPU_FLAG_FENCE;
cmd->hdr.fence_id = InterlockedIncrement(&m_FenceIdr);
QueueBuffer(vbuf);
DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__));
@@ -573,6 +586,10 @@ void CtrlQueue::TransferToHost3D(UINT res_id, GPU_BOX *box)
cmd->layer_stride = 0;
memcpy(&cmd->box, box, sizeof(GPU_BOX));
cmd->hdr.flags |= VIRTIO_GPU_FLAG_FENCE;
cmd->hdr.fence_id = InterlockedIncrement(&m_FenceIdr);
QueueBuffer(vbuf);
DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__));
@@ -596,6 +613,9 @@ void CtrlQueue::AttachBacking(UINT res_id, PGPU_MEM_ENTRY ents, UINT nents)
vbuf->data_buf = ents;
vbuf->data_size = sizeof(*ents) * nents;
cmd->hdr.flags |= VIRTIO_GPU_FLAG_FENCE;
cmd->hdr.fence_id = InterlockedIncrement(&m_FenceIdr);
QueueBuffer(vbuf);
DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__));
@@ -721,6 +741,9 @@ void CtrlQueue::DetachBacking(UINT res_id)
cmd->hdr.type = VIRTIO_GPU_CMD_RESOURCE_DETACH_BACKING;
cmd->resource_id = res_id;
cmd->hdr.flags |= VIRTIO_GPU_FLAG_FENCE;
cmd->hdr.fence_id = InterlockedIncrement(&m_FenceIdr);
QueueBuffer(vbuf);
DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__));