summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorChristian König <[email protected]>2013-09-07 11:40:34 -0600
committerChristian König <[email protected]>2013-09-12 15:16:06 +0200
commit56be937d42b2f18fff072854122dbe5e0a95dd16 (patch)
tree59fcd667c5677bc3201147fbbeee464d8b53c17c /src/gallium
parent32637f56a5422b09ad945d21d8e60a8b990b0182 (diff)
radeon/uvd: use more sane defaults for bitstream buffer size
Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/radeon/radeon_uvd.c4
1 files changed, 3 insertions, 1 deletions
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;
}