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

Unified Diff: ui/ozone/platform/dri/native_display_delegate_proxy.cc

Issue 854203002: Read EDID for the 1st display for startup (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months 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
« no previous file with comments | « ui/ozone/platform/dri/display_snapshot_dri.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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, &params);
+ }
- 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(&params)) {
+ DCHECK_NE(DISPLAY_CONNECTION_TYPE_NONE, params.type);
displays_.push_back(new DriDisplaySnapshotProxy(params, display_manager_));
has_dummy_display_ = true;
}
« no previous file with comments | « ui/ozone/platform/dri/display_snapshot_dri.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698