vaapi_wrapper: support non-GL apps

Some unit tests make use of vaapi but do not render anything and do not
initialize GL. In this case, gl::GetGLImplementation() will return
gl::kGLImplementationNone, which was not handled and caused
VADisplayState's initialization to fail. Consider this case, trying to
open an X display first, then falling back to DRM if the returned
display is not valid.

Note that this is more a workaround than a fix ; chosing which VA
display to open should have nothing to do with GL.

BUG=chromium:790904
FIXES=CL:785690
TEST=verified that video_JpegDecodeAccelerator passes again with this
patch.

Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I589fe53ee953850b454cf2085f00590ff08e4ba4
Reviewed-on: https://chromium-review.googlesource.com/802669
Reviewed-by: Wu-Cheng Li <wuchengli@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520893}
1 file changed