[Mesa-dev,133/140] radeon/uvd: clear message buffer when reuse

Submitted by Marek Olšák on March 20, 2017, 10:49 p.m.

Details

Message ID 1490050166-6119-42-git-send-email-maraeo@gmail.com
State Accepted
Commit c89e771c9ccdcce6c971f07889290382b3deb6b0
Headers show
Series "RadeonSI: Initial Vega10 support" ( rev: 32 ) in Mesa

Not browsing as part of any series.

Commit Message

Marek Olšák March 20, 2017, 10:49 p.m.
From: Leo Liu <leo.liu@amd.com>

As required by firmware

Signed-off-by: Leo Liu <leo.liu@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
---
 src/gallium/drivers/radeon/radeon_uvd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/src/gallium/drivers/radeon/radeon_uvd.c b/src/gallium/drivers/radeon/radeon_uvd.c
index ea614c1..1d1e40a 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;

Comments

Am 20.03.2017 um 23:49 schrieb Marek Olšák:
> From: Leo Liu <leo.liu@amd.com>
>
> As required by firmware
>
> Signed-off-by: Leo Liu <leo.liu@amd.com>
> Acked-by: Alex Deucher <alexander.deucher@amd.com>

Reviewed-by: Christian König <christian.koenig@amd.com>

> ---
>   src/gallium/drivers/radeon/radeon_uvd.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/gallium/drivers/radeon/radeon_uvd.c b/src/gallium/drivers/radeon/radeon_uvd.c
> index ea614c1..1d1e40a 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;