summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeo Liu <[email protected]>2017-02-09 10:30:21 -0500
committerMarek Olšák <[email protected]>2017-03-30 14:44:33 +0200
commitc89e771c9ccdcce6c971f07889290382b3deb6b0 (patch)
treec715e5f91db737c72f60c724602add24b3f88853
parentc836f2ce288f202a1c5a1514cd4890e47f60f3d7 (diff)
radeon/uvd: clear message buffer when reuse
As required by firmware Signed-off-by: Leo Liu <[email protected]> Acked-by: Alex Deucher <[email protected]> Reviewed-by: Christian König <[email protected]>
-rw-r--r--src/gallium/drivers/radeon/radeon_uvd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gallium/drivers/radeon/radeon_uvd.c b/src/gallium/drivers/radeon/radeon_uvd.c
index ea614c1dd2a..1d1e40af979 100644
--- a/src/gallium/drivers/radeon/radeon_uvd.c
+++ b/src/gallium/drivers/radeon/radeon_uvd.c
@@ -157,6 +157,8 @@ static void map_msg_fb_it_buf(struct ruvd_decoder *dec)
/* calc buffer offsets */
dec->msg = (struct ruvd_msg *)ptr;
+ memset(dec->msg, 0, sizeof(*dec->msg));
+
dec->fb = (uint32_t *)(ptr + FB_BUFFER_OFFSET);
if (have_it(dec))
dec->it = (uint8_t *)(ptr + FB_BUFFER_OFFSET + dec->fb_size);
@@ -941,7 +943,6 @@ static void ruvd_destroy(struct pipe_video_codec *decoder)
assert(decoder);
map_msg_fb_it_buf(dec);
- memset(dec->msg, 0, sizeof(*dec->msg));
dec->msg->size = sizeof(*dec->msg);
dec->msg->msg_type = RUVD_MSG_DESTROY;
dec->msg->stream_handle = dec->stream_handle;