From ff2b2584fcfe1ed8b7e78e334ce77925563975a0 Mon Sep 17 00:00:00 2001 From: Boyuan Zhang Date: Sat, 26 Feb 2022 19:29:16 -0500 Subject: [PATCH] radeonsi/vcn: add vcn 4.0 encode support Add new file "radeon_vcn_enc_4_0.c" for VCN 4.0 encode. Signed-off-by: Boyuan Zhang Acked-by: Pierre-Eric Pelloux-Prayer Part-of: --- src/gallium/drivers/radeonsi/meson.build | 1 + src/gallium/drivers/radeonsi/radeon_vcn_enc.h | 2 + .../drivers/radeonsi/radeon_vcn_enc_4_0.c | 41 +++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 src/gallium/drivers/radeonsi/radeon_vcn_enc_4_0.c diff --git a/src/gallium/drivers/radeonsi/meson.build b/src/gallium/drivers/radeonsi/meson.build index f0270c09650..3a303ce70b4 100644 --- a/src/gallium/drivers/radeonsi/meson.build +++ b/src/gallium/drivers/radeonsi/meson.build @@ -94,6 +94,7 @@ files_libradeonsi = files( 'radeon_vcn_enc_1_2.c', 'radeon_vcn_enc_2_0.c', 'radeon_vcn_enc_3_0.c', + 'radeon_vcn_enc_4_0.c', 'radeon_video.c', 'radeon_video.h', ) diff --git a/src/gallium/drivers/radeonsi/radeon_vcn_enc.h b/src/gallium/drivers/radeonsi/radeon_vcn_enc.h index aa6c80f74ec..25f0d296291 100644 --- a/src/gallium/drivers/radeonsi/radeon_vcn_enc.h +++ b/src/gallium/drivers/radeonsi/radeon_vcn_enc.h @@ -649,4 +649,6 @@ void radeon_enc_2_0_init(struct radeon_encoder *enc); void radeon_enc_3_0_init(struct radeon_encoder *enc); +void radeon_enc_4_0_init(struct radeon_encoder *enc); + #endif // _RADEON_VCN_ENC_H diff --git a/src/gallium/drivers/radeonsi/radeon_vcn_enc_4_0.c b/src/gallium/drivers/radeonsi/radeon_vcn_enc_4_0.c new file mode 100644 index 00000000000..9bd2c80d417 --- /dev/null +++ b/src/gallium/drivers/radeonsi/radeon_vcn_enc_4_0.c @@ -0,0 +1,41 @@ +/************************************************************************** + * + * Copyright 2022 Advanced Micro Devices, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +#include + +#include "pipe/p_video_codec.h" + +#include "util/u_video.h" + +#include "si_pipe.h" +#include "radeon_video.h" +#include "radeon_vcn_enc.h" + +void radeon_enc_4_0_init(struct radeon_encoder *enc) +{ + radeon_enc_3_0_init(enc); +}