diff options
author | Boyuan Zhang <[email protected]> | 2019-03-01 21:37:20 -0500 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2019-07-03 15:51:12 -0400 |
commit | dd46740bc2a034ab7e5f9a411b0c18b5623bbccf (patch) | |
tree | 381f4c1a86d13d40c53b1afcbc0f9e137c7be0e3 /src/gallium | |
parent | e6ca4d1bd857bba64a98f63fca0e7bf66a581686 (diff) |
radeon/vcn: move add buf func to common file
Signed-off-by: Boyuan Zhang <[email protected]>
Acked-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/radeon/radeon_vcn_enc.c | 13 | ||||
-rw-r--r-- | src/gallium/drivers/radeon/radeon_vcn_enc.h | 4 | ||||
-rw-r--r-- | 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 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) { |