OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_OZONE_PLATFORM_DRM_GPU_HARDWARE_DISPLAY_PLANE_H_ | 5 #ifndef UI_OZONE_PLATFORM_DRM_GPU_HARDWARE_DISPLAY_PLANE_H_ |
6 #define UI_OZONE_PLATFORM_DRM_GPU_HARDWARE_DISPLAY_PLANE_H_ | 6 #define UI_OZONE_PLATFORM_DRM_GPU_HARDWARE_DISPLAY_PLANE_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 class OZONE_EXPORT HardwareDisplayPlane { | 23 class OZONE_EXPORT HardwareDisplayPlane { |
24 public: | 24 public: |
25 enum Type { kDummy, kPrimary, kOverlay, kCursor }; | 25 enum Type { kDummy, kPrimary, kOverlay, kCursor }; |
26 | 26 |
27 HardwareDisplayPlane(uint32_t plane_id, uint32_t possible_crtcs); | 27 HardwareDisplayPlane(uint32_t plane_id, uint32_t possible_crtcs); |
28 | 28 |
29 virtual ~HardwareDisplayPlane(); | 29 virtual ~HardwareDisplayPlane(); |
30 | 30 |
31 bool Initialize(DrmDevice* drm, | 31 bool Initialize(DrmDevice* drm, |
32 const std::vector<uint32_t>& formats, | 32 const std::vector<uint32_t>& formats, |
33 bool is_dummy); | 33 bool is_dummy, |
| 34 bool test_only); |
34 | 35 |
35 virtual bool IsSupportedFormat(uint32_t format) const; | 36 bool IsSupportedFormat(uint32_t format); |
36 | 37 |
37 bool CanUseForCrtc(uint32_t crtc_index); | 38 bool CanUseForCrtc(uint32_t crtc_index); |
38 | 39 |
39 bool in_use() const { return in_use_; } | 40 bool in_use() const { return in_use_; } |
40 void set_in_use(bool in_use) { in_use_ = in_use; } | 41 void set_in_use(bool in_use) { in_use_ = in_use; } |
41 | 42 |
42 uint32_t plane_id() const { return plane_id_; } | 43 uint32_t plane_id() const { return plane_id_; } |
43 | 44 |
44 Type type() const { return type_; } | 45 Type type() const { return type_; } |
45 | 46 |
46 void set_owning_crtc(uint32_t crtc) { owning_crtc_ = crtc; } | 47 void set_owning_crtc(uint32_t crtc) { owning_crtc_ = crtc; } |
47 uint32_t owning_crtc() const { return owning_crtc_; } | 48 uint32_t owning_crtc() const { return owning_crtc_; } |
48 | 49 |
49 protected: | 50 protected: |
50 virtual bool InitializeProperties( | 51 virtual bool InitializeProperties( |
51 DrmDevice* drm, | 52 DrmDevice* drm, |
52 const ScopedDrmObjectPropertyPtr& plane_props); | 53 const ScopedDrmObjectPropertyPtr& plane_props); |
53 | 54 |
54 uint32_t plane_id_ = 0; | 55 uint32_t plane_id_ = 0; |
55 uint32_t possible_crtcs_ = 0; | 56 uint32_t possible_crtcs_ = 0; |
56 uint32_t owning_crtc_ = 0; | 57 uint32_t owning_crtc_ = 0; |
| 58 uint32_t last_used_format_ = 0; |
57 bool in_use_ = false; | 59 bool in_use_ = false; |
58 Type type_ = kPrimary; | 60 Type type_ = kPrimary; |
59 std::vector<uint32_t> supported_formats_; | 61 std::vector<uint32_t> supported_formats_; |
60 | 62 |
61 DISALLOW_COPY_AND_ASSIGN(HardwareDisplayPlane); | 63 DISALLOW_COPY_AND_ASSIGN(HardwareDisplayPlane); |
62 }; | 64 }; |
63 | 65 |
64 } // namespace ui | 66 } // namespace ui |
65 | 67 |
66 #endif // UI_OZONE_PLATFORM_DRM_GPU_HARDWARE_DISPLAY_PLANE_H_ | 68 #endif // UI_OZONE_PLATFORM_DRM_GPU_HARDWARE_DISPLAY_PLANE_H_ |
OLD | NEW |