Commit 25040889 authored by Xiang, Haihao's avatar Xiang, Haihao

test/putsurface/putsurface: fix multi-thread issue on X11

On X11, a VA display is dependent on the display returned by XOpenDisplay,
vaPutSurface maybe accesses this display. So the same access mechanism is needed
for vaPutSurface and other Xlib funtion calls. Another way is to call XInitThreads
before XOpenDisplay.
Signed-off-by: default avatarXiang, Haihao <haihao.xiang@intel.com>
parent b03dde4d
...@@ -193,12 +193,18 @@ static void* putsurface_thread(void *data) ...@@ -193,12 +193,18 @@ static void* putsurface_thread(void *data)
(test_clip==0)?0:2, (test_clip==0)?0:2,
display_field); display_field);
#else #else
if (check_event) {
pthread_mutex_lock(&gmutex);
}
vaStatus = vaPutSurface(va_dpy, surface_id, draw, vaStatus = vaPutSurface(va_dpy, surface_id, draw,
0,0,surface_width,surface_height, 0,0,surface_width,surface_height,
0,0,width,height, 0,0,width,height,
(test_clip==0)?NULL:&cliprects[0], (test_clip==0)?NULL:&cliprects[0],
(test_clip==0)?0:2, (test_clip==0)?0:2,
display_field); display_field);
if (check_event) {
pthread_mutex_unlock(&gmutex);
}
#endif #endif
CHECK_VASTATUS(vaStatus,"vaPutSurface"); CHECK_VASTATUS(vaStatus,"vaPutSurface");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment