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

Issue 1043233003: ozone: Add post message loop initialization hook (Closed)

Created:
5 years, 8 months ago by vignatti (out of this project)
Modified:
5 years, 8 months ago
CC:
chromium-reviews, ozone-reviews_chromium.org, darin-cc_chromium.org, jam, kalyank, piman+watch_chromium.org, Paweł Hajdan Jr., Sergiy Byelozyorov
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

ozone: Add post message loop initialization hook InitializeForGpuPostMainLoop initializes the subsystems/resources necessary for the GPU process, after the message loop is started. This is used mainly for initialization tasks that need to take a reference to the UI thread MessageLoopProxy. InitializeForGPU() necessarily needs to be called first. Main motivation for such change is to fix those unit tests that needs to initialize GL without yet message loop has been initialized. So we broke the Ozone GPU process initialization in two now, post and pre message loop initialized. BUG=450919 TEST=gpu_unittests, content_unittests, gl_tests (need small changes tho, coming next) chrome and ozone_demo on GBM platform

Patch Set 1 #

Total comments: 4

Patch Set 2 : address spang's comments #

Patch Set 3 : rebase #

Patch Set 4 : fix typo #

Patch Set 5 : init at GLSurface::InitializeOneOffInternal #

Patch Set 6 : add DCHECK #

Patch Set 7 : return without failing #

Unified diffs Side-by-side diffs Delta from patch set Stats (+34 lines, -1 line) Patch
M ui/gl/gl_surface_ozone.cc View 1 2 3 4 2 chunks +2 lines, -0 lines 0 comments Download
M ui/ozone/platform/caca/ozone_platform_caca.cc View 1 1 chunk +2 lines, -0 lines 0 comments Download
M ui/ozone/platform/drm/ozone_platform_drm.cc View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M ui/ozone/platform/drm/ozone_platform_gbm.cc View 1 2 3 4 1 chunk +3 lines, -0 lines 0 comments Download
M ui/ozone/platform/egltest/ozone_platform_egltest.cc View 1 1 chunk +2 lines, -0 lines 0 comments Download
M ui/ozone/platform/test/ozone_platform_test.cc View 1 1 chunk +2 lines, -0 lines 0 comments Download
M ui/ozone/public/ozone_platform.h View 1 2 chunks +7 lines, -0 lines 0 comments Download
M ui/ozone/public/ozone_platform.cc View 1 2 3 4 5 6 3 chunks +14 lines, -1 line 0 comments Download

Messages

Total messages: 33 (6 generated)
vignatti (out of this project)
spang@, dnicoara@ PTAL. In the public API, I left the UI part out for now ...
5 years, 8 months ago (2015-03-31 20:47:49 UTC) #2
spang
Do the tests pass now? Also, do we really need two different calls inside content/gpu? ...
5 years, 8 months ago (2015-03-31 20:58:49 UTC) #3
spang
On 2015/03/31 20:58:49, spang wrote: > Do the tests pass now? Your CL description does ...
5 years, 8 months ago (2015-03-31 21:02:02 UTC) #4
vignatti (out of this project)
On 2015/03/31 20:58:49, spang wrote: > Do the tests pass now? > > Also, do ...
5 years, 8 months ago (2015-04-01 16:20:45 UTC) #5
vignatti (out of this project)
kbr@ PTAL for content/gpu https://codereview.chromium.org/1043233003/diff/1/ui/ozone/public/ozone_platform.cc File ui/ozone/public/ozone_platform.cc (right): https://codereview.chromium.org/1043233003/diff/1/ui/ozone/public/ozone_platform.cc#newcode61 ui/ozone/public/ozone_platform.cc:61: << "OzonePlatform is not initialized"; ...
5 years, 8 months ago (2015-04-01 16:26:12 UTC) #7
spang
lgtm
5 years, 8 months ago (2015-04-01 18:25:14 UTC) #8
vignatti (out of this project)
adding piman@ for content/gpu review (who might be more aware about this changes than kbr@). ...
5 years, 8 months ago (2015-04-01 20:01:37 UTC) #10
Ken Russell (switch to Gerrit)
The #ifdefs sprinkled in content/gpu are unfortunate. Could you fold this into the implementation of ...
5 years, 8 months ago (2015-04-01 21:21:56 UTC) #11
piman
On Wed, Apr 1, 2015 at 2:21 PM, <kbr@chromium.org> wrote: > The #ifdefs sprinkled in ...
5 years, 8 months ago (2015-04-01 22:29:49 UTC) #12
vignatti (out of this project)
On 2015/04/01 22:29:49, piman (Very slow to review) wrote: > On Wed, Apr 1, 2015 ...
5 years, 8 months ago (2015-04-02 00:21:24 UTC) #13
piman
On Wed, Apr 1, 2015 at 5:21 PM, <tiago.vignatti@intel.com> wrote: > On 2015/04/01 22:29:49, piman ...
5 years, 8 months ago (2015-04-02 00:25:34 UTC) #14
spang
On 2015/04/02 00:25:34, piman (Very slow to review) wrote: > On Wed, Apr 1, 2015 ...
5 years, 8 months ago (2015-04-02 00:44:23 UTC) #15
Ken Russell (switch to Gerrit)
On 2015/04/02 00:44:23, spang wrote: > On 2015/04/02 00:25:34, piman (Very slow to review) wrote: ...
5 years, 8 months ago (2015-04-02 00:58:39 UTC) #16
vignatti (out of this project)
On 2015/04/02 00:58:39, Ken Russell wrote: > On 2015/04/02 00:44:23, spang wrote: > > > ...
5 years, 8 months ago (2015-04-02 19:17:57 UTC) #17
piman
LGTM, you can add a DCHECK(base::MessageLoop::current()) to check that a message loop has indeed been ...
5 years, 8 months ago (2015-04-02 19:26:25 UTC) #18
Ken Russell (switch to Gerrit)
LGTM too. +1 on adding the DCHECK. The bots build with dcheck_always_on=1 so they should ...
5 years, 8 months ago (2015-04-02 19:29:26 UTC) #19
vignatti (out of this project)
On 2015/04/02 19:29:26, Ken Russell wrote: > LGTM too. +1 on adding the DCHECK. The ...
5 years, 8 months ago (2015-04-02 19:42:51 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1043233003/100001
5 years, 8 months ago (2015-04-02 19:43:04 UTC) #23
spang
On 2015/04/02 19:43:04, I haz the power (commit-bot) wrote: > CQ is trying da patch. ...
5 years, 8 months ago (2015-04-02 20:27:14 UTC) #25
vignatti (out of this project)
On 2015/04/02 20:27:14, spang wrote: > On 2015/04/02 19:43:04, I haz the power (commit-bot) wrote: ...
5 years, 8 months ago (2015-04-02 20:38:35 UTC) #26
vignatti (out of this project)
one possible idea is just to return without failing in the new hook when the ...
5 years, 8 months ago (2015-04-02 21:05:48 UTC) #27
Ken Russell (switch to Gerrit)
On 2015/04/02 21:05:48, vignatti wrote: > one possible idea is just to return without failing ...
5 years, 8 months ago (2015-04-02 21:22:50 UTC) #28
vignatti (out of this project)
On 2015/04/02 21:22:50, Ken Russell wrote: > On 2015/04/02 21:05:48, vignatti wrote: > > one ...
5 years, 8 months ago (2015-04-02 21:28:37 UTC) #29
Ken Russell (switch to Gerrit)
On 2015/04/02 21:28:37, vignatti wrote: > On 2015/04/02 21:22:50, Ken Russell wrote: > > On ...
5 years, 8 months ago (2015-04-02 21:40:55 UTC) #30
vignatti (out of this project)
On 2015/04/02 21:40:55, Ken Russell wrote: > > sky@ has completely valid points that the ...
5 years, 8 months ago (2015-04-08 21:53:33 UTC) #31
spang
On 2015/04/08 21:53:33, vignatti wrote: > On 2015/04/02 21:40:55, Ken Russell wrote: > > > ...
5 years, 8 months ago (2015-04-08 22:22:52 UTC) #32
vignatti (out of this project)
5 years, 8 months ago (2015-04-08 22:26:35 UTC) #33
On 2015/04/08 22:22:52, spang wrote:
> On 2015/04/08 21:53:33, vignatti wrote:
> > On 2015/04/02 21:40:55, Ken Russell wrote:
> > > 
> > > sky@ has completely valid points that the creation of the MessageLoop that
> > early
> > > in content_test_suite is going to cause problems for tests based on that
> suite
> > > which instantiate MessageLoops themselves.
> > > 
> > > I don't know what to advise. There are 13 callers of
> > > gfx::GLSurface::InitializeOneOff() in the code base and your original fix
> will
> > > require all of them to be duplicated, which is bad from a maintenance
> > > standpoint. As you mentioned before, maybe you should figure out a way to
> make
> > > the initialization which has to occur after MessageLoop initialization
> > > idempotent and do it lazily. Not sure. Please give this more thought.
> > 
> > Hi back. Per offline discussions I had with spang@ (summarized in
> > https://code.google.com/p/chromium/issues/detail?id=471261#c3), I'll
withdraw
> my
> > original motivation on adding the InitializeForGpuPostMainLoop here. I.e. we
> > don't want this new hook for fixing the unit tests above mentioned actually.
> > 
> > spang@, right now I'm failing to see a real use case for
> > InitializeForGpuPostMainLoop. Do you think we should pursue this still (or
the
> > UIPostMainLoop) for any other reason? If I'm not mistake chrome target using
> dri
> > platform fails for this kind of issue but I'm not sure. Any other idea for
> > fixing up crbug.com/450919?
> 
> Bug 450919 was originally meant for the browser process UI thread which has
> different issues than you're fixing here.
> 
> I would leave it.

ok, thanks. I'm closing this for now then.

Powered by Google App Engine
This is Rietveld 408576698