[FFmpeg-devel] [PATCH 55/97] Vulkan patchset part 2 - hwcontext rewrite and filtering

Lynne dev at lynne.ee
Thu May 11 19:40:54 EEST 2023


May 11, 2023, 18:05 by anton at khirnov.net:

> Quoting Lynne (2023-04-24 17:56:38)
>
>> From c50347a552f5c7c2e3fcf20ef9a1ad4f1a419918 Mon Sep 17 00:00:00 2001
>> From: Lynne <dev at lynne.ee>
>> Date: Wed, 23 Nov 2022 20:32:49 +0100
>> Subject: [PATCH 27/97] hwcontext_vulkan: remove contiguous memory hack
>>
>
> This needs a lot more context.
>
> What was the hack, why was it added, why is it being removed and what
> will be affected by that.
>

The hack was added to enable exporting of vulkan images to DRM.
On Intel hardware, specifically for DRM images, all planes must be
allocated next to each other, due to hardware limitation, so the hack
used a single large allocation and suballocated all planes from it.

By natively supporting multiplane images, the driver is what decides
the layout, so exporting just works.

It's a hack because it conflicted heavily with image allocation, and
with the whole ecosystem in general, before multiplane images were
supported, which just made it redundant.

This is also the commit which broke the hwcontext hardest and prompted
the entire rewrite in the first place.


>> diff --git a/libavutil/hwcontext_vulkan.h b/libavutil/hwcontext_vulkan.h
>> index 406d8709c3..e89fa52927 100644
>> --- a/libavutil/hwcontext_vulkan.h
>> +++ b/libavutil/hwcontext_vulkan.h
>> @@ -160,9 +160,7 @@ typedef enum AVVkFrameFlags {
>>  * device and tiling during av_hwframe_ctx_init(). */
>>  AV_VK_FRAME_FLAG_NONE              = (1ULL << 0),
>>  
>> -    /* Image planes will be allocated in a single VkDeviceMemory, rather
>> -     * than as per-plane VkDeviceMemory allocations. Required for exporting
>> -     * to VAAPI on Intel devices. */
>> +    /* DEPRECATED: does nothing. */
>>  AV_VK_FRAME_FLAG_CONTIGUOUS_MEMORY = (1ULL << 1),
>>
>
> If it's deprecated then it should actually be deprecated.
>

Done.


More information about the ffmpeg-devel mailing list