From dd46740bc2a034ab7e5f9a411b0c18b5623bbccf Mon Sep 17 00:00:00 2001 From: Boyuan Zhang Date: Fri, 1 Mar 2019 21:37:20 -0500 Subject: [PATCH] radeon/vcn: move add buf func to common file Signed-off-by: Boyuan Zhang Acked-by: Bas Nieuwenhuizen --- src/gallium/drivers/radeon/radeon_vcn_enc.c | 13 +++++++++++++ src/gallium/drivers/radeon/radeon_vcn_enc.h | 4 ++++ src/gallium/drivers/radeon/radeon_vcn_enc_1_2.c | 16 ---------------- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/gallium/drivers/radeon/radeon_vcn_enc.c b/src/gallium/drivers/radeon/radeon_vcn_enc.c index 7d64a28..868f947 100644 --- a/src/gallium/drivers/radeon/radeon_vcn_enc.c +++ b/src/gallium/drivers/radeon/radeon_vcn_enc.c @@ -346,3 +346,16 @@ error: FREE(enc); return NULL; } + +void radeon_enc_add_buffer(struct radeon_encoder *enc, struct pb_buffer *buf, + enum radeon_bo_usage usage, enum radeon_bo_domain domain, + signed offset) +{ + enc->ws->cs_add_buffer(enc->cs, buf, usage | RADEON_USAGE_SYNCHRONIZED, + domain, 0); + uint64_t addr; + addr = enc->ws->buffer_get_virtual_address(buf); + addr = addr + offset; + RADEON_ENC_CS(addr >> 32); + RADEON_ENC_CS(addr); +} diff --git a/src/gallium/drivers/radeon/radeon_vcn_enc.h b/src/gallium/drivers/radeon/radeon_vcn_enc.h index c9a3226..5fa5161 100644 --- a/src/gallium/drivers/radeon/radeon_vcn_enc.h +++ b/src/gallium/drivers/radeon/radeon_vcn_enc.h @@ -496,6 +496,10 @@ struct radeon_encoder { bool need_feedback; }; +void radeon_enc_add_buffer(struct radeon_encoder *enc, struct pb_buffer *buf, + enum radeon_bo_usage usage, enum radeon_bo_domain domain, + signed offset); + void radeon_enc_1_2_init(struct radeon_encoder *enc); #endif // _RADEON_VCN_ENC_H diff --git a/src/gallium/drivers/radeon/radeon_vcn_enc_1_2.c b/src/gallium/drivers/radeon/radeon_vcn_enc_1_2.c index 92a3aed..7508209 100644 --- a/src/gallium/drivers/radeon/radeon_vcn_enc_1_2.c +++ b/src/gallium/drivers/radeon/radeon_vcn_enc_1_2.c @@ -30,9 +30,6 @@ #include "pipe/p_video_codec.h" #include "util/u_video.h" -#include "util/u_memory.h" - -#include "vl/vl_video_buffer.h" #include "si_pipe.h" #include "radeon_video.h" @@ -40,19 +37,6 @@ static const unsigned index_to_shifts[4] = {24, 16, 8, 0}; -static void radeon_enc_add_buffer(struct radeon_encoder *enc, struct pb_buffer *buf, - enum radeon_bo_usage usage, enum radeon_bo_domain domain, - signed offset) -{ - enc->ws->cs_add_buffer(enc->cs, buf, usage | RADEON_USAGE_SYNCHRONIZED, - domain, 0); - uint64_t addr; - addr = enc->ws->buffer_get_virtual_address(buf); - addr = addr + offset; - RADEON_ENC_CS(addr >> 32); - RADEON_ENC_CS(addr); -} - static void radeon_enc_set_emulation_prevention(struct radeon_encoder *enc, bool set) { if (set != enc->emulation_prevention) { -- 2.7.4