hwcontext_vulkan: properly migrate queue families with DRM import/export

This commit is contained in:
Lynne 2021-11-12 23:54:36 +01:00
parent 549d91ae3a
commit fa28c1b2f9
No known key found for this signature in database
GPG Key ID: A2FEA5F03F034464

View File

@ -1677,7 +1677,6 @@ static int alloc_bind_mem(AVHWFramesContext *hwfc, AVVkFrame *f,
enum PrepMode {
PREP_MODE_WRITE,
PREP_MODE_RO_SHADER,
PREP_MODE_EXTERNAL_EXPORT,
PREP_MODE_EXTERNAL_IMPORT
};
@ -1722,12 +1721,6 @@ static int prepare_frame(AVHWFramesContext *hwfc, VulkanExecCtx *ectx,
src_qf = VK_QUEUE_FAMILY_IGNORED;
dst_qf = VK_QUEUE_FAMILY_IGNORED;
break;
case PREP_MODE_RO_SHADER:
new_layout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL;
new_access = VK_ACCESS_TRANSFER_READ_BIT;
src_qf = VK_QUEUE_FAMILY_IGNORED;
dst_qf = VK_QUEUE_FAMILY_IGNORED;
break;
case PREP_MODE_EXTERNAL_IMPORT:
new_layout = VK_IMAGE_LAYOUT_GENERAL;
new_access = VK_ACCESS_MEMORY_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT;
@ -2504,10 +2497,7 @@ static int vulkan_map_from_drm_frame_desc(AVHWFramesContext *hwfc, AVVkFrame **f
goto fail;
}
/* NOTE: This is completely uneccesary and unneeded once we can import
* semaphores from DRM. Otherwise we have to activate the semaphores.
* We're reusing the exec context that's also used for uploads/downloads. */
err = prepare_frame(hwfc, &fp->conv_ctx, f, PREP_MODE_RO_SHADER);
err = prepare_frame(hwfc, &fp->conv_ctx, f, PREP_MODE_EXTERNAL_IMPORT);
if (err)
goto fail;