Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH 2/2] avfilter/vf_libplacebo: Use new vulkan queue API
@ 2025-06-16 14:37 Zhao Zhili
  2025-06-16 17:06 ` Niklas Haas
  0 siblings, 1 reply; 2+ messages in thread
From: Zhao Zhili @ 2025-06-16 14:37 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Zhao Zhili

From: Zhao Zhili <zhilizhao@tencent.com>

Fixes deprecation warning.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
---
 libavfilter/vf_libplacebo.c | 36 +++++++++++++++++++++++++++---------
 1 file changed, 27 insertions(+), 9 deletions(-)

diff --git a/libavfilter/vf_libplacebo.c b/libavfilter/vf_libplacebo.c
index 9ff64053cc..e9049710c2 100644
--- a/libavfilter/vf_libplacebo.c
+++ b/libavfilter/vf_libplacebo.c
@@ -647,8 +647,7 @@ static int init_vulkan(AVFilterContext *avctx, const AVVulkanDeviceContext *hwct
 
     if (hwctx) {
 #if PL_API_VER >= 278
-        /* Import libavfilter vulkan context into libplacebo */
-        s->vulkan = pl_vulkan_import(s->log, pl_vulkan_import_params(
+        struct pl_vulkan_import_params import_params = {
             .instance       = hwctx->inst,
             .get_proc_addr  = hwctx->get_proc_addr,
             .phys_device    = hwctx->phys_dev,
@@ -660,20 +659,39 @@ static int init_vulkan(AVFilterContext *avctx, const AVVulkanDeviceContext *hwct
             .unlock_queue   = unlock_queue,
             .queue_ctx      = avctx->hw_device_ctx->data,
             .queue_graphics = {
-                .index = hwctx->queue_family_index,
-                .count = hwctx->nb_graphics_queues,
+                .index = VK_QUEUE_FAMILY_IGNORED,
+                .count = 0,
             },
             .queue_compute = {
-                .index = hwctx->queue_family_comp_index,
-                .count = hwctx->nb_comp_queues,
+                .index = VK_QUEUE_FAMILY_IGNORED,
+                .count = 0,
             },
             .queue_transfer = {
-                .index = hwctx->queue_family_tx_index,
-                .count = hwctx->nb_tx_queues,
+                .index = VK_QUEUE_FAMILY_IGNORED,
+                .count = 0,
             },
             /* This is the highest version created by hwcontext_vulkan.c */
             .max_api_version = VK_API_VERSION_1_3,
-        ));
+        };
+        for (int i = 0; i < hwctx->nb_qf; i++) {
+            const AVVulkanDeviceQueueFamily *qf = &hwctx->qf[i];
+
+            if (qf->flags & VK_QUEUE_GRAPHICS_BIT) {
+                import_params.queue_graphics.index = qf->idx;
+                import_params.queue_graphics.count = qf->num;
+            }
+            if (qf->flags & VK_QUEUE_COMPUTE_BIT) {
+                import_params.queue_compute.index = qf->idx;
+                import_params.queue_compute.count = qf->num;
+            }
+            if (qf->flags & VK_QUEUE_TRANSFER_BIT) {
+                import_params.queue_transfer.index = qf->idx;
+                import_params.queue_transfer.count = qf->num;
+            }
+        }
+
+        /* Import libavfilter vulkan context into libplacebo */
+        s->vulkan = pl_vulkan_import(s->log, &import_params);
 #else
         av_log(s, AV_LOG_ERROR, "libplacebo version %s too old to import "
                "Vulkan device, remove it or upgrade libplacebo to >= 5.278\n",
-- 
2.25.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [FFmpeg-devel] [PATCH 2/2] avfilter/vf_libplacebo: Use new vulkan queue API
  2025-06-16 14:37 [FFmpeg-devel] [PATCH 2/2] avfilter/vf_libplacebo: Use new vulkan queue API Zhao Zhili
@ 2025-06-16 17:06 ` Niklas Haas
  0 siblings, 0 replies; 2+ messages in thread
From: Niklas Haas @ 2025-06-16 17:06 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Zhao Zhili

On Mon, 16 Jun 2025 22:37:01 +0800 Zhao Zhili <quinkblack-at-foxmail.com@ffmpeg.org> wrote:
> From: Zhao Zhili <zhilizhao@tencent.com>
>
> Fixes deprecation warning.
>
> Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>

LGTM, thanks.

> ---
>  libavfilter/vf_libplacebo.c | 36 +++++++++++++++++++++++++++---------
>  1 file changed, 27 insertions(+), 9 deletions(-)
>
> diff --git a/libavfilter/vf_libplacebo.c b/libavfilter/vf_libplacebo.c
> index 9ff64053cc..e9049710c2 100644
> --- a/libavfilter/vf_libplacebo.c
> +++ b/libavfilter/vf_libplacebo.c
> @@ -647,8 +647,7 @@ static int init_vulkan(AVFilterContext *avctx, const AVVulkanDeviceContext *hwct
>
>      if (hwctx) {
>  #if PL_API_VER >= 278
> -        /* Import libavfilter vulkan context into libplacebo */
> -        s->vulkan = pl_vulkan_import(s->log, pl_vulkan_import_params(
> +        struct pl_vulkan_import_params import_params = {
>              .instance       = hwctx->inst,
>              .get_proc_addr  = hwctx->get_proc_addr,
>              .phys_device    = hwctx->phys_dev,
> @@ -660,20 +659,39 @@ static int init_vulkan(AVFilterContext *avctx, const AVVulkanDeviceContext *hwct
>              .unlock_queue   = unlock_queue,
>              .queue_ctx      = avctx->hw_device_ctx->data,
>              .queue_graphics = {
> -                .index = hwctx->queue_family_index,
> -                .count = hwctx->nb_graphics_queues,
> +                .index = VK_QUEUE_FAMILY_IGNORED,
> +                .count = 0,
>              },
>              .queue_compute = {
> -                .index = hwctx->queue_family_comp_index,
> -                .count = hwctx->nb_comp_queues,
> +                .index = VK_QUEUE_FAMILY_IGNORED,
> +                .count = 0,
>              },
>              .queue_transfer = {
> -                .index = hwctx->queue_family_tx_index,
> -                .count = hwctx->nb_tx_queues,
> +                .index = VK_QUEUE_FAMILY_IGNORED,
> +                .count = 0,
>              },
>              /* This is the highest version created by hwcontext_vulkan.c */
>              .max_api_version = VK_API_VERSION_1_3,
> -        ));
> +        };
> +        for (int i = 0; i < hwctx->nb_qf; i++) {
> +            const AVVulkanDeviceQueueFamily *qf = &hwctx->qf[i];
> +
> +            if (qf->flags & VK_QUEUE_GRAPHICS_BIT) {
> +                import_params.queue_graphics.index = qf->idx;
> +                import_params.queue_graphics.count = qf->num;
> +            }
> +            if (qf->flags & VK_QUEUE_COMPUTE_BIT) {
> +                import_params.queue_compute.index = qf->idx;
> +                import_params.queue_compute.count = qf->num;
> +            }
> +            if (qf->flags & VK_QUEUE_TRANSFER_BIT) {
> +                import_params.queue_transfer.index = qf->idx;
> +                import_params.queue_transfer.count = qf->num;
> +            }
> +        }
> +
> +        /* Import libavfilter vulkan context into libplacebo */
> +        s->vulkan = pl_vulkan_import(s->log, &import_params);
>  #else
>          av_log(s, AV_LOG_ERROR, "libplacebo version %s too old to import "
>                 "Vulkan device, remove it or upgrade libplacebo to >= 5.278\n",
> --
> 2.25.1
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-06-16 17:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-16 14:37 [FFmpeg-devel] [PATCH 2/2] avfilter/vf_libplacebo: Use new vulkan queue API Zhao Zhili
2025-06-16 17:06 ` Niklas Haas

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git