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

Issue 781683005: Ozone: Avoid blocking in Swapbuffer Call. (Closed)

Created:
6 years ago by kalyank
Modified:
5 years, 11 months ago
CC:
chromium-reviews, ozone-reviews_chromium.org, jam, sievers+watch_chromium.org, jbauman+watch_chromium.org, darin-cc_chromium.org, piman+watch_chromium.org, danakj+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Ozone: Avoid blocking in Swapbuffer Call. Currently, we submit requests for page flip and wait for them to be handled in Main thread. This doesn't allow any other productive work to be done in GPU process while the pageflip events are being handled. This CL moves the wait to worker thread, so we don't block GPU main thread. SwapBufferAck is sent once the pageflip requests are handled.

Patch Set 1 #

Patch Set 2 : Fix comments. #

Total comments: 2

Patch Set 3 : Decouple Swapping Back->Front buffer and PageFlip handling. #

Patch Set 4 : Remove unintended changes. #

Total comments: 14

Patch Set 5 : Review fixes. #

Patch Set 6 : Ozone: Avoid blocking in Swapbuffer Call #

Patch Set 7 : Fix compiler warning. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+228 lines, -28 lines) Patch
M content/common/gpu/image_transport_surface.h View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M content/common/gpu/image_transport_surface.cc View 1 2 3 4 5 2 chunks +9 lines, -11 lines 0 comments Download
M ui/gl/gl_surface.h View 1 2 3 4 5 3 chunks +24 lines, -0 lines 0 comments Download
M ui/gl/gl_surface.cc View 1 2 3 4 5 2 chunks +28 lines, -0 lines 0 comments Download
M ui/gl/gl_surface_ozone.cc View 1 2 3 4 5 2 chunks +7 lines, -3 lines 0 comments Download
M ui/ozone/platform/dri/gbm.gypi View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M ui/ozone/platform/dri/gbm_surface.h View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M ui/ozone/platform/dri/gbm_surface.cc View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M ui/ozone/platform/dri/gbm_surface_factory.h View 1 2 3 4 2 chunks +2 lines, -0 lines 0 comments Download
M ui/ozone/platform/dri/gbm_surface_factory.cc View 1 2 3 4 5 2 chunks +7 lines, -1 line 0 comments Download
M ui/ozone/platform/dri/gbm_surfaceless.h View 1 2 3 4 3 chunks +7 lines, -1 line 0 comments Download
M ui/ozone/platform/dri/gbm_surfaceless.cc View 1 2 3 4 3 chunks +14 lines, -3 lines 0 comments Download
M ui/ozone/platform/dri/hardware_display_controller.cc View 1 2 3 4 5 6 2 chunks +3 lines, -9 lines 0 comments Download
A ui/ozone/platform/dri/page_flip_event_handler.h View 1 2 3 4 1 chunk +54 lines, -0 lines 0 comments Download
A ui/ozone/platform/dri/page_flip_event_handler.cc View 1 2 3 4 1 chunk +51 lines, -0 lines 1 comment Download
M ui/ozone/platform/egltest/ozone_platform_egltest.cc View 1 2 1 chunk +3 lines, -0 lines 0 comments Download
M ui/ozone/public/surface_ozone_egl.h View 1 2 3 4 5 2 chunks +10 lines, -0 lines 0 comments Download

Messages

Total messages: 36 (4 generated)
kalyank
Still need to check results on all hardware, looking for initial feedback.
6 years ago (2014-12-05 15:51:26 UTC) #2
kalyank
6 years ago (2014-12-05 15:51:42 UTC) #3
marcheu
What I'd rather like to see is the page flip not block instead. triple buffering ...
6 years ago (2014-12-05 17:05:44 UTC) #4
alexst (slow to review)
On 2014/12/05 17:05:44, marcheu wrote: > What I'd rather like to see is the page ...
6 years ago (2014-12-05 18:49:47 UTC) #5
alexst (slow to review)
+albert
6 years ago (2014-12-05 18:50:20 UTC) #7
dnicoara
I'm wondering if we can add that ack into VSyncProvider?
6 years ago (2014-12-05 19:06:50 UTC) #8
achaulk
https://codereview.chromium.org/781683005/diff/20001/content/browser/compositor/buffer_queue.cc File content/browser/compositor/buffer_queue.cc (left): https://codereview.chromium.org/781683005/diff/20001/content/browser/compositor/buffer_queue.cc#oldcode74 content/browser/compositor/buffer_queue.cc:74: available_surfaces_[i].damage.Union(damage); This would have to stay to handle rare ...
6 years ago (2014-12-05 20:12:20 UTC) #9
kalyank
On 2014/12/05 18:49:47, alexst wrote: > On 2014/12/05 17:05:44, marcheu wrote: > > What I'd ...
6 years ago (2014-12-05 22:30:15 UTC) #10
kalyank
On 2014/12/05 20:12:20, achaulk wrote: > https://codereview.chromium.org/781683005/diff/20001/content/browser/compositor/buffer_queue.cc > File content/browser/compositor/buffer_queue.cc (left): > below, the last ...
6 years ago (2014-12-05 22:57:52 UTC) #11
alexst (slow to review)
On 2014/12/05 22:30:15, kalyank wrote: > On 2014/12/05 18:49:47, alexst wrote: > > On 2014/12/05 ...
6 years ago (2014-12-05 23:07:19 UTC) #12
alexst (slow to review)
Kalyan, were you able to make any progress on this?
6 years ago (2014-12-10 02:21:51 UTC) #13
kalyank
On 2014/12/10 02:21:51, alexst wrote: > Kalyan, were you able to make any progress on ...
6 years ago (2014-12-10 06:02:29 UTC) #14
kalyank
On 2014/12/10 02:21:51, alexst wrote: > Kalyan, were you able to make any progress on ...
6 years ago (2014-12-10 19:00:11 UTC) #15
brianderson
https://codereview.chromium.org/781683005/diff/60001/cc/output/output_surface.h File cc/output/output_surface.h (right): https://codereview.chromium.org/781683005/diff/60001/cc/output/output_surface.h#newcode123 cc/output/output_surface.h:123: virtual void OnPageFlipComplete(); Does this need to be exposed ...
6 years ago (2014-12-10 22:48:05 UTC) #17
alexst (slow to review)
Some quick notes on the current code, but after chatting with Brian, who is our ...
6 years ago (2014-12-10 23:19:25 UTC) #18
jbauman
On 2014/12/05 18:49:47, alexst wrote: > On 2014/12/05 17:05:44, marcheu wrote: > > What I'd ...
6 years ago (2014-12-10 23:38:38 UTC) #19
kalyank
On 2014/12/10 23:19:25, alexst wrote: > Some quick notes on the current code, but after ...
6 years ago (2014-12-11 01:52:36 UTC) #20
kalyank
On 2014/12/11 01:52:36, kalyank wrote: > On 2014/12/10 23:19:25, alexst wrote: > > Some quick ...
6 years ago (2014-12-11 01:55:43 UTC) #21
kalyank
https://codereview.chromium.org/781683005/diff/60001/ui/ozone/platform/dri/gbm_surfaceless.cc File ui/ozone/platform/dri/gbm_surfaceless.cc (right): https://codereview.chromium.org/781683005/diff/60001/ui/ozone/platform/dri/gbm_surfaceless.cc#newcode41 ui/ozone/platform/dri/gbm_surfaceless.cc:41: flip_handler_->EnsurePreviousFlipHandled(); On 2014/12/10 22:48:05, brianderson wrote: > Looks like ...
6 years ago (2014-12-11 03:24:26 UTC) #22
brianderson
What's the timeline for getting this in? Even though the Browser's compositor won't be drawing, ...
6 years ago (2014-12-11 09:27:44 UTC) #23
kalyank
https://codereview.chromium.org/781683005/diff/60001/cc/output/output_surface.h File cc/output/output_surface.h (right): https://codereview.chromium.org/781683005/diff/60001/cc/output/output_surface.h#newcode123 cc/output/output_surface.h:123: virtual void OnPageFlipComplete(); On 2014/12/10 22:48:05, brianderson wrote: > ...
6 years ago (2014-12-11 12:55:59 UTC) #24
kalyank
On 2014/12/11 09:27:44, brianderson wrote: Sorry missed this. > What's the timeline for getting this ...
6 years ago (2014-12-11 18:30:17 UTC) #25
marcheu
On 2014/12/11 18:30:17, kalyank wrote: > On 2014/12/11 09:27:44, brianderson wrote: > Sorry missed this. ...
6 years ago (2014-12-11 19:15:46 UTC) #26
brianderson
On 2014/12/11 19:15:46, marcheu wrote: > On 2014/12/11 18:30:17, kalyank wrote: > > On 2014/12/11 ...
6 years ago (2014-12-11 19:28:21 UTC) #27
kalyank
On 2014/12/11 19:15:46, marcheu wrote: > On 2014/12/11 18:30:17, kalyank wrote: > > On 2014/12/11 ...
6 years ago (2014-12-12 18:30:37 UTC) #28
kalyank
On 2014/12/10 23:19:25, alexst(OOTO until Dec 16) wrote: > Some quick notes on the current ...
6 years ago (2014-12-12 18:32:26 UTC) #29
marcheu
6 years ago (2014-12-12 18:56:03 UTC) #30
marcheu
On 2014/12/12 18:30:37, kalyank wrote: > On 2014/12/11 19:15:46, marcheu wrote: > > On 2014/12/11 ...
6 years ago (2014-12-12 19:00:21 UTC) #31
kalyank
On 2014/12/12 19:00:21, marcheu wrote: > On 2014/12/12 18:30:37, kalyank wrote: > > On 2014/12/11 ...
6 years ago (2014-12-12 21:36:29 UTC) #32
alexst (slow to review)
https://codereview.chromium.org/781683005/diff/120001/ui/ozone/platform/dri/page_flip_event_handler.cc File ui/ozone/platform/dri/page_flip_event_handler.cc (right): https://codereview.chromium.org/781683005/diff/120001/ui/ozone/platform/dri/page_flip_event_handler.cc#newcode45 ui/ozone/platform/dri/page_flip_event_handler.cc:45: controller->WaitForPageFlipEvent(); Hi Kalyan, thank you for your help, this ...
6 years ago (2014-12-17 19:12:24 UTC) #33
kalyank
On 2014/12/17 19:12:24, alexst wrote: > https://codereview.chromium.org/781683005/diff/120001/ui/ozone/platform/dri/page_flip_event_handler.cc > File ui/ozone/platform/dri/page_flip_event_handler.cc (right): > > https://codereview.chromium.org/781683005/diff/120001/ui/ozone/platform/dri/page_flip_event_handler.cc#newcode45 > ...
6 years ago (2014-12-17 20:49:15 UTC) #34
kalyank
6 years ago (2014-12-18 10:27:28 UTC) #35
On 2014/12/17 20:49:15, kalyank wrote:
> On 2014/12/17 19:12:24, alexst wrote:
> >
>
https://codereview.chromium.org/781683005/diff/120001/ui/ozone/platform/dri/p...
> > File ui/ozone/platform/dri/page_flip_event_handler.cc (right):
> > 
> >
>
https://codereview.chromium.org/781683005/diff/120001/ui/ozone/platform/dri/p...
> > ui/ozone/platform/dri/page_flip_event_handler.cc:45:
> > controller->WaitForPageFlipEvent();
> > Hi Kalyan, thank you for your help, this is very useful. Danny and I have
been
> > discussing this internally and we think we can do this without introducing
an
> > extra thread here. The gpu io message loop has the ability to watch file
> > descriptors and notify us when we can read without blocking. This would
allow
> us
> > to get pageflip events directly from the drm fd asynchronously and dispatch
> them
> > to gpu main while avoiding some of the thread safety subtleties.
> > 
> > controller->WaitForPageFlipEvent() for example, is not thread safe and
> > controller's lifetime is not guaranteed (if a monitor gets unplugged, bad
> things
> > could happen here), so this will require addition of locks and subtle
> > crossthread lifetime management we'd like to avoid.
> > 
> > I like the content/ and ui/gl parts of this patch, let's split them out and
> land
> > them separately because they will enable this async behaviour. Meanwhile,
> we'll
> > get cranking on the ozone/platform/ part that uses IO thread.
> 
> Sure, I will split the ui/gl parts

https://codereview.chromium.org/797843005/  for the ui/gl parts.

Created a bug for this
https://code.google.com/p/chromium/issues/detail?id=443543
I  dont have access rights to edit and add all of you here as cc :(

Powered by Google App Engine
This is Rietveld 408576698