X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fstate_trackers%2Fvdpau%2Fdecode.c;h=48dfb0e000370c85876744b0b8ac5b10c0a34c49;hb=882ca6dfb0f3d17e0f8bc917307d915ab1718069;hp=3233799d6503eb89b0eceb331bb54f118b09cf17;hpb=5609a6986f3eb3c452d66d373b6081df5c6fb34c;p=mesa.git diff --git a/src/gallium/state_trackers/vdpau/decode.c b/src/gallium/state_trackers/vdpau/decode.c index 3233799d650..48dfb0e0003 100644 --- a/src/gallium/state_trackers/vdpau/decode.c +++ b/src/gallium/state_trackers/vdpau/decode.c @@ -71,7 +71,7 @@ vlVdpDecoderCreate(VdpDevice device, pipe = dev->context; screen = dev->vscreen->pscreen; - pipe_mutex_lock(dev->mutex); + mtx_lock(&dev->mutex); supported = screen->get_video_param ( @@ -81,7 +81,7 @@ vlVdpDecoderCreate(VdpDevice device, PIPE_VIDEO_CAP_SUPPORTED ); if (!supported) { - pipe_mutex_unlock(dev->mutex); + mtx_unlock(&dev->mutex); return VDP_STATUS_INVALID_DECODER_PROFILE; } @@ -100,13 +100,13 @@ vlVdpDecoderCreate(VdpDevice device, PIPE_VIDEO_CAP_MAX_HEIGHT ); if (width > maxwidth || height > maxheight) { - pipe_mutex_unlock(dev->mutex); + mtx_unlock(&dev->mutex); return VDP_STATUS_INVALID_SIZE; } vldecoder = CALLOC(1,sizeof(vlVdpDecoder)); if (!vldecoder) { - pipe_mutex_unlock(dev->mutex); + mtx_unlock(&dev->mutex); return VDP_STATUS_RESOURCES; } @@ -136,8 +136,8 @@ vlVdpDecoderCreate(VdpDevice device, goto error_handle; } - pipe_mutex_init(vldecoder->mutex); - pipe_mutex_unlock(dev->mutex); + (void) mtx_init(&vldecoder->mutex, mtx_plain); + mtx_unlock(&dev->mutex); return VDP_STATUS_OK; @@ -145,7 +145,7 @@ error_handle: vldecoder->decoder->destroy(vldecoder->decoder); error_decoder: - pipe_mutex_unlock(dev->mutex); + mtx_unlock(&dev->mutex); DeviceReference(&vldecoder->device, NULL); FREE(vldecoder); return ret; @@ -163,10 +163,10 @@ vlVdpDecoderDestroy(VdpDecoder decoder) if (!vldecoder) return VDP_STATUS_INVALID_HANDLE; - pipe_mutex_lock(vldecoder->mutex); + mtx_lock(&vldecoder->mutex); vldecoder->decoder->destroy(vldecoder->decoder); - pipe_mutex_unlock(vldecoder->mutex); - pipe_mutex_destroy(vldecoder->mutex); + mtx_unlock(&vldecoder->mutex); + mtx_destroy(&vldecoder->mutex); vlRemoveDataHTAB(decoder); DeviceReference(&vldecoder->device, NULL); @@ -518,6 +518,7 @@ vlVdpDecoderRenderH265(struct pipe_h265_picture_desc *picture, memcpy(picture->RefPicSetStCurrBefore, picture_info->RefPicSetStCurrBefore, 8); memcpy(picture->RefPicSetStCurrAfter, picture_info->RefPicSetStCurrAfter, 8); memcpy(picture->RefPicSetLtCurr, picture_info->RefPicSetLtCurr, 8); + picture->UseRefPicList = false; return VDP_STATUS_OK; } @@ -526,7 +527,7 @@ static void vlVdpDecoderFixVC1Startcode(uint32_t *num_buffers, const void *buffers[], unsigned sizes[]) { static const uint8_t vc1_startcode[] = { 0x00, 0x00, 0x01, 0x0D }; - struct vl_vlc vlc; + struct vl_vlc vlc = {}; unsigned i; /* search the first 64 bytes for a startcode */ @@ -613,7 +614,7 @@ vlVdpDecoderRender(VdpDecoder decoder, dec->profile, PIPE_VIDEO_ENTRYPOINT_BITSTREAM) || !buffer_support[vlsurf->video_buffer->interlaced]) { - pipe_mutex_lock(vlsurf->device->mutex); + mtx_lock(&vlsurf->device->mutex); /* destroy the old one */ if (vlsurf->video_buffer) @@ -632,11 +633,11 @@ vlVdpDecoderRender(VdpDecoder decoder, /* still no luck? get me out of here... */ if (!vlsurf->video_buffer) { - pipe_mutex_unlock(vlsurf->device->mutex); + mtx_unlock(&vlsurf->device->mutex); return VDP_STATUS_NO_IMPLEMENTATION; } vlVdpVideoSurfaceClear(vlsurf); - pipe_mutex_unlock(vlsurf->device->mutex); + mtx_unlock(&vlsurf->device->mutex); } for (i = 0; i < bitstream_buffer_count; ++i) { @@ -673,10 +674,10 @@ vlVdpDecoderRender(VdpDecoder decoder, if (ret != VDP_STATUS_OK) return ret; - pipe_mutex_lock(vldecoder->mutex); + mtx_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); - pipe_mutex_unlock(vldecoder->mutex); + mtx_unlock(&vldecoder->mutex); return ret; }