radeon/vcn: move add buf func to common file
authorBoyuan Zhang <boyuan.zhang@amd.com>
Sat, 2 Mar 2019 02:37:20 +0000 (21:37 -0500)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 3 Jul 2019 19:51:12 +0000 (15:51 -0400)
Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/gallium/drivers/radeon/radeon_vcn_enc.c
src/gallium/drivers/radeon/radeon_vcn_enc.h
src/gallium/drivers/radeon/radeon_vcn_enc_1_2.c

index 7d64a28a405483dd893c0739e83f3a3f81d042ed..868f94731268fb423c888270b92069c6f42c6fdd 100644 (file)
@@ -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);
+}
index c9a322671d6810ae2ec38da0e0deb842be5db74b..5fa516167d90d402768b443335c01b049250070f 100644 (file)
@@ -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
index 92a3aed98ba89cff3091aa26a34b5eee3934976e..75082092ca34c644045418a5387222a6a9aa3d22 100644 (file)
@@ -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"
 
 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) {