From 80eaa4963cdbbc2d3791466c9ab4e93d85408147 Mon Sep 17 00:00:00 2001 From: jeffqjiangNew <142832361+jeffqjiangNew@users.noreply.github.com> Date: Mon, 6 May 2024 17:40:15 -0400 Subject: [PATCH] * rocDecode: Removed the workaround for the previous non-blocking implementation of vaSyncSurface() in the driver, since the correct implementation has been put into the driver already. (#340) [ROCm/rocdecode commit: 3ade0f31ff5c194b356ae3c37d3ea3fec33be7fa] --- .../src/rocdecode/vaapi/vaapi_videodecoder.cpp | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/projects/rocdecode/src/rocdecode/vaapi/vaapi_videodecoder.cpp b/projects/rocdecode/src/rocdecode/vaapi/vaapi_videodecoder.cpp index 65c4d3ca54..1e195e7060 100644 --- a/projects/rocdecode/src/rocdecode/vaapi/vaapi_videodecoder.cpp +++ b/projects/rocdecode/src/rocdecode/vaapi/vaapi_videodecoder.cpp @@ -414,22 +414,8 @@ rocDecStatus VaapiVideoDecoder::SyncSurface(int pic_idx) { } VASurfaceStatus surface_status; CHECK_VAAPI(vaQuerySurfaceStatus(va_display_, va_surface_ids_[pic_idx], &surface_status)); - while (surface_status != VASurfaceReady) { - VAStatus va_status = vaSyncSurface(va_display_, va_surface_ids_[pic_idx]); - /* Current implementation of vaSyncSurface() does not block indefinitely (contrary to VA-API spec), it returns - * VA_STATUS_ERROR_TIMEDOUT error when it blocks for a certain amount of time. Although time out can come from - * various reasons, we treat it as non-fatal and contiue waiting. - */ - if (va_status != VA_STATUS_SUCCESS) { - if (va_status == 0x26 /*VA_STATUS_ERROR_TIMEDOUT*/) { - CHECK_VAAPI(vaQuerySurfaceStatus(va_display_, va_surface_ids_[pic_idx], &surface_status)); - } else { - std::cout << "vaSyncSurface() failed with error code: 0x" << std::hex << va_status << std::dec << "', status: " << vaErrorStr(va_status) << "' at " << __FILE__ << ":" << __LINE__ << std::endl; - return ROCDEC_RUNTIME_ERROR; - } - } else { - break; - } + if (surface_status != VASurfaceReady) { + CHECK_VAAPI(vaSyncSurface(va_display_, va_surface_ids_[pic_idx])); } return ROCDEC_SUCCESS; }