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

Unified Diff: ui/ozone/platform/drm/host/drm_display_host_manager.cc

Issue 2459973002: Expedite discovery of primary DRM device. (Closed)
Patch Set: Add more comments. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/ozone/platform/drm/host/drm_display_host_manager.cc
diff --git a/ui/ozone/platform/drm/host/drm_display_host_manager.cc b/ui/ozone/platform/drm/host/drm_display_host_manager.cc
index 0e7085450396da04388d80f209c91e7b4857caef..17b959cd514706ad7cb6d71a722066fa3342fb5e 100644
--- a/ui/ozone/platform/drm/host/drm_display_host_manager.cc
+++ b/ui/ozone/platform/drm/host/drm_display_host_manager.cc
@@ -306,28 +306,7 @@ void DrmDisplayHostManager::OnRemoveGraphicsDevice(
ProcessEvent();
}
-void DrmDisplayHostManager::OnGpuThreadReady() {
- // If in the middle of a configuration, just respond with the old list of
- // displays. This is fine, since after the DRM resources are initialized and
- // IPC-ed to the GPU NotifyDisplayDelegate() is called to let the display
- // delegate know that the display configuration changed and it needs to
- // update it again.
- if (!get_displays_callback_.is_null()) {
- base::ThreadTaskRunnerHandle::Get()->PostTask(
- FROM_HERE,
- base::Bind(&DrmDisplayHostManager::RunUpdateDisplaysCallback,
- weak_ptr_factory_.GetWeakPtr(), get_displays_callback_));
- get_displays_callback_.Reset();
- }
-
- // Signal that we're taking DRM master since we're going through the
- // initialization process again and we'll take all the available resources.
- if (!take_display_control_callback_.is_null())
- GpuTookDisplayControl(true);
-
- if (!relinquish_display_control_callback_.is_null())
- GpuRelinquishedDisplayControl(false);
-
+void DrmDisplayHostManager::OnGpuProcessLaunched() {
std::unique_ptr<DrmDeviceHandle> handle =
std::move(primary_drm_device_handle_);
{
@@ -349,6 +328,29 @@ void DrmDisplayHostManager::OnGpuThreadReady() {
// state.
proxy_->GpuAddGraphicsDevice(drm_devices_[primary_graphics_card_path_],
base::FileDescriptor(handle->PassFD()));
+}
+
+void DrmDisplayHostManager::OnGpuThreadReady() {
+ // If in the middle of a configuration, just respond with the old list of
+ // displays. This is fine, since after the DRM resources are initialized and
+ // IPC-ed to the GPU NotifyDisplayDelegate() is called to let the display
+ // delegate know that the display configuration changed and it needs to
+ // update it again.
+ if (!get_displays_callback_.is_null()) {
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE,
+ base::Bind(&DrmDisplayHostManager::RunUpdateDisplaysCallback,
+ weak_ptr_factory_.GetWeakPtr(), get_displays_callback_));
+ get_displays_callback_.Reset();
+ }
+
+ // Signal that we're taking DRM master since we're going through the
+ // initialization process again and we'll take all the available resources.
+ if (!take_display_control_callback_.is_null())
+ GpuTookDisplayControl(true);
+
+ if (!relinquish_display_control_callback_.is_null())
+ GpuRelinquishedDisplayControl(false);
device_manager_->ScanDevices(this);
NotifyDisplayDelegate();
« no previous file with comments | « ui/ozone/platform/drm/host/drm_display_host_manager.h ('k') | ui/ozone/platform/drm/host/drm_gpu_platform_support_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698