mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 06:48:06 +02:00
radeonsi/video: Add video decoder using ac_video_dec
Supports VCN, VCN JPEG and UVD. Reviewed-by: Ruijing Dong <ruijing.dong@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39627>
This commit is contained in:
parent
cb1dde2cc3
commit
26979becec
5 changed files with 1583 additions and 7 deletions
|
|
@ -360,7 +360,6 @@ GStreamer-H.265-VAAPI-Gst1.0@Main_422_10_B_RExt_Sony_2,Crash
|
||||||
GStreamer-H.265-VAAPI-Gst1.0@NONVUI_A_QUALCOMM_1,Crash
|
GStreamer-H.265-VAAPI-Gst1.0@NONVUI_A_QUALCOMM_1,Crash
|
||||||
GStreamer-H.265-VAAPI-Gst1.0@NONVUI_B_QUALCOMM_1,Crash
|
GStreamer-H.265-VAAPI-Gst1.0@NONVUI_B_QUALCOMM_1,Crash
|
||||||
GStreamer-H.265-VAAPI-Gst1.0@NONVUI_C_QUALCOMM_1,Crash
|
GStreamer-H.265-VAAPI-Gst1.0@NONVUI_C_QUALCOMM_1,Crash
|
||||||
GStreamer-H.265-VAAPI-Gst1.0@NUT_A_ericsson_5,Fail
|
|
||||||
GStreamer-H.265-VAAPI-Gst1.0@OLS_A_NOKIA_1,Crash
|
GStreamer-H.265-VAAPI-Gst1.0@OLS_A_NOKIA_1,Crash
|
||||||
GStreamer-H.265-VAAPI-Gst1.0@OLS_B_NOKIA_1,Crash
|
GStreamer-H.265-VAAPI-Gst1.0@OLS_B_NOKIA_1,Crash
|
||||||
GStreamer-H.265-VAAPI-Gst1.0@OLS_C_NOKIA_1,Crash
|
GStreamer-H.265-VAAPI-Gst1.0@OLS_C_NOKIA_1,Crash
|
||||||
|
|
|
||||||
|
|
@ -86,6 +86,8 @@ files_libradeonsi = files(
|
||||||
'si_uvd.c',
|
'si_uvd.c',
|
||||||
'si_vpe.c',
|
'si_vpe.c',
|
||||||
'si_vpe.h',
|
'si_vpe.h',
|
||||||
|
'si_video_dec.h',
|
||||||
|
'si_video_dec.c',
|
||||||
'pspdecryptionparam.h',
|
'pspdecryptionparam.h',
|
||||||
'cencdecryptionparam.h',
|
'cencdecryptionparam.h',
|
||||||
'radeon_uvd.c',
|
'radeon_uvd.c',
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@
|
||||||
#include "si_pipe.h"
|
#include "si_pipe.h"
|
||||||
#include "si_vpe.h"
|
#include "si_vpe.h"
|
||||||
#include "util/u_video.h"
|
#include "util/u_video.h"
|
||||||
|
#include "si_video_dec.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* creates a video buffer with an UVD compatible memory layout
|
* creates a video buffer with an UVD compatible memory layout
|
||||||
|
|
@ -168,10 +169,5 @@ struct pipe_video_codec *si_uvd_create_decoder(struct pipe_context *context,
|
||||||
templ->entrypoint == PIPE_VIDEO_ENTRYPOINT_PROCESSING)
|
templ->entrypoint == PIPE_VIDEO_ENTRYPOINT_PROCESSING)
|
||||||
return si_vpe_create_processor(context, templ);
|
return si_vpe_create_processor(context, templ);
|
||||||
|
|
||||||
if (vcn) {
|
return si_create_video_decoder(context, templ);
|
||||||
codec = radeon_create_decoder(context, templ);
|
|
||||||
ctx->vcn_has_ctx = si_vcn_need_context(ctx);
|
|
||||||
return codec;
|
|
||||||
}
|
|
||||||
return si_common_uvd_create_decoder(context, templ, si_uvd_set_dtb);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
1529
src/gallium/drivers/radeonsi/si_video_dec.c
Normal file
1529
src/gallium/drivers/radeonsi/si_video_dec.c
Normal file
File diff suppressed because it is too large
Load diff
50
src/gallium/drivers/radeonsi/si_video_dec.h
Normal file
50
src/gallium/drivers/radeonsi/si_video_dec.h
Normal file
|
|
@ -0,0 +1,50 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2026 Advanced Micro Devices, Inc.
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef SI_VIDEO_DEC
|
||||||
|
#define SI_VIDEO_DEC
|
||||||
|
|
||||||
|
#include "pipe/p_video_codec.h"
|
||||||
|
#include "winsys/radeon_winsys.h"
|
||||||
|
#include "ac_video_dec.h"
|
||||||
|
|
||||||
|
#define SI_VIDEO_DEC_NUM_BUFS 4
|
||||||
|
|
||||||
|
struct si_video_dec {
|
||||||
|
struct pipe_video_codec base;
|
||||||
|
|
||||||
|
struct pipe_screen *screen;
|
||||||
|
struct radeon_winsys *ws;
|
||||||
|
struct radeon_cmdbuf cs;
|
||||||
|
struct pipe_context *ectx;
|
||||||
|
|
||||||
|
bool error;
|
||||||
|
struct ac_video_dec *dec;
|
||||||
|
struct si_resource *session_buffer;
|
||||||
|
struct si_resource *session_tmz_buffer;
|
||||||
|
struct si_resource *dpb_buffer;
|
||||||
|
struct si_resource *bs_buffers[SI_VIDEO_DEC_NUM_BUFS];
|
||||||
|
struct si_resource *emb_buffers[SI_VIDEO_DEC_NUM_BUFS];
|
||||||
|
void *bs_ptr;
|
||||||
|
unsigned bs_size;
|
||||||
|
unsigned cur_buffer;
|
||||||
|
unsigned dpb_size;
|
||||||
|
unsigned dpb_alignment;
|
||||||
|
|
||||||
|
struct pipe_resource *dpb[AC_VIDEO_DEC_MAX_REFS];
|
||||||
|
struct pipe_video_buffer *render_pic_list[AC_VIDEO_DEC_MAX_REFS];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct si_video_dec_inst {
|
||||||
|
struct pipe_video_codec base;
|
||||||
|
struct pipe_video_codec **inst;
|
||||||
|
unsigned num_inst;
|
||||||
|
unsigned cur_inst;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct pipe_video_codec *si_create_video_decoder(struct pipe_context *context, const struct pipe_video_codec *templ);
|
||||||
|
|
||||||
|
#endif
|
||||||
Loading…
Add table
Reference in a new issue