This patch hardcodes the maximum resolution support by the hardware video decoder for all profiles to be 1920x1088. In the change introduced by https://codereview.chromium.org/872623002, Chromium now asks libva what the maximum resolution supported for a decoding profile is. However, the current implementation of libva doesn't ask the hardware what the maximum resolution supported is, and so when Chromium asks, a default value of 0x0 is set and returned. This would effectively disable hardware-accelerated video decoding. There is a patch in libva (http://cgit.freedesktop.org/vaapi/intel-driver/commit/?id=9a20d6c34cb65e5b85dd16d6c8b3a215c5972b18) that asks what the maximum resolution supported by the hardware is. Until there is a new release of libva that has that change, this patch will have to be used. Index: dev/media/gpu/vaapi_wrapper.cc =================================================================== --- dev.orig/media/gpu/vaapi_wrapper.cc +++ dev/media/gpu/vaapi_wrapper.cc @@ -460,42 +460,7 @@ bool VaapiWrapper::GetMaxResolution_Lock VAEntrypoint entrypoint, std::vector& required_attribs, gfx::Size* resolution) { - va_lock_->AssertAcquired(); - VAConfigID va_config_id; - VAStatus va_res = - vaCreateConfig(va_display_, va_profile, entrypoint, &required_attribs[0], - required_attribs.size(), &va_config_id); - VA_SUCCESS_OR_RETURN(va_res, "vaCreateConfig failed", false); - - // Calls vaQuerySurfaceAttributes twice. The first time is to get the number - // of attributes to prepare the space and the second time is to get all - // attributes. - unsigned int num_attribs; - va_res = vaQuerySurfaceAttributes(va_display_, va_config_id, nullptr, - &num_attribs); - VA_SUCCESS_OR_RETURN(va_res, "vaQuerySurfaceAttributes failed", false); - if (!num_attribs) - return false; - - std::vector attrib_list( - base::checked_cast(num_attribs)); - - va_res = vaQuerySurfaceAttributes(va_display_, va_config_id, &attrib_list[0], - &num_attribs); - VA_SUCCESS_OR_RETURN(va_res, "vaQuerySurfaceAttributes failed", false); - - resolution->SetSize(0, 0); - for (const auto& attrib : attrib_list) { - if (attrib.type == VASurfaceAttribMaxWidth) - resolution->set_width(attrib.value.value.i); - else if (attrib.type == VASurfaceAttribMaxHeight) - resolution->set_height(attrib.value.value.i); - } - if (resolution->IsEmpty()) { - LOG(ERROR) << "Codec resolution " << resolution->ToString() - << " cannot be zero."; - return false; - } + resolution->SetSize(1920, 1088); // Yes, this should be 1088. return true; }