From f5677a90502396deaf1622e84534039b8f80f147 Mon Sep 17 00:00:00 2001 From: David Rosca Date: Mon, 5 May 2025 09:34:31 +0200 Subject: [PATCH] radeonsi/video: Use ac_uvd_alloc_stream_handle Reviewed-by: Ruijing Dong Part-of: --- src/gallium/drivers/radeonsi/radeon_video.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/gallium/drivers/radeonsi/radeon_video.c b/src/gallium/drivers/radeonsi/radeon_video.c index 1952897cb84..fe402b99a9a 100644 --- a/src/gallium/drivers/radeonsi/radeon_video.c +++ b/src/gallium/drivers/radeonsi/radeon_video.c @@ -14,19 +14,17 @@ #include "util/u_video.h" #include "vl/vl_defines.h" #include "vl/vl_video_buffer.h" +#include "ac_uvd_dec.h" #include /* generate an stream handle */ unsigned si_vid_alloc_stream_handle() { - static unsigned counter = 0; - static unsigned handle_base = 0; - - if (!handle_base) - handle_base = util_bitreverse(getpid() ^ os_time_get()); - - return handle_base ^ ++counter; + static struct ac_uvd_stream_handle stream_handle; + if (!stream_handle.base) + ac_uvd_init_stream_handle(&stream_handle); + return ac_uvd_alloc_stream_handle(&stream_handle); } /* create a buffer in the winsys */