Index: ui/ozone/platform/dri/native_display_delegate_proxy.cc |
diff --git a/ui/ozone/platform/dri/native_display_delegate_proxy.cc b/ui/ozone/platform/dri/native_display_delegate_proxy.cc |
index 29dc53805c62c6218fc9bb638bcf6360b65f6080..8ad2c40a46aa54222e93193ae09460c9290a125d 100644 |
--- a/ui/ozone/platform/dri/native_display_delegate_proxy.cc |
+++ b/ui/ozone/platform/dri/native_display_delegate_proxy.cc |
@@ -7,6 +7,7 @@ |
#include <stdio.h> |
#include "base/logging.h" |
+#include "base/threading/thread_restrictions.h" |
#include "ui/display/types/display_snapshot.h" |
#include "ui/display/types/native_display_observer.h" |
#include "ui/events/ozone/device/device_event.h" |
@@ -63,9 +64,22 @@ void NativeDisplayDelegateProxy::Initialize() { |
if (!displays_.empty()) |
return; |
+ DisplaySnapshot_Params params; |
+ bool success = false; |
+ { |
+ // The file generated by frecon that contains EDID for the 1st display. |
+ const base::FilePath kEDIDFile("/tmp/display_info.bin"); |
+ |
+ // Just read it on current thread as this is necessary information |
+ // to start. This access only tmpfs, which is fast. |
+ // TODO(dnicoara|oshima): crbug.com/450886. |
+ base::ThreadRestrictions::ScopedAllowIO allow_io; |
+ success = CreateSnapshotFromEDIDFile(kEDIDFile, ¶ms); |
+ } |
- DisplaySnapshot_Params params = CreateSnapshotFromCommandLine(); |
- if (params.type != DISPLAY_CONNECTION_TYPE_NONE) { |
+ // Fallback to command line if the file doesn't exit or failed to read. |
+ if (success || CreateSnapshotFromCommandLine(¶ms)) { |
+ DCHECK_NE(DISPLAY_CONNECTION_TYPE_NONE, params.type); |
displays_.push_back(new DriDisplaySnapshotProxy(params, display_manager_)); |
has_dummy_display_ = true; |
} |