Mesa (master): radeonsi:create uvd hevc enc entry

Leo Liu leoliu at kemper.freedesktop.org
Wed Feb 21 18:57:01 UTC 2018


Module: Mesa
Branch: master
Commit: b38b208ff8886e799d6a27522853c9afc8be8772
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b38b208ff8886e799d6a27522853c9afc8be8772

Author: James Zhu <James.Zhu at amd.com>
Date:   Mon Feb  5 17:08:22 2018 -0500

radeonsi:create uvd hevc enc entry

Add UVD hevc encode pipe video codec creation entry

Signed-off-by: James Zhu <James.Zhu at amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang at amd.com>

---

 src/gallium/drivers/radeonsi/si_uvd.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_uvd.c b/src/gallium/drivers/radeonsi/si_uvd.c
index 64f2f8e4ce..3906bbdfb8 100644
--- a/src/gallium/drivers/radeonsi/si_uvd.c
+++ b/src/gallium/drivers/radeonsi/si_uvd.c
@@ -31,6 +31,8 @@
 #include "radeon/radeon_vce.h"
 #include "radeon/radeon_vcn_dec.h"
 #include "radeon/radeon_vcn_enc.h"
+#include "radeon/radeon_uvd_enc.h"
+#include "util/u_video.h"
 
 /**
  * creates an video buffer with an UVD compatible memory layout
@@ -146,9 +148,16 @@ struct pipe_video_codec *si_uvd_create_decoder(struct pipe_context *context,
 	struct si_context *ctx = (struct si_context *)context;
 	bool vcn = (ctx->b.family == CHIP_RAVEN) ? true : false;
 
-	if (templ->entrypoint == PIPE_VIDEO_ENTRYPOINT_ENCODE)
-		return (vcn) ? radeon_create_encoder(context, templ, ctx->b.ws, si_vce_get_buffer) :
-               si_vce_create_encoder(context, templ, ctx->b.ws, si_vce_get_buffer);
+	if (templ->entrypoint == PIPE_VIDEO_ENTRYPOINT_ENCODE) {
+		if (vcn) {
+			radeon_create_encoder(context, templ, ctx->b.ws, si_vce_get_buffer);
+		} else {
+			if (u_reduce_video_profile(templ->profile) == PIPE_VIDEO_FORMAT_HEVC)
+				return radeon_uvd_create_encoder(context, templ, ctx->b.ws, si_vce_get_buffer);
+			else
+				return si_vce_create_encoder(context, templ, ctx->b.ws, si_vce_get_buffer);
+		}
+	}
 
 	return (vcn) ? 	radeon_create_decoder(context, templ) :
 		si_common_uvd_create_decoder(context, templ, si_uvd_set_dtb);




More information about the mesa-commit mailing list