New issue
Advanced search Search tips

Issue 913118 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jan 11
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 3
Type: Bug

Blocking:
issue 905814



Sign in to add a comment

Missing config file to find libva on Linux

Project Member Reported by julien.isorce@chromium.org, Dec 7

Issue description

On linux when building chromium with the gn arg "use_vaapi = true" it uses the default headers path to find vaapi headers, usually /usr/include/, i.e. in /usr/include/va/

Instead it should use pkg-config to find libva.pc, like done for others (dri, glib, pulse, et...).

A CL will follow.
 
Project Member

Comment 2 by bugdroid1@chromium.org, Dec 13

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b240b0f15c14e859a7535e7860b8d0a68749aa3c

commit b240b0f15c14e859a7535e7860b8d0a68749aa3c
Author: Julien Isorce <julien.isorce@chromium.org>
Date: Thu Dec 13 04:13:42 2018

Use pkg-config to find libva on Linux

Otherwise build can fail or not use the wanted libva version
when the gn arg use_vaapi is set to true (default is false).

Bug:  913118 
Change-Id: I17c9199d032473bd10f45ae798e1ed4c2212a129
Reviewed-on: https://chromium-review.googlesource.com/c/1368950
Reviewed-by: Miguel Casas <mcasas@chromium.org>
Reviewed-by: Thomas Anderson <thomasanderson@chromium.org>
Commit-Queue: Julien Isorce <julien.isorce@chromium.org>
Cr-Commit-Position: refs/heads/master@{#616207}
[add] https://crrev.com/b240b0f15c14e859a7535e7860b8d0a68749aa3c/build/config/linux/libva/BUILD.gn
[modify] https://crrev.com/b240b0f15c14e859a7535e7860b8d0a68749aa3c/media/gpu/vaapi/BUILD.gn

julien.isorce@ now that we have pkg-config: pkg-config knows the 
version of the library, right? I wonder if we could add some magic 
to the BUILD.gn file landed in #2 [1] to force/guarantee a minimum
version at [2]. Makes sense, julien.isorce@, acourbot@? Could we
apply the same idea to CrOs?

[1] https://cs.chromium.org/chromium/src/build/config/linux/libva/BUILD.gn?type=cs&sq=package:chromium&g=0
[2] https://cs.chromium.org/chromium/src/media/gpu/vaapi/vaapi_wrapper.cc?type=cs&q=vaapi/vaapi_wrapper.cc&sq=package:chromium&g=0&l=342
Cc: thomasanderson@chromium.org
+thomas.anderson@, do I make sense in #3? Can we specify a minimum 
pkg-config library version in build/config/linux/libva ?
In #3 were you thinking of something this like https://chromium-review.googlesource.com/c/chromium/src/+/1378675 ?

src/media/gpu/vaapi/vaapi_wrapper.cc::VADisplayState::InitializeOnce() check for the VA-API version at runtime.

The pkg-config also contains "libva_version". maybe this is what you wanted to check instead of what I did in this CL.

For reference, on my system libva.pc contains:

```
prefix=/home/julien/gst/master/prefix
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
driverdir=${exec_prefix}/lib/dri
libva_version=2.3.0

Name: libva
Description: Userspace Video Acceleration (VA) core interface
Version: 1.3.0
Libs: -L${libdir} -lva
Cflags: -I${includedir}
```

FYI if libva exposes the version in a header then you should prefer a static_assert instead of relying on exec_script (we only did this with atspi2 since that was the only way to get the version)
Blocking: 905814
Project Member

Comment 9 by bugdroid1@chromium.org, Dec 19

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/49cbe182511315aba02543c0406c528e682a057b

commit 49cbe182511315aba02543c0406c528e682a057b
Author: Julien Isorce <julien.isorce@chromium.org>
Date: Wed Dec 19 04:24:50 2018

Requires VA-API >= 1.1.0

Use a static_assert to check the minimum required version.

Bug:  913118 
Change-Id: I4762b6497d3777653ea581da4ed3e25dc459fe86
Reviewed-on: https://chromium-review.googlesource.com/c/1378675
Reviewed-by: Thomas Anderson <thomasanderson@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Commit-Queue: Julien Isorce <julien.isorce@chromium.org>
Cr-Commit-Position: refs/heads/master@{#617727}
[modify] https://crrev.com/49cbe182511315aba02543c0406c528e682a057b/build/config/linux/libva/BUILD.gn
[modify] https://crrev.com/49cbe182511315aba02543c0406c528e682a057b/media/gpu/vaapi/vaapi_wrapper.cc

Status: Fixed (was: Started)

Sign in to add a comment