diff options
author | Boyuan Zhang <[email protected]> | 2016-10-17 16:11:48 -0400 |
---|---|---|
committer | Leo Liu <[email protected]> | 2016-10-18 15:16:34 -0400 |
commit | 5567145d59d5d539474fb68155dba4dec716e32e (patch) | |
tree | e9c46dbc329cbd0c55ae6506fc01fb7892db4001 /src/gallium | |
parent | 52a6483e8a016f3dec7db8634a85b9fa62e86693 (diff) |
st/va: force to flush the last p frame in idr period
During dual instance encoding submission, if the second encode task and first
encode task have no reference dependency, e.g. p following with idr-frame,
there is a chance the second task will use for its reconstructed picture
buffer the same buffer used by first task for its reference/reconstructed
picture. In this case, buffer corruption may occur depending on encoding
speed. Fix is to force flush these two tasks separately to avoid race condition
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=98005
Signed-off-by: Boyuan Zhang <[email protected]>
Reviewed-by: Christian König <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/state_trackers/va/picture.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/va/picture.c b/src/gallium/state_trackers/va/picture.c index 66e6e0d1fcd..a8102a4284d 100644 --- a/src/gallium/state_trackers/va/picture.c +++ b/src/gallium/state_trackers/va/picture.c @@ -578,6 +578,9 @@ vlVaEndPicture(VADriverContextP ctx, VAContextID context_id) } context->decoder->end_frame(context->decoder, context->target, &context->desc.base); + if (context->decoder->entrypoint == PIPE_VIDEO_ENTRYPOINT_ENCODE && + context->desc.h264enc.p_remain == 1) + context->decoder->flush(context->decoder); pipe_mutex_unlock(drv->mutex); return VA_STATUS_SUCCESS; } |