Re: [Mesa-dev] [PATCH] st/va: force to flush the last p frame in idr period

2016-10-18 Thread Christian König

Am 17.10.2016 um 22:31 schrieb Alex Deucher:

On Mon, Oct 17, 2016 at 4:16 PM,   wrote:

From: Boyuan Zhang 

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

Please reference the bug when this is committed.
https://bugs.freedesktop.org/show_bug.cgi?id=98005


Yeah, add a line like "Fixes: 
https://bugs.freedesktop.org/show_bug.cgi?id=98005;.


With that done the patch is Reviewed-by: Christian König 
.


Regards,
Christian.


Alex


Signed-off-by: Boyuan Zhang 
---
  src/gallium/state_trackers/va/picture.c | 3 +++
  1 file changed, 3 insertions(+)

diff --git a/src/gallium/state_trackers/va/picture.c 
b/src/gallium/state_trackers/va/picture.c
index 7f3d96d..eae5dc4 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, 
>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;
  }
--
2.7.4

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev



___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] st/va: force to flush the last p frame in idr period

2016-10-17 Thread Alex Deucher
On Mon, Oct 17, 2016 at 4:16 PM,   wrote:
> From: Boyuan Zhang 
>
> 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

Please reference the bug when this is committed.
https://bugs.freedesktop.org/show_bug.cgi?id=98005

Alex

>
> Signed-off-by: Boyuan Zhang 
> ---
>  src/gallium/state_trackers/va/picture.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/src/gallium/state_trackers/va/picture.c 
> b/src/gallium/state_trackers/va/picture.c
> index 7f3d96d..eae5dc4 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, 
> >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;
>  }
> --
> 2.7.4
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev