Skip to content

Commit

Permalink
Migrating VA-API fake driver to Chrome.
Browse files Browse the repository at this point in the history
Moving this code from ChromeOS code base to Chrome. It's moving from
ChromeOS for two main reasons:

1. It's easier to submit code to Chrome. This is because it has a less
flaky CQ since there is less real hardware involved.
2. The tests that need the fake driver are all in Chrome.

The largest edit made from the original code was changing the type of
the iterative value in some of the for loops from size_t to int. This
was because its stop condition was comparing it to an int, which was
throwing errors. Some smaller changes were: converted some for
loops to be range for lops, white space changes, converted a NULL to a
nullptr, adding extern "C" to __vaDriverInit_1_0(), and changed the
vendor string from "fake" to "libfake".

The //testing/ directory is edited to make ChromeCQ trybots run with
this fake driver instead of the old one in ChromeOS.

Link to original directory:
https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/libva-fake-driver/

NOPRESUBMIT=true

Change-Id: Iffab7cc2c6cd793725818f5227523f2b1e9dc51d
Bug: b:259120742
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4024753
Reviewed-by: Pilar Molina Lopez <pmolinalopez@chromium.org>
Reviewed-by: Andres Calderon Jaramillo <andrescj@chromium.org>
Commit-Queue: Grayson LaFleur <graysonlafleur@google.com>
Reviewed-by: Ben Pastene <bpastene@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1075231}
  • Loading branch information
Grayson LaFleur authored and Chromium LUCI CQ committed Nov 23, 2022
1 parent 7826e21 commit b71550a
Show file tree
Hide file tree
Showing 10 changed files with 711 additions and 10 deletions.
1 change: 1 addition & 0 deletions media/gpu/vaapi/BUILD.gn
Expand Up @@ -343,6 +343,7 @@ test("vaapi_unittest") {
"//build:chromeos_buildflags",
"//gpu",
"//media/gpu/test:helpers",
"//media/gpu/vaapi/test/fake_libva_driver:fake_drv_video",
"//testing/gtest",
"//third_party/minigbm",
"//ui/gfx/linux:gbm",
Expand Down
7 changes: 7 additions & 0 deletions media/gpu/vaapi/test/fake_libva_driver/BUILD.gn
@@ -0,0 +1,7 @@
# Copyright 2022 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

shared_library("fake_drv_video") {
sources = [ "fake_drv_video.cc" ]
}
3 changes: 3 additions & 0 deletions media/gpu/vaapi/test/fake_libva_driver/OWNERS
@@ -0,0 +1,3 @@
mcasas@chromium.org
andrescj@chromium.org
pmolinalopez@chromium.org
15 changes: 15 additions & 0 deletions media/gpu/vaapi/test/fake_libva_driver/README.md
@@ -0,0 +1,15 @@
# VA-API fake backend for libva

VA-API is an API for video/image decoding/encoding acceleration implemented by
[libva]. The files in this folder provide a fake backend for it
intended to be used in tests.

It can be explicitly exercised by running e.g.:

LIBVA_DRIVER_NAME="libfake" vainfo

wherever it might be installed. See https://tinyurl.com/libva-fake-driver for
its original implementation. This document is outdated but still provides the
general idea for this directory.

[libva]: https://github.com/intel/libva

0 comments on commit b71550a

Please sign in to comment.