Module: Mesa
Branch: master
Commit: 1338d912f52b69f76ef75d1ad313893db77d4da8
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=1338d912f52b69f76ef75d1ad313893db77d4da8

Author: Christian König <christian.koe...@amd.com>
Date:   Thu Jan 19 13:44:34 2017 +0100

st/va: make sure that we call begin_frame() only once v2

This fixes "st/va: delay calling begin_frame until we have all parameters".

v2: call begin frame after decoder (re)creation as well.

Signed-off-by: Christian König <christian.koe...@amd.com>
Reviewed-by: Nayan Deshmukh <nayan26deshm...@gmail.com>
Tested-by: Andy Furniss <adf.li...@gmail.com>

---

 src/gallium/state_trackers/va/picture.c    | 11 ++++++++---
 src/gallium/state_trackers/va/va_private.h |  1 +
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/gallium/state_trackers/va/picture.c 
b/src/gallium/state_trackers/va/picture.c
index dc7121c..82584ea 100644
--- a/src/gallium/state_trackers/va/picture.c
+++ b/src/gallium/state_trackers/va/picture.c
@@ -81,7 +81,7 @@ vlVaBeginPicture(VADriverContextP ctx, VAContextID 
context_id, VASurfaceID rende
    }
 
    if (context->decoder->entrypoint != PIPE_VIDEO_ENTRYPOINT_ENCODE)
-      context->decoder->begin_frame(context->decoder, context->target, 
&context->desc.base);
+      context->needs_begin_frame = true;
 
    return VA_STATUS_SUCCESS;
 }
@@ -178,6 +178,8 @@ handlePictureParameterBuffer(vlVaDriver *drv, vlVaContext 
*context, vlVaBuffer *
 
       if (!context->decoder)
          return VA_STATUS_ERROR_ALLOCATION_FAILED;
+
+      context->needs_begin_frame = true;
    }
 
    return vaStatus;
@@ -308,8 +310,11 @@ handleVASliceDataBufferType(vlVaContext *context, 
vlVaBuffer *buf)
    sizes[num_buffers] = buf->size;
    ++num_buffers;
 
-   context->decoder->begin_frame(context->decoder, context->target,
-      &context->desc.base);
+   if (context->needs_begin_frame) {
+      context->decoder->begin_frame(context->decoder, context->target,
+         &context->desc.base);
+      context->needs_begin_frame = false;
+   }
    context->decoder->decode_bitstream(context->decoder, context->target, 
&context->desc.base,
       num_buffers, (const void * const*)buffers, sizes);
 }
diff --git a/src/gallium/state_trackers/va/va_private.h 
b/src/gallium/state_trackers/va/va_private.h
index 8faec10..0877236 100644
--- a/src/gallium/state_trackers/va/va_private.h
+++ b/src/gallium/state_trackers/va/va_private.h
@@ -261,6 +261,7 @@ typedef struct {
    int target_id;
    bool first_single_submitted;
    int gop_coeff;
+   bool needs_begin_frame;
 } vlVaContext;
 
 typedef struct {

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

Reply via email to