From 56be937d42b2f18fff072854122dbe5e0a95dd16 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Christian=20K=C3=B6nig?= Date: Sat, 7 Sep 2013 11:40:34 -0600 Subject: [PATCH] radeon/uvd: use more sane defaults for bitstream buffer size MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König Reviewed-by: Alex Deucher --- src/gallium/drivers/radeon/radeon_uvd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/radeon/radeon_uvd.c b/src/gallium/drivers/radeon/radeon_uvd.c index 5e7eedbc70f..981d5c5f326 100644 --- a/src/gallium/drivers/radeon/radeon_uvd.c +++ b/src/gallium/drivers/radeon/radeon_uvd.c @@ -823,6 +823,7 @@ struct pipe_video_codec *ruvd_create_decoder(struct pipe_context *context, { unsigned dpb_size = calc_dpb_size(templ); unsigned width = templ->width, height = templ->height; + unsigned bs_buf_size; struct radeon_info info; struct ruvd_decoder *dec; struct ruvd_msg msg; @@ -873,6 +874,7 @@ struct pipe_video_codec *ruvd_create_decoder(struct pipe_context *context, goto error; } + bs_buf_size = width * height * 512 / (16 * 16); for (i = 0; i < NUM_BUFFERS; ++i) { unsigned msg_fb_size = align(sizeof(struct ruvd_msg), 0x1000) + 0x1000; if (!create_buffer(dec, &dec->msg_fb_buffers[i], msg_fb_size)) { @@ -880,7 +882,7 @@ struct pipe_video_codec *ruvd_create_decoder(struct pipe_context *context, goto error; } - if (!create_buffer(dec, &dec->bs_buffers[i], 4096)) { + if (!create_buffer(dec, &dec->bs_buffers[i], bs_buf_size)) { RUVD_ERR("Can't allocated bitstream buffers.\n"); goto error; } -- 2.30.2