Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(308)

Issue 1137483002: VAAPI Wrapper: refactor management of drm file (Closed)

Created:
5 years, 7 months ago by hshi1
Modified:
5 years, 7 months ago
CC:
chromium-reviews, posciak+watch_chromium.org, jam, mcasas+watch_chromium.org, rickyz+watch_chromium.org, feature-media-reviews_chromium.org, darin-cc_chromium.org, piman+watch_chromium.org, wjia+watch_chromium.org, jln+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

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 Committed: https://crrev.com/9583705f893683561b847feeaac48522f14dab34 Cr-Commit-Position: refs/heads/master@{#329410}

Patch Set 1 #

Total comments: 5

Patch Set 2 : Use ScopedFD #

Patch Set 3 : Fix clang error (declaration requires an exit-time destructor) #

Patch Set 4 : Single global refcounted instance of VADisplayState. #

Patch Set 5 : Make va_display_state_ a scoped_ptr for X11 #

Total comments: 2

Patch Set 6 : Move va_lock_ into VADisplayState and ensure its validity for lifetime of VaapiWrapper. #

Total comments: 4

Patch Set 7 : Address comments from piman. #

Total comments: 1

Patch Set 8 : minor naming change to accessor #

Total comments: 16

Patch Set 9 : Posciak's comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+194 lines, -81 lines) Patch
M content/common/gpu/media/vaapi_wrapper.h View 1 2 3 4 5 6 7 8 6 chunks +53 lines, -16 lines 0 comments Download
M content/common/gpu/media/vaapi_wrapper.cc View 1 2 3 4 5 6 7 8 32 chunks +124 lines, -63 lines 0 comments Download
M content/common/gpu/media/video_decode_accelerator_unittest.cc View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M content/common/gpu/media/video_encode_accelerator_unittest.cc View 1 2 3 2 chunks +5 lines, -0 lines 0 comments Download
M content/common/sandbox_linux/bpf_gpu_policy_linux.cc View 2 chunks +0 lines, -2 lines 0 comments Download
M content/gpu/gpu_main.cc View 2 chunks +8 lines, -0 lines 0 comments Download

Messages

Total messages: 39 (7 generated)
hshi1
PTAL this CL intends to eliminate the need to whitelist the render node in GpuProcessPolicy ...
5 years, 7 months ago (2015-05-07 18:22:28 UTC) #2
Jorge Lucangeli Obes
sandbox lgtm. would you need to test on other architectures? I don't remember exactly what ...
5 years, 7 months ago (2015-05-07 20:02:23 UTC) #3
hshi1
On 2015/05/07 20:02:23, Jorge Lucangeli Obes wrote: > sandbox lgtm. would you need to test ...
5 years, 7 months ago (2015-05-07 20:06:29 UTC) #4
dnicoara
https://codereview.chromium.org/1137483002/diff/1/content/common/gpu/media/vaapi_wrapper.cc File content/common/gpu/media/vaapi_wrapper.cc (right): https://codereview.chromium.org/1137483002/diff/1/content/common/gpu/media/vaapi_wrapper.cc#newcode325 content/common/gpu/media/vaapi_wrapper.cc:325: va_display_ = vaGetDisplayDRM(drm_file_.Get().GetPlatformFile()); Previously, weren't we crashing because of ...
5 years, 7 months ago (2015-05-07 21:17:10 UTC) #5
hshi1
https://codereview.chromium.org/1137483002/diff/1/content/common/gpu/media/vaapi_wrapper.cc File content/common/gpu/media/vaapi_wrapper.cc (right): https://codereview.chromium.org/1137483002/diff/1/content/common/gpu/media/vaapi_wrapper.cc#newcode325 content/common/gpu/media/vaapi_wrapper.cc:325: va_display_ = vaGetDisplayDRM(drm_file_.Get().GetPlatformFile()); On 2015/05/07 21:17:09, dnicoara wrote: > ...
5 years, 7 months ago (2015-05-07 21:50:17 UTC) #6
dnicoara
https://codereview.chromium.org/1137483002/diff/1/content/common/gpu/media/vaapi_wrapper.cc File content/common/gpu/media/vaapi_wrapper.cc (right): https://codereview.chromium.org/1137483002/diff/1/content/common/gpu/media/vaapi_wrapper.cc#newcode325 content/common/gpu/media/vaapi_wrapper.cc:325: va_display_ = vaGetDisplayDRM(drm_file_.Get().GetPlatformFile()); On 2015/05/07 21:50:17, hshi1 wrote: > ...
5 years, 7 months ago (2015-05-07 22:04:27 UTC) #7
hshi1
On 2015/05/07 22:04:27, dnicoara wrote: > https://codereview.chromium.org/1137483002/diff/1/content/common/gpu/media/vaapi_wrapper.cc > File content/common/gpu/media/vaapi_wrapper.cc (right): > > https://codereview.chromium.org/1137483002/diff/1/content/common/gpu/media/vaapi_wrapper.cc#newcode325 > ...
5 years, 7 months ago (2015-05-07 22:06:50 UTC) #8
piman
On Thu, May 7, 2015 at 3:04 PM, <dnicoara@chromium.org> wrote: > > > https://codereview.chromium.org/1137483002/diff/1/content/common/gpu/media/vaapi_wrapper.cc > ...
5 years, 7 months ago (2015-05-07 22:07:26 UTC) #9
hshi1
On 2015/05/07 22:07:26, piman (Very slow to review) wrote: > Unless something has changed, we ...
5 years, 7 months ago (2015-05-07 23:10:52 UTC) #10
hshi1
To answer dnicoara@'s earlier question: it makes no difference whether we dupe or re-use the ...
5 years, 7 months ago (2015-05-08 00:40:38 UTC) #11
Pawel Osciak
Did you have a chance to verify HW acceleration still works with this and that ...
5 years, 7 months ago (2015-05-08 01:17:21 UTC) #12
hshi1
On 2015/05/08 01:17:21, Pawel Osciak wrote: > Did you have a chance to verify HW ...
5 years, 7 months ago (2015-05-08 01:19:00 UTC) #13
Pawel Osciak
On 2015/05/08 01:19:00, hshi1 wrote: > On 2015/05/08 01:17:21, Pawel Osciak wrote: > > Did ...
5 years, 7 months ago (2015-05-08 01:32:46 UTC) #14
piman
On 2015/05/08 00:40:38, hshi1 wrote: > To answer dnicoara@'s earlier question: it makes no difference ...
5 years, 7 months ago (2015-05-08 01:53:04 UTC) #15
dnicoara
On 2015/05/08 01:32:46, Pawel Osciak wrote: > On 2015/05/08 01:19:00, hshi1 wrote: > > On ...
5 years, 7 months ago (2015-05-08 14:16:29 UTC) #16
dnicoara
On 2015/05/08 00:40:38, hshi1 wrote: > To answer dnicoara@'s earlier question: it makes no difference ...
5 years, 7 months ago (2015-05-08 14:20:01 UTC) #17
hshi1
PTAL Patch Set #4. This defines a global refcounted VADisplayState instance that ensures VADisplay is ...
5 years, 7 months ago (2015-05-08 23:36:55 UTC) #18
hshi1
On 2015/05/08 23:36:55, hshi1 wrote: > PTAL Patch Set #4. > > This defines a ...
5 years, 7 months ago (2015-05-09 01:40:22 UTC) #19
Pawel Osciak
https://codereview.chromium.org/1137483002/diff/70001/content/common/gpu/media/vaapi_wrapper.h File content/common/gpu/media/vaapi_wrapper.h (right): https://codereview.chromium.org/1137483002/diff/70001/content/common/gpu/media/vaapi_wrapper.h#newcode217 content/common/gpu/media/vaapi_wrapper.h:217: // |va_lock_| must be held on entry. va_lock_ is ...
5 years, 7 months ago (2015-05-11 05:51:45 UTC) #21
hshi1
https://codereview.chromium.org/1137483002/diff/70001/content/common/gpu/media/vaapi_wrapper.h File content/common/gpu/media/vaapi_wrapper.h (right): https://codereview.chromium.org/1137483002/diff/70001/content/common/gpu/media/vaapi_wrapper.h#newcode217 content/common/gpu/media/vaapi_wrapper.h:217: // |va_lock_| must be held on entry. On 2015/05/11 ...
5 years, 7 months ago (2015-05-11 17:14:39 UTC) #22
piman
https://codereview.chromium.org/1137483002/diff/90001/content/common/gpu/media/vaapi_wrapper.cc File content/common/gpu/media/vaapi_wrapper.cc (right): https://codereview.chromium.org/1137483002/diff/90001/content/common/gpu/media/vaapi_wrapper.cc#newcode1159 content/common/gpu/media/vaapi_wrapper.cc:1159: drm_fd_.reset(dup(fd)); nit: dup needs to be wrapped into a ...
5 years, 7 months ago (2015-05-11 21:54:07 UTC) #23
hshi1
https://codereview.chromium.org/1137483002/diff/90001/content/common/gpu/media/vaapi_wrapper.cc File content/common/gpu/media/vaapi_wrapper.cc (right): https://codereview.chromium.org/1137483002/diff/90001/content/common/gpu/media/vaapi_wrapper.cc#newcode1159 content/common/gpu/media/vaapi_wrapper.cc:1159: drm_fd_.reset(dup(fd)); On 2015/05/11 21:54:07, piman (Very slow to review) ...
5 years, 7 months ago (2015-05-11 22:26:40 UTC) #24
piman
lgtm
5 years, 7 months ago (2015-05-11 23:22:08 UTC) #25
hshi1
https://codereview.chromium.org/1137483002/diff/110001/content/common/gpu/media/vaapi_wrapper.h File content/common/gpu/media/vaapi_wrapper.h (right): https://codereview.chromium.org/1137483002/diff/110001/content/common/gpu/media/vaapi_wrapper.h#newcode222 content/common/gpu/media/vaapi_wrapper.h:222: VADisplay GetVADisplay() const { return va_display_; } note: minor ...
5 years, 7 months ago (2015-05-11 23:33:02 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1137483002/130001
5 years, 7 months ago (2015-05-11 23:38:59 UTC) #29
hshi1
On 2015/05/11 23:38:59, I haz the power (commit-bot) wrote: > CQ is trying da patch. ...
5 years, 7 months ago (2015-05-11 23:49:52 UTC) #31
Pawel Osciak
https://codereview.chromium.org/1137483002/diff/130001/content/common/gpu/media/vaapi_wrapper.cc File content/common/gpu/media/vaapi_wrapper.cc (right): https://codereview.chromium.org/1137483002/diff/130001/content/common/gpu/media/vaapi_wrapper.cc#newcode328 content/common/gpu/media/vaapi_wrapper.cc:328: VA_LOG_ON_ERROR(va_res, "vaInitialize failed"); Please move this to Initialize() and ...
5 years, 7 months ago (2015-05-12 01:39:39 UTC) #32
hshi1
https://codereview.chromium.org/1137483002/diff/130001/content/common/gpu/media/vaapi_wrapper.cc File content/common/gpu/media/vaapi_wrapper.cc (right): https://codereview.chromium.org/1137483002/diff/130001/content/common/gpu/media/vaapi_wrapper.cc#newcode328 content/common/gpu/media/vaapi_wrapper.cc:328: VA_LOG_ON_ERROR(va_res, "vaInitialize failed"); On 2015/05/12 01:39:39, Pawel Osciak wrote: ...
5 years, 7 months ago (2015-05-12 01:58:10 UTC) #33
hshi1
https://codereview.chromium.org/1137483002/diff/130001/content/common/gpu/media/vaapi_wrapper.cc File content/common/gpu/media/vaapi_wrapper.cc (right): https://codereview.chromium.org/1137483002/diff/130001/content/common/gpu/media/vaapi_wrapper.cc#newcode1034 content/common/gpu/media/vaapi_wrapper.cc:1034: va_display_state_.Get().SetDrmFd(drm_file.GetPlatformFile()); On 2015/05/12 01:39:39, Pawel Osciak wrote: > if ...
5 years, 7 months ago (2015-05-12 02:05:26 UTC) #34
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1137483002/130002
5 years, 7 months ago (2015-05-12 15:35:59 UTC) #37
commit-bot: I haz the power
Committed patchset #9 (id:130002)
5 years, 7 months ago (2015-05-12 15:40:01 UTC) #38
commit-bot: I haz the power
5 years, 7 months ago (2015-05-12 15:40:53 UTC) #39
Message was sent while issue was closed.
Patchset 9 (id:??) landed as
https://crrev.com/9583705f893683561b847feeaac48522f14dab34
Cr-Commit-Position: refs/heads/master@{#329410}

Powered by Google App Engine
This is Rietveld 408576698