From: Pierre-Eric Pelloux-Prayer Date: Tue, 22 Sep 2020 12:31:32 +0000 (+0200) Subject: gallium/vl: do not call transfer_unmap if transfer is NULL X-Git-Tag: upstream/21.0.0~4891 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b121b1b8b8f6df790dd8150a8b5e8021dc9e56bb;p=platform%2Fupstream%2Fmesa.git gallium/vl: do not call transfer_unmap if transfer is NULL CC: mesa-stable Acked-by: Leo Liu Part-of: --- diff --git a/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c b/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c index 58ddef9..5b5c4df 100644 --- a/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c +++ b/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c @@ -769,7 +769,8 @@ vl_mpeg12_end_frame(struct pipe_video_codec *decoder, vl_vb_unmap(&buf->vertex_stream, dec->context); - dec->context->transfer_unmap(dec->context, buf->tex_transfer); + if (buf->tex_transfer) + dec->context->transfer_unmap(dec->context, buf->tex_transfer); vb[0] = dec->quads; vb[1] = dec->pos; diff --git a/src/gallium/auxiliary/vl/vl_vertex_buffers.c b/src/gallium/auxiliary/vl/vl_vertex_buffers.c index 0cf8582..00c424f 100644 --- a/src/gallium/auxiliary/vl/vl_vertex_buffers.c +++ b/src/gallium/auxiliary/vl/vl_vertex_buffers.c @@ -352,11 +352,13 @@ vl_vb_unmap(struct vl_vertex_buffer *buffer, struct pipe_context *pipe) assert(buffer && pipe); for (i = 0; i < VL_NUM_COMPONENTS; ++i) { - pipe_buffer_unmap(pipe, buffer->ycbcr[i].transfer); + if (buffer->ycbcr[i].transfer) + pipe_buffer_unmap(pipe, buffer->ycbcr[i].transfer); } for (i = 0; i < VL_MAX_REF_FRAMES; ++i) { - pipe_buffer_unmap(pipe, buffer->mv[i].transfer); + if (buffer->mv[i].transfer) + pipe_buffer_unmap(pipe, buffer->mv[i].transfer); } }