summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>2020-09-22 14:31:32 +0200
committerEric Engestrom <eric@engestrom.ch>2020-09-29 22:11:42 +0200
commitfc21ef6b66efc322f77e1fefc0120ac2213ebe95 (patch)
tree8d30167b6fe65824f249277b03879aa6110e395b
parentd74c2e743d00a0bb58cc5ef33a6320d45e546c12 (diff)
gallium/vl: do not call transfer_unmap if transfer is NULL
CC: mesa-stable Acked-by: Leo Liu <leo.liu@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6817> (cherry picked from commit b121b1b8b8f6df790dd8150a8b5e8021dc9e56bb)
-rw-r--r--.pick_status.json2
-rw-r--r--src/gallium/auxiliary/vl/vl_mpeg12_decoder.c3
-rw-r--r--src/gallium/auxiliary/vl/vl_vertex_buffers.c6
3 files changed, 7 insertions, 4 deletions
diff --git a/.pick_status.json b/.pick_status.json
index ff1d5011049..889100f7c9d 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -31,7 +31,7 @@
"description": "gallium/vl: do not call transfer_unmap if transfer is NULL",
"nominated": true,
"nomination_type": 0,
- "resolution": 0,
+ "resolution": 1,
"master_sha": null,
"because_sha": null
},
diff --git a/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c b/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
index 8a04158145a..c522498c3e7 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 7e6fdfaaf56..90f69c3c2b6 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);
}
}