radeonsi, radv, virtio: use AMDGPU_GEM_CREATE_VIRTIO_SHARED
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Tested-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> Reviewed-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21658>
This commit is contained in:

committed by
Marge Bot

parent
6c0e4a0ece
commit
1278d5286c
@@ -500,6 +500,10 @@ radv_amdgpu_winsys_bo_create(struct radeon_winsys *_ws, uint64_t size, unsigned
|
||||
request.flags |= AMDGPU_GEM_CREATE_VM_ALWAYS_VALID;
|
||||
}
|
||||
}
|
||||
/* Set AMDGPU_GEM_CREATE_VIRTIO_SHARED if the driver didn't disable buffer sharing. */
|
||||
if (ws->info.is_virtio && (initial_domain & RADEON_DOMAIN_VRAM_GTT) &&
|
||||
(flags & RADEON_FLAG_NO_INTERPROCESS_SHARING) == 0)
|
||||
request.flags |= AMDGPU_GEM_CREATE_VIRTIO_SHARED;
|
||||
if (initial_domain & RADEON_DOMAIN_VRAM) {
|
||||
if (ws->zero_all_vram_allocs || (flags & RADEON_FLAG_ZERO_VRAM))
|
||||
request.flags |= AMDGPU_GEM_CREATE_VRAM_CLEARED;
|
||||
|
@@ -648,6 +648,11 @@ static struct amdgpu_winsys_bo *amdgpu_create_bo(struct amdgpu_winsys *aws,
|
||||
if (flags & RADEON_FLAG_GFX12_ALLOW_DCC)
|
||||
request.flags |= AMDGPU_GEM_CREATE_GFX12_DCC;
|
||||
|
||||
/* Set AMDGPU_GEM_CREATE_VIRTIO_SHARED if the driver didn't disable buffer sharing. */
|
||||
if (aws->info.is_virtio && (initial_domain & RADEON_DOMAIN_VRAM_GTT) &&
|
||||
(flags & (RADEON_FLAG_DRIVER_INTERNAL | RADEON_FLAG_NO_INTERPROCESS_SHARING)) == 0)
|
||||
request.flags |= AMDGPU_GEM_CREATE_VIRTIO_SHARED;
|
||||
|
||||
r = ac_drm_bo_alloc(aws->dev, &request, &buf_handle);
|
||||
if (r) {
|
||||
fprintf(stderr, "amdgpu: Failed to allocate a buffer:\n");
|
||||
|
Reference in New Issue
Block a user