diff -crB intel-driver-1.0.18/src/gen6_mfd.c intel-driver-1.0.18_patch/src/gen6_mfd.c *** intel-driver-1.0.18/src/gen6_mfd.c Mon May 28 23:22:14 2012 --- intel-driver-1.0.18_patch/src/gen6_mfd.c Thu Sep 27 13:11:27 2012 *************** *** 40,45 **** --- 40,47 ---- #include "gen6_mfd.h" + pthread_mutex_t free_avc_surface_lock; + static const uint32_t zigzag_direct[64] = { 0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18, 11, 4, 5, *************** *** 175,180 **** --- 177,190 ---- if (!gen6_avc_surface) return; + pthread_mutex_lock(&free_avc_surface_lock); + if (!gen6_avc_surface) + { + pthread_mutex_unlock(&free_avc_surface_lock); + return; + } + + dri_bo_unreference(gen6_avc_surface->dmv_top); gen6_avc_surface->dmv_top = NULL; dri_bo_unreference(gen6_avc_surface->dmv_bottom); *************** *** 182,187 **** --- 192,200 ---- free(gen6_avc_surface); *data = NULL; + + pthread_mutex_unlock(&free_avc_surface_lock); + } static void