blob: a15a60f77fe3a63eed685197fcb1a9e1028624dc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
// 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_GPU_DRM_UTIL_H_
#define UI_OZONE_PLATFORM_DRM_GPU_DRM_UTIL_H_
#include "base/files/file_path.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_vector.h"
#include "ui/ozone/platform/drm/gpu/scoped_drm_types.h"
typedef struct _drmModeModeInfo drmModeModeInfo;
namespace ui {
class DrmDevice;
class ScreenManager;
// 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);
// Memory maps a DRM buffer.
bool MapDumbBuffer(int fd, uint32_t handle, uint32_t size, void** pixels);
void ForceInitializationOfPrimaryDisplay(const scoped_refptr<DrmDevice>& drm,
ScreenManager* screen_manager);
base::FilePath GetPrimaryDisplayCardPath();
} // namespace ui
#endif // UI_OZONE_PLATFORM_DRM_GPU_DRM_UTIL_H_
|