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

Issue 10843058: VAVDA: Destroy vaapi buffers after we're done drawing. (Closed)

Created:
8 years, 4 months ago by marcheu
Modified:
8 years, 4 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, jam, apatrick_chromium, feature-media-reviews_chromium.org
Base URL:
https://git.chromium.org/git/chromium/src@master
Visibility:
Public.

Description

VAVDA: Cleanups and fixes. This CL does some cleanups and fixes: - Destroy vaapi buffers after we're done drawing.If we do this before we're done drawing, the memory can be reclaimed by other threads in the meantime and result in interesting use-after-free bugs. - Don't leak buffers when we go through the error path. - Don't leak buffers when we Reset(). - Fix a small indentation. BUG=chromium-os:33170, chromium:139755 TEST=by hand Change-Id: Icd44bd52c5b6c8f32d904ad2980d19a090f01e38 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=150010

Patch Set 1 #

Total comments: 6

Patch Set 2 : Patch 2 #

Patch Set 3 : Patch 3 #

Total comments: 5

Patch Set 4 : Patch 4, adresses nits. #

Total comments: 1

Patch Set 5 : Also plug Destroy() leaks. #

Total comments: 3

Patch Set 6 : Fix locking v1 #

Patch Set 7 : Did the locking in a separate CL. #

Total comments: 1

Patch Set 8 : Take Ami's comments into account. #

Total comments: 2

Patch Set 9 : More cleanups. #

Patch Set 10 : Cleanup const placement and stale comment. #

Patch Set 11 : Fix character inversion. #

Total comments: 1

Patch Set 12 : Fix MakeCurrent #

Unified diffs Side-by-side diffs Delta from patch set Stats (+20 lines, -6 lines) Patch
M content/common/gpu/media/gpu_video_decode_accelerator.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -1 line 0 comments Download
M content/common/gpu/media/omx_video_decode_accelerator.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +5 lines, -2 lines 0 comments Download
M content/common/gpu/media/omx_video_decode_accelerator.cc View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +10 lines, -1 line 0 comments Download
M content/common/gpu/media/video_decode_accelerator_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +3 lines, -2 lines 0 comments Download

Messages

Total messages: 24 (0 generated)
marcheu
8 years, 4 months ago (2012-08-02 23:24:41 UTC) #1
Ami GONE FROM CHROMIUM
LGTM Is the separation of the buffer sets purely aesthetic or is it doing something ...
8 years, 4 months ago (2012-08-02 23:36:41 UTC) #2
piman
https://chromiumcodereview.appspot.com/10843058/diff/1/content/common/gpu/media/vaapi_h264_decoder.cc File content/common/gpu/media/vaapi_h264_decoder.cc (right): https://chromiumcodereview.appspot.com/10843058/diff/1/content/common/gpu/media/vaapi_h264_decoder.cc#newcode1035 content/common/gpu/media/vaapi_h264_decoder.cc:1035: VA_SUCCESS_OR_RETURN(va_res, "vaRenderPicture for va_bufs failed", false); Can't we have ...
8 years, 4 months ago (2012-08-02 23:36:42 UTC) #3
Pawel Osciak
lgtm https://chromiumcodereview.appspot.com/10843058/diff/1/content/common/gpu/media/vaapi_h264_decoder.cc File content/common/gpu/media/vaapi_h264_decoder.cc (right): https://chromiumcodereview.appspot.com/10843058/diff/1/content/common/gpu/media/vaapi_h264_decoder.cc#newcode1035 content/common/gpu/media/vaapi_h264_decoder.cc:1035: VA_SUCCESS_OR_RETURN(va_res, "vaRenderPicture for va_bufs failed", false); On 2012/08/02 ...
8 years, 4 months ago (2012-08-03 02:13:20 UTC) #4
Pawel Osciak
On 2012/08/03 02:13:20, posciak wrote: > lgtm > > https://chromiumcodereview.appspot.com/10843058/diff/1/content/common/gpu/media/vaapi_h264_decoder.cc > File content/common/gpu/media/vaapi_h264_decoder.cc (right): > ...
8 years, 4 months ago (2012-08-03 02:14:07 UTC) #5
marcheu
New version which takes care of all the leaks I could find, please let me ...
8 years, 4 months ago (2012-08-03 03:27:34 UTC) #6
piman
some minor nits. https://chromiumcodereview.appspot.com/10843058/diff/3002/content/common/gpu/media/vaapi_h264_decoder.cc File content/common/gpu/media/vaapi_h264_decoder.cc (right): https://chromiumcodereview.appspot.com/10843058/diff/3002/content/common/gpu/media/vaapi_h264_decoder.cc#newcode34 content/common/gpu/media/vaapi_h264_decoder.cc:34: #define VA_ERROR_RETURN(va_res, err_msg, ret) \ TBH, ...
8 years, 4 months ago (2012-08-03 03:55:40 UTC) #7
Pawel Osciak
https://chromiumcodereview.appspot.com/10843058/diff/3002/content/common/gpu/media/vaapi_h264_decoder.cc File content/common/gpu/media/vaapi_h264_decoder.cc (right): https://chromiumcodereview.appspot.com/10843058/diff/3002/content/common/gpu/media/vaapi_h264_decoder.cc#newcode1086 content/common/gpu/media/vaapi_h264_decoder.cc:1086: pending_slice_bufs_.pop(); Perhaps we should wrap each buffer into a ...
8 years, 4 months ago (2012-08-03 04:15:02 UTC) #8
Pawel Osciak
On 2012/08/03 04:15:02, posciak wrote: > https://chromiumcodereview.appspot.com/10843058/diff/3002/content/common/gpu/media/vaapi_h264_decoder.cc > File content/common/gpu/media/vaapi_h264_decoder.cc (right): > > https://chromiumcodereview.appspot.com/10843058/diff/3002/content/common/gpu/media/vaapi_h264_decoder.cc#newcode1086 > ...
8 years, 4 months ago (2012-08-03 16:48:26 UTC) #9
marcheu
On 2012/08/03 16:48:26, posciak wrote: > On 2012/08/03 04:15:02, posciak wrote: > > > https://chromiumcodereview.appspot.com/10843058/diff/3002/content/common/gpu/media/vaapi_h264_decoder.cc ...
8 years, 4 months ago (2012-08-03 17:23:49 UTC) #10
marcheu
On 2012/08/03 04:15:02, posciak wrote: > https://chromiumcodereview.appspot.com/10843058/diff/3002/content/common/gpu/media/vaapi_h264_decoder.cc > File content/common/gpu/media/vaapi_h264_decoder.cc (right): > > https://chromiumcodereview.appspot.com/10843058/diff/3002/content/common/gpu/media/vaapi_h264_decoder.cc#newcode1086 > ...
8 years, 4 months ago (2012-08-03 17:25:13 UTC) #11
Pawel Osciak
On 2012/08/03 17:25:13, marcheu wrote: > On 2012/08/03 04:15:02, posciak wrote: > > > https://chromiumcodereview.appspot.com/10843058/diff/3002/content/common/gpu/media/vaapi_h264_decoder.cc ...
8 years, 4 months ago (2012-08-03 17:52:50 UTC) #12
Pawel Osciak
On 2012/08/03 17:23:49, marcheu wrote: > On 2012/08/03 16:48:26, posciak wrote: > > On 2012/08/03 ...
8 years, 4 months ago (2012-08-03 17:53:28 UTC) #13
Pawel Osciak
The Destroy() path needs to clean up the pending_*_buffers as well. FTR: this is a ...
8 years, 4 months ago (2012-08-03 18:06:39 UTC) #14
marcheu
On 2012/08/03 18:06:39, posciak wrote: > The Destroy() path needs to clean up the pending_*_buffers ...
8 years, 4 months ago (2012-08-03 19:25:58 UTC) #15
Ami GONE FROM CHROMIUM
https://chromiumcodereview.appspot.com/10843058/diff/10002/content/common/gpu/media/vaapi_h264_decoder.cc File content/common/gpu/media/vaapi_h264_decoder.cc (right): https://chromiumcodereview.appspot.com/10843058/diff/10002/content/common/gpu/media/vaapi_h264_decoder.cc#newcode34 content/common/gpu/media/vaapi_h264_decoder.cc:34: #define VA_LOG_ERROR(va_res, err_msg) \ It would be easier to ...
8 years, 4 months ago (2012-08-03 19:39:22 UTC) #16
Pawel Osciak
lgtm https://chromiumcodereview.appspot.com/10843058/diff/14003/content/common/gpu/media/vaapi_h264_decoder.cc File content/common/gpu/media/vaapi_h264_decoder.cc (right): https://chromiumcodereview.appspot.com/10843058/diff/14003/content/common/gpu/media/vaapi_h264_decoder.cc#newcode429 content/common/gpu/media/vaapi_h264_decoder.cc:429: DestroyPendingBuffers(); This should only be required in one ...
8 years, 4 months ago (2012-08-03 20:57:13 UTC) #17
piman
https://chromiumcodereview.appspot.com/10843058/diff/10003/content/common/gpu/media/vaapi_h264_decoder.cc File content/common/gpu/media/vaapi_h264_decoder.cc (right): https://chromiumcodereview.appspot.com/10843058/diff/10003/content/common/gpu/media/vaapi_h264_decoder.cc#newcode612 content/common/gpu/media/vaapi_h264_decoder.cc:612: GetRequiredNumOfPictures()), false)); Let's not go overboard here, this is ...
8 years, 4 months ago (2012-08-03 22:29:46 UTC) #18
Ami GONE FROM CHROMIUM
https://chromiumcodereview.appspot.com/10843058/diff/10003/content/common/gpu/media/vaapi_h264_decoder.cc File content/common/gpu/media/vaapi_h264_decoder.cc (right): https://chromiumcodereview.appspot.com/10843058/diff/10003/content/common/gpu/media/vaapi_h264_decoder.cc#newcode612 content/common/gpu/media/vaapi_h264_decoder.cc:612: GetRequiredNumOfPictures()), false)); On 2012/08/03 22:29:46, piman wrote: > Let's ...
8 years, 4 months ago (2012-08-03 22:33:08 UTC) #19
marcheu
More cleanups, let me know!
8 years, 4 months ago (2012-08-04 01:17:31 UTC) #20
piman
lgtm
8 years, 4 months ago (2012-08-04 01:41:35 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/marcheu@chromium.org/10843058/9003
8 years, 4 months ago (2012-08-04 01:42:11 UTC) #22
Pawel Osciak
lgtm with an informative comment. https://chromiumcodereview.appspot.com/10843058/diff/9003/content/common/gpu/media/vaapi_h264_decoder.cc File content/common/gpu/media/vaapi_h264_decoder.cc (right): https://chromiumcodereview.appspot.com/10843058/diff/9003/content/common/gpu/media/vaapi_h264_decoder.cc#newcode611 content/common/gpu/media/vaapi_h264_decoder.cc:611: DVLOG(1) << "Error creating ...
8 years, 4 months ago (2012-08-04 02:43:57 UTC) #23
commit-bot: I haz the power
8 years, 4 months ago (2012-08-04 04:29:26 UTC) #24
Change committed as 150010

Powered by Google App Engine
This is Rietveld 408576698