[04/13] radeon/vcn: create cs based on ring type

Submitted by Zhang, Boyuan on Aug. 16, 2018, 4:06 p.m.

Details

Message ID 1534435591-22542-4-git-send-email-boyuan.zhang@amd.com
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Zhang, Boyuan Aug. 16, 2018, 4:06 p.m.
From: Boyuan Zhang <boyuan.zhang@amd.com>

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

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
---
 src/gallium/drivers/radeon/radeon_vcn_dec.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/gallium/drivers/radeon/radeon_vcn_dec.c b/src/gallium/drivers/radeon/radeon_vcn_dec.c
index 8bea704..e6c1b67 100644
--- a/src/gallium/drivers/radeon/radeon_vcn_dec.c
+++ b/src/gallium/drivers/radeon/radeon_vcn_dec.c
@@ -1173,7 +1173,7 @@  struct pipe_video_codec *radeon_create_decoder(struct pipe_context *context,
 	struct radeon_winsys* ws = ((struct r600_common_context *)context)->ws;
 	struct r600_common_context *rctx = (struct r600_common_context*)context;
 	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;
 
@@ -1199,6 +1199,10 @@  struct pipe_video_codec *radeon_create_decoder(struct pipe_context *context,
 	case PIPE_VIDEO_FORMAT_HEVC:
 		stream_type = RDECODE_CODEC_H265;
 		break;
+	case PIPE_VIDEO_FORMAT_JPEG:
+		stream_type = RDECODE_CODEC_JPEG;
+		ring = RING_VCN_JPEG;
+		break;
 	default:
 		assert(0);
 		break;
@@ -1225,7 +1229,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(rctx->ctx, RING_VCN_DEC, NULL, NULL);
+	dec->cs = ws->cs_create(rctx->ctx, ring, NULL, NULL);
 	if (!dec->cs) {
 		RVID_ERR("Can't get command submission context.\n");
 		goto error;