From: Boyuan Zhang Date: Sat, 2 Mar 2019 02:37:20 +0000 (-0500) Subject: radeon/vcn: move add buf func to common file X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=dd46740bc2a034ab7e5f9a411b0c18b5623bbccf;p=mesa.git radeon/vcn: move add buf func to common file Signed-off-by: Boyuan Zhang Acked-by: Bas Nieuwenhuizen --- diff --git a/src/gallium/drivers/radeon/radeon_vcn_enc.c b/src/gallium/drivers/radeon/radeon_vcn_enc.c index 7d64a28a405..868f9473126 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 c9a322671d6..5fa516167d9 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 92a3aed98ba..75082092ca3 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) {