From 91d93aa62162f98d6377e5c796b63faa263f2c18 Mon Sep 17 00:00:00 2001 From: Julien Isorce Date: Tue, 25 Jul 2017 15:31:28 +0100 Subject: st/va: change frame_idx from array to hash table MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The picture_id was assumed to be a frame number so in 0-31. But the vaapi client gstreamer-vaapi uses the surfaces handles as identifier which are unsigned int. This bug can happen when using a lot of vaapi surfaces within the same process. Indeed Mesa/st/va increments a counter for the surface ID: mesa/util/u_handle_table.c::handle_table_add which starts from 0 and incremented by 1 at each call. So creating more than 32 surfaces was a problem. The following bug contains a test that reproduces the problem by running a couple of vaapih264enc in the same process. The above also explains why there was no pb when running them in separated processes. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102006 Signed-off-by: Julien Isorce Tested-by: Tomas Rataj Acked-by: Christian König Reviewed-and-tested-by: Boyuan Zhang --- src/gallium/include/pipe/p_video_state.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/gallium/include/pipe/p_video_state.h') diff --git a/src/gallium/include/pipe/p_video_state.h b/src/gallium/include/pipe/p_video_state.h index 39b39051648..53f9ab3d5e1 100644 --- a/src/gallium/include/pipe/p_video_state.h +++ b/src/gallium/include/pipe/p_video_state.h @@ -32,6 +32,7 @@ #include "pipe/p_format.h" #include "pipe/p_state.h" #include "pipe/p_screen.h" +#include "util/u_hash_table.h" #include "util/u_inlines.h" #ifdef __cplusplus @@ -407,7 +408,8 @@ struct pipe_h264_enc_picture_desc bool not_referenced; bool is_idr; bool enable_vui; - unsigned int frame_idx[32]; + struct util_hash_table *frame_idx; + }; struct pipe_h265_sps -- cgit v1.2.3