Commit 276dd2ba authored by Hirokazu Honda's avatar Hirokazu Honda Committed by Commit Bot

media/gpu/test/VFValidator: Workaround the buffer synchronization problem on intel 3.18

There is a synchronization problem on the mapped buffer on intel
skylake devices. This is due to some missing 9165 patches in kernel
3.18, and thus will be fixed if the kernel is upreved to 4.4 or
newer. This bug causes a decoded content validation failure in
video_decode_accelerator_tests.
This is a workaround to this bug; usleep() is added after the
buffer is mapped and before the frame validation if the kernel
version is 3.18 and the processor is Skylake.

Bug: b:149808895
Test: video_decode_accelerator_tests on sentry
Change-Id: Ib77ebe0b83834e4d91bc994cbe6912348862e021
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2371724
Commit-Queue: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: default avatarMiguel Casas <mcasas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#801614}
parent 8ca4dd08
......@@ -5,13 +5,18 @@
#include "media/gpu/test/video_frame_validator.h"
#include "base/bind.h"
#include "base/cpu.h"
#include "base/files/file.h"
#include "base/hash/md5.h"
#include "base/memory/ptr_util.h"
#include "base/no_destructor.h"
#include "base/numerics/safe_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/system/sys_info.h"
#include "build/build_config.h"
#include "media/base/video_frame.h"
#include "media/gpu/buildflags.h"
#include "media/gpu/macros.h"
#include "media/gpu/test/image_quality_metrics.h"
#include "media/gpu/test/video_test_helpers.h"
......@@ -231,6 +236,27 @@ std::unique_ptr<VideoFrameValidator::MismatchedFrameInfo>
MD5VideoFrameValidator::Validate(scoped_refptr<const VideoFrame> frame,
size_t frame_index) {
DCHECK_CALLED_ON_VALID_SEQUENCE(validator_thread_sequence_checker_);
#if BUILDFLAG(USE_VAAPI)
// b/149808895: There is a bug in the synchronization on mapped buffers, which
// causes the frame validation failure. The bug is due to some missing i915
// patches in kernel v3.18. The bug will be fixed if the kernel is upreved to
// v4.4 or newer. Inserts usleep as a short term workaround to the
// synchronization bug until the kernel uprev is complete for all the v3.18
// devices. Since this bug only occurs in Skylake just because they are 3.18
// devices, we also filter by the processor.
const static std::string kernel_version = base::SysInfo::KernelVersion();
if (base::StartsWith(kernel_version, "3.18")) {
constexpr int kPentiumAndLaterFamily = 0x06;
constexpr int kSkyLakeModelId = 0x5E;
constexpr int kSkyLake_LModelId = 0x4E;
static base::NoDestructor<base::CPU> cpuid;
static bool is_skylake = cpuid->family() == kPentiumAndLaterFamily &&
(cpuid->model() == kSkyLakeModelId ||
cpuid->model() == kSkyLake_LModelId);
if (is_skylake)
usleep(10);
}
#endif // BUILDFLAG(USE_VAAPI)
if (frame->format() != validation_format_) {
frame = ConvertVideoFrame(frame.get(), validation_format_);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment