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

Unified Diff: ui/ozone/platform/drm/common/drm_util.h

Issue 1285183008: Ozone integration. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: add missing license header Created 5 years, 4 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
Index: ui/ozone/platform/drm/common/drm_util.h
diff --git a/ui/ozone/platform/drm/common/drm_util.h b/ui/ozone/platform/drm/common/drm_util.h
new file mode 100644
index 0000000000000000000000000000000000000000..e761aba2d354bf0bfef2418494d93e1e06504026
--- /dev/null
+++ b/ui/ozone/platform/drm/common/drm_util.h
@@ -0,0 +1,61 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_OZONE_PLATFORM_DRM_COMMON_DRM_UTIL_H_
+#define UI_OZONE_PLATFORM_DRM_COMMON_DRM_UTIL_H_
+
+#include "base/files/file_path.h"
+#include "base/macros.h"
+#include "base/memory/scoped_vector.h"
+#include "ui/ozone/common/gpu/ozone_gpu_message_params.h"
+#include "ui/ozone/platform/drm/common/scoped_drm_types.h"
+
+typedef struct _drmModeModeInfo drmModeModeInfo;
+
+namespace gfx {
+class Point;
+}
+
+namespace ui {
+
+// Representation of the information required to initialize and configure a
+// native display.
+class HardwareDisplayControllerInfo {
+ public:
+ HardwareDisplayControllerInfo(ScopedDrmConnectorPtr connector,
+ ScopedDrmCrtcPtr crtc);
+ ~HardwareDisplayControllerInfo();
+
+ drmModeConnector* connector() const { return connector_.get(); }
+ drmModeCrtc* crtc() const { return crtc_.get(); }
+
+ private:
+ ScopedDrmConnectorPtr connector_;
+ ScopedDrmCrtcPtr crtc_;
+
+ DISALLOW_COPY_AND_ASSIGN(HardwareDisplayControllerInfo);
+};
+
+// Looks-up and parses the native display configurations returning all available
+// displays.
+ScopedVector<HardwareDisplayControllerInfo> GetAvailableDisplayControllerInfos(
+ int fd);
+
+bool SameMode(const drmModeModeInfo& lhs, const drmModeModeInfo& rhs);
+
+DisplayMode_Params CreateDisplayModeParams(const drmModeModeInfo& mode);
+
+// |info| provides the DRM information related to the display, |fd| is the
+// connection to the DRM device and |index| provides a unique identifier for the
+// display. |index| will be used to generate the display id (it may be the id if
+// the monitor's EDID lacks the necessary identifiers).
+DisplaySnapshot_Params CreateDisplaySnapshotParams(
+ HardwareDisplayControllerInfo* info,
+ int fd,
+ size_t display_index,
+ const gfx::Point& origin);
+
+} // namespace ui
+
+#endif // UI_OZONE_PLATFORM_DRM_COMMON_DRM_UTIL_H_
« no previous file with comments | « ui/ozone/platform/drm/common/drm_gpu_test_helper_inprocess.cc ('k') | ui/ozone/platform/drm/common/drm_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698