New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 638647 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Sep 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

ui::GpuService needs to be cleaned up

Project Member Reported by sadrul@chromium.org, Aug 17 2016

Issue description

Quoting Fady:

"""
We are creating a mojo shared buffer handle only to immediately unwrap it and create a base::SharedMemory? Huh?
"""

"""
More weirdness: we create an IO thread inside GpuService instead of using the process' OTHER IO thread. This seems like unnecessary overhead. GpuService should take in a IOTaskRunner, I think WDYT?
"""

"""
Also, I feel like we should revisit all the locking, condition variables and PostTasks. This seems like a lot of overhead compared to what the browser is doing today. I don't understand upon superficial inspection why this is necessary.
"""

ui::GpuService should also talk to mojom::GpuService to actually allocate gpu memory. That is being tracked in  issue 637923 
 
Project Member

Comment 1 by bugdroid1@chromium.org, Aug 19 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/12e259d5a209aa333c5cf748bffcad031e173786

commit 12e259d5a209aa333c5cf748bffcad031e173786
Author: sadrul <sadrul@chromium.org>
Date: Fri Aug 19 01:36:58 2016

services/ui: Use a gpu::GpuChannelHost when creating ui::OutputSurface.

There are two users of ui::OutputSurface, and this change makes things more
correct for both. Because:

. renderer: RenderThreadImpl already creates the GpuChannelHost instance
  synchronously before creating the OutputSurface in non-mus. This does the same
  for mus, instead of potentially delaying the GpuChannelHost creation (or doing
  it in the compositor thread).

. ui or browser: Before this change, SurfaceContextFactory would create the
  OutputSurface, and immediately set it on the Compositor, leading to the
  synchronous creation of GpuChannelHost. This change just makes that more
  obvious, and creates the GpuChannelHost synchronously first before creating
  the OutputSurface.

This change also makes it possible to simplify ui::GpuService to not be usable
from multiple threads.

BUG= 638647 

Review-Url: https://codereview.chromium.org/2257693002
Cr-Commit-Position: refs/heads/master@{#413011}

[modify] https://crrev.com/12e259d5a209aa333c5cf748bffcad031e173786/content/renderer/mus/render_widget_mus_connection.cc
[modify] https://crrev.com/12e259d5a209aa333c5cf748bffcad031e173786/content/renderer/mus/render_widget_mus_connection.h
[modify] https://crrev.com/12e259d5a209aa333c5cf748bffcad031e173786/content/renderer/render_thread_impl.cc
[modify] https://crrev.com/12e259d5a209aa333c5cf748bffcad031e173786/services/ui/demo/bitmap_uploader.cc
[modify] https://crrev.com/12e259d5a209aa333c5cf748bffcad031e173786/services/ui/demo/bitmap_uploader.h
[modify] https://crrev.com/12e259d5a209aa333c5cf748bffcad031e173786/services/ui/demo/mus_demo.cc
[modify] https://crrev.com/12e259d5a209aa333c5cf748bffcad031e173786/services/ui/public/cpp/context_provider.cc
[modify] https://crrev.com/12e259d5a209aa333c5cf748bffcad031e173786/services/ui/public/cpp/context_provider.h
[modify] https://crrev.com/12e259d5a209aa333c5cf748bffcad031e173786/services/ui/public/cpp/gles2_context.cc
[modify] https://crrev.com/12e259d5a209aa333c5cf748bffcad031e173786/services/ui/public/cpp/gles2_context.h
[modify] https://crrev.com/12e259d5a209aa333c5cf748bffcad031e173786/services/ui/public/cpp/output_surface.cc
[modify] https://crrev.com/12e259d5a209aa333c5cf748bffcad031e173786/services/ui/public/cpp/output_surface.h
[modify] https://crrev.com/12e259d5a209aa333c5cf748bffcad031e173786/ui/views/mus/surface_context_factory.cc

Project Member

Comment 2 by bugdroid1@chromium.org, Aug 22 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/75f7dde87bfea8b3eab80814e320c2c528d77224

commit 75f7dde87bfea8b3eab80814e320c2c528d77224
Author: sadrul <sadrul@chromium.org>
Date: Mon Aug 22 23:37:24 2016

services/ui: Allow injecting the IO thread task runner for gpu channel.

Instead of always creating a new thread, allow injecting the IO thread
task runner into the ui::GpuService for the gpu::GpuChannelHost it
creates. This allows chrome browser and renderer processes to inject
their existing IO thread's task runner. A new thread is created only for
other mus apps that do not have their own IO thread.

BUG= 638647 

Review-Url: https://codereview.chromium.org/2249413004
Cr-Commit-Position: refs/heads/master@{#413583}

[modify] https://crrev.com/75f7dde87bfea8b3eab80814e320c2c528d77224/ash/mus/window_manager_application.cc
[modify] https://crrev.com/75f7dde87bfea8b3eab80814e320c2c528d77224/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.cc
[modify] https://crrev.com/75f7dde87bfea8b3eab80814e320c2c528d77224/content/renderer/render_thread_impl.cc
[modify] https://crrev.com/75f7dde87bfea8b3eab80814e320c2c528d77224/services/ui/demo/mus_demo.cc
[modify] https://crrev.com/75f7dde87bfea8b3eab80814e320c2c528d77224/services/ui/public/cpp/gpu_service.cc
[modify] https://crrev.com/75f7dde87bfea8b3eab80814e320c2c528d77224/services/ui/public/cpp/gpu_service.h
[modify] https://crrev.com/75f7dde87bfea8b3eab80814e320c2c528d77224/ui/views/mus/window_manager_connection.cc
[modify] https://crrev.com/75f7dde87bfea8b3eab80814e320c2c528d77224/ui/views/mus/window_manager_connection.h

Project Member

Comment 3 by bugdroid1@chromium.org, Aug 23 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/46dc962ad711cfb0f576ff8a210e5bb25730071e

commit 46dc962ad711cfb0f576ff8a210e5bb25730071e
Author: sadrul <sadrul@chromium.org>
Date: Tue Aug 23 14:36:46 2016

services/ui: GpuService should only be used from a single thread.

Simplify GpuService, and make it usable from only one thread.

BUG= 638647 

Review-Url: https://codereview.chromium.org/2257713002
Cr-Commit-Position: refs/heads/master@{#413735}

[modify] https://crrev.com/46dc962ad711cfb0f576ff8a210e5bb25730071e/services/ui/public/cpp/gpu_service.cc
[modify] https://crrev.com/46dc962ad711cfb0f576ff8a210e5bb25730071e/services/ui/public/cpp/gpu_service.h

Comment 4 by sadrul@chromium.org, Aug 25 2016

Labels: Proj-Mustash-Mus-GPU
Status: Fixed (was: Started)
Components: -MUS Internals>Services>WindowService

Sign in to add a comment