Mesa (master): radeon/vcn: create cs based on ring type

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Oct 23 13:30:53 UTC 2018


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

Author: Boyuan Zhang <boyuan.zhang at amd.com>
Date:   Wed Oct 17 15:03:21 2018 -0400

radeon/vcn: create cs based on ring type

Add RING_VCN_JPEG for VCN Jpeg decode, and keep RING_VCN_DEC for other codecs.

Signed-off-by: Boyuan Zhang <boyuan.zhang at amd.com>
Reviewed-by: Leo Liu <leo.liu at amd.com>

---

 src/gallium/drivers/radeon/radeon_vcn_dec.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/radeon/radeon_vcn_dec.c b/src/gallium/drivers/radeon/radeon_vcn_dec.c
index fbfef6d273..26ea1f82ff 100644
--- a/src/gallium/drivers/radeon/radeon_vcn_dec.c
+++ b/src/gallium/drivers/radeon/radeon_vcn_dec.c
@@ -1433,7 +1433,7 @@ struct pipe_video_codec *radeon_create_decoder(struct pipe_context *context,
 	struct si_context *sctx = (struct si_context*)context;
 	struct radeon_winsys *ws = sctx->ws;
 	unsigned width = templ->width, height = templ->height;
-	unsigned dpb_size, bs_buf_size, stream_type = 0;
+	unsigned dpb_size, bs_buf_size, stream_type = 0, ring = RING_VCN_DEC;
 	struct radeon_decoder *dec;
 	int r, i;
 
@@ -1462,6 +1462,10 @@ struct pipe_video_codec *radeon_create_decoder(struct pipe_context *context,
 	case PIPE_VIDEO_FORMAT_VP9:
 		stream_type = RDECODE_CODEC_VP9;
 		break;
+	case PIPE_VIDEO_FORMAT_JPEG:
+		stream_type = RDECODE_CODEC_JPEG;
+		ring = RING_VCN_JPEG;
+		break;
 	default:
 		assert(0);
 		break;
@@ -1488,7 +1492,7 @@ struct pipe_video_codec *radeon_create_decoder(struct pipe_context *context,
 	dec->stream_handle = si_vid_alloc_stream_handle();
 	dec->screen = context->screen;
 	dec->ws = ws;
-	dec->cs = ws->cs_create(sctx->ctx, RING_VCN_DEC, NULL, NULL);
+	dec->cs = ws->cs_create(sctx->ctx, ring, NULL, NULL);
 	if (!dec->cs) {
 		RVID_ERR("Can't get command submission context.\n");
 		goto error;




More information about the mesa-commit mailing list