On 5/15/24 20:04, Akihiko Odaki wrote: >> > > VIRTIO_GPU_CMD_RESOURCE_UNREF should also call > virtio_gpu_virgl_async_unmap_resource_blob(). I guess that's the > original intention of having a function for this instead of inlining the > content of this function to virgl_cmd_resource_unmap_blob().
Correct, previous patchset versions unmapped resource on unref. In v11 I dropped unmapping from unref to avoid adding additional `async_unmap_in_progress` flag because normally map/unmap will be balanced by guest anyways. The virtio-gpu spec doesn't tell that resource have to be implicitly unmapped on unref. In a case of Linux guest, it actually will be a bug to unref a mapped resource because guest will continue to map and use the destroyed resource. -- Best regards, Dmitry