From bda59f6e417b68985ffc8dbb92fcfe19ba12f7bf Mon Sep 17 00:00:00 2001 From: Thomas Hellstrom Date: Wed, 22 Feb 2017 21:42:01 +0100 Subject: [PATCH] Revert "st/vdpau: Fix multithreading" MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This reverts commit f1e5dfbe3c8951a6c8acf41bf5e6c2d090098b2c. For a detailed discussion see https://lists.freedesktop.org/archives/mesa-dev/2017-February/145283.html Acked-by: Christian König Signed-off-by: Thomas Hellstrom --- src/gallium/state_trackers/vdpau/decode.c | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/src/gallium/state_trackers/vdpau/decode.c b/src/gallium/state_trackers/vdpau/decode.c index 2a07d17ba10..f85bce823bb 100644 --- a/src/gallium/state_trackers/vdpau/decode.c +++ b/src/gallium/state_trackers/vdpau/decode.c @@ -68,6 +68,7 @@ vlVdpDecoderCreate(VdpDevice device, if (!dev) return VDP_STATUS_INVALID_HANDLE; + pipe = dev->context; screen = dev->vscreen->pscreen; pipe_mutex_lock(dev->mutex); @@ -122,12 +123,6 @@ vlVdpDecoderCreate(VdpDevice device, templat.level = u_get_h264_level(templat.width, templat.height, &templat.max_references); - pipe = screen->context_create(screen, dev->vscreen, 0); - if (!pipe) { - ret = VDP_STATUS_RESOURCES; - goto error_context; - } - vldecoder->decoder = pipe->create_video_codec(pipe, &templat); if (!vldecoder->decoder) { @@ -150,8 +145,6 @@ error_handle: vldecoder->decoder->destroy(vldecoder->decoder); error_decoder: - pipe->destroy(pipe); -error_context: pipe_mutex_unlock(dev->mutex); DeviceReference(&vldecoder->device, NULL); FREE(vldecoder); @@ -165,18 +158,15 @@ VdpStatus vlVdpDecoderDestroy(VdpDecoder decoder) { vlVdpDecoder *vldecoder; - struct pipe_context *pipe; vldecoder = (vlVdpDecoder *)vlGetDataHTAB(decoder); if (!vldecoder) return VDP_STATUS_INVALID_HANDLE; - pipe = vldecoder->decoder->context; pipe_mutex_lock(vldecoder->mutex); vldecoder->decoder->destroy(vldecoder->decoder); pipe_mutex_unlock(vldecoder->mutex); pipe_mutex_destroy(vldecoder->mutex); - pipe->destroy(pipe); vlRemoveDataHTAB(decoder); DeviceReference(&vldecoder->device, NULL); @@ -684,20 +674,10 @@ vlVdpDecoderRender(VdpDecoder decoder, if (ret != VDP_STATUS_OK) return ret; - /* - * Since we use separate contexts for the two mutex domains, we need - * to flush to make sure rendering operations happen in order. - * In particular, so that a frame is rendered before it is presented. - */ - pipe_mutex_lock(vldecoder->device->mutex); - vldecoder->device->context->flush(vldecoder->device->context, NULL, 0); - pipe_mutex_unlock(vldecoder->device->mutex); - pipe_mutex_lock(vldecoder->mutex); dec->begin_frame(dec, vlsurf->video_buffer, &desc.base); dec->decode_bitstream(dec, vlsurf->video_buffer, &desc.base, bitstream_buffer_count, buffers, sizes); dec->end_frame(dec, vlsurf->video_buffer, &desc.base); - dec->flush(dec); pipe_mutex_unlock(vldecoder->mutex); return ret; } -- 2.30.2