Module: Mesa
Branch: staging/20.2
Commit: e84d418bd1501a956dd9920619b2af709a31e551
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=e84d418bd1501a956dd9920619b2af709a31e551

Author: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-pra...@amd.com>
Date:   Tue Sep 22 14:31:32 2020 +0200

gallium/vl: do not call transfer_unmap if transfer is NULL

CC: mesa-stable
Acked-by: Leo Liu <leo....@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6817>
(cherry picked from commit b121b1b8b8f6df790dd8150a8b5e8021dc9e56bb)

---

 .pick_status.json                            | 2 +-
 src/gallium/auxiliary/vl/vl_mpeg12_decoder.c | 3 ++-
 src/gallium/auxiliary/vl/vl_vertex_buffers.c | 6 ++++--
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 478fbbd2eaf..5416e6da36d 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -733,7 +733,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);
    }
 }
 

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to