VAAPI Wrapper: refactor management of drm file
commit9583705f893683561b847feeaac48522f14dab34
authorhshi <hshi@chromium.org>
Tue, 12 May 2015 15:39:51 +0000 (12 08:39 -0700)
committerCommit bot <commit-bot@chromium.org>
Tue, 12 May 2015 15:40:09 +0000 (12 15:40 +0000)
tree2b6306e8f04a4d7f31c421c2ad37f29964833da1
parenta26ccdf90ca5f7464df921c72d18ec52d5e27d09
VAAPI Wrapper: refactor management of drm file

Make sure we use the same file in all instances of VaapiWrapper.

Define a refcounted global instance of VADisplayState that is only initialized
(via vaInitialize()) once and destroyed upon release of the last refcount.
This ensures a single drm_intel_bufmgr per fd, and avoids the double-close
problem as seen in bug 464628.

Pipe a PreSandboxInitialization to open the render node before starting sandbox.

After this CL the VEA/VDA unittests need to invoke the PreSandboxInitialization
as well.

BUG=475250
TEST=verify HW video works on link (check histograms) and VDA/VEA unittests

Review URL: https://codereview.chromium.org/1137483002

Cr-Commit-Position: refs/heads/master@{#329410}
content/common/gpu/media/vaapi_wrapper.cc
content/common/gpu/media/vaapi_wrapper.h
content/common/gpu/media/video_decode_accelerator_unittest.cc
content/common/gpu/media/video_encode_accelerator_unittest.cc
content/common/sandbox_linux/bpf_gpu_policy_linux.cc
content/gpu/gpu_main.cc