| 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_MANAGER_H_ | 5 #ifndef UI_OZONE_PLATFORM_DRM_GPU_HARDWARE_DISPLAY_PLANE_MANAGER_H_ |
| 6 #define UI_OZONE_PLATFORM_DRM_GPU_HARDWARE_DISPLAY_PLANE_MANAGER_H_ | 6 #define UI_OZONE_PLATFORM_DRM_GPU_HARDWARE_DISPLAY_PLANE_MANAGER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 #include <xf86drmMode.h> | 10 #include <xf86drmMode.h> |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 int framebuffer; | 57 int framebuffer; |
| 58 gfx::Rect bounds; | 58 gfx::Rect bounds; |
| 59 gfx::Rect src_rect; | 59 gfx::Rect src_rect; |
| 60 }; | 60 }; |
| 61 std::vector<Plane> planes; | 61 std::vector<Plane> planes; |
| 62 }; | 62 }; |
| 63 // In the case of non-atomic operation, this info will be used for | 63 // In the case of non-atomic operation, this info will be used for |
| 64 // pageflipping. | 64 // pageflipping. |
| 65 std::vector<PageFlipInfo> legacy_page_flips; | 65 std::vector<PageFlipInfo> legacy_page_flips; |
| 66 | 66 |
| 67 #if defined(OZONE_USE_ATOMIC) |
| 68 ScopedDrmPropertySetPtr atomic_property_set; |
| 69 #endif // defined(OZONE_USE_ATOMIC) |
| 70 |
| 67 // Set if the last operation on this list was a Commit(). | 71 // Set if the last operation on this list was a Commit(). |
| 68 bool committed; | 72 bool committed; |
| 69 }; | 73 }; |
| 70 | 74 |
| 71 class OZONE_EXPORT HardwareDisplayPlaneManager { | 75 class OZONE_EXPORT HardwareDisplayPlaneManager { |
| 72 public: | 76 public: |
| 73 HardwareDisplayPlaneManager(); | 77 HardwareDisplayPlaneManager(); |
| 74 virtual ~HardwareDisplayPlaneManager(); | 78 virtual ~HardwareDisplayPlaneManager(); |
| 75 | 79 |
| 76 // This parses information from the drm driver, adding any new planes | 80 // This parses information from the drm driver, adding any new planes |
| (...skipping 17 matching lines...) Expand all Loading... |
| 94 | 98 |
| 95 const ScopedVector<HardwareDisplayPlane>& planes() { return planes_; } | 99 const ScopedVector<HardwareDisplayPlane>& planes() { return planes_; } |
| 96 | 100 |
| 97 protected: | 101 protected: |
| 98 virtual bool SetPlaneData(HardwareDisplayPlaneList* plane_list, | 102 virtual bool SetPlaneData(HardwareDisplayPlaneList* plane_list, |
| 99 HardwareDisplayPlane* hw_plane, | 103 HardwareDisplayPlane* hw_plane, |
| 100 const OverlayPlane& overlay, | 104 const OverlayPlane& overlay, |
| 101 uint32_t crtc_id, | 105 uint32_t crtc_id, |
| 102 const gfx::Rect& src_rect, | 106 const gfx::Rect& src_rect, |
| 103 CrtcController* crtc) = 0; | 107 CrtcController* crtc) = 0; |
| 108 |
| 109 virtual scoped_ptr<HardwareDisplayPlane> CreatePlane(uint32_t plane_id, |
| 110 uint32_t possible_crtcs); |
| 111 |
| 104 // Finds the plane located at or after |*index| that is not in use and can | 112 // Finds the plane located at or after |*index| that is not in use and can |
| 105 // be used with |crtc_index|. | 113 // be used with |crtc_index|. |
| 106 HardwareDisplayPlane* FindNextUnusedPlane(size_t* index, uint32_t crtc_index); | 114 HardwareDisplayPlane* FindNextUnusedPlane(size_t* index, uint32_t crtc_index); |
| 107 | 115 |
| 108 // Convert |crtc_id| into an index, returning -1 if the ID couldn't be found. | 116 // Convert |crtc_id| into an index, returning -1 if the ID couldn't be found. |
| 109 int LookupCrtcIndex(uint32_t crtc_id); | 117 int LookupCrtcIndex(uint32_t crtc_id); |
| 110 | 118 |
| 111 // Object containing the connection to the graphics device and wraps the API | 119 // Object containing the connection to the graphics device and wraps the API |
| 112 // calls to control it. Not owned. | 120 // calls to control it. Not owned. |
| 113 DrmDevice* drm_; | 121 DrmDevice* drm_; |
| 114 | 122 |
| 115 ScopedVector<HardwareDisplayPlane> planes_; | 123 ScopedVector<HardwareDisplayPlane> planes_; |
| 116 std::vector<uint32_t> crtcs_; | 124 std::vector<uint32_t> crtcs_; |
| 117 | 125 |
| 118 DISALLOW_COPY_AND_ASSIGN(HardwareDisplayPlaneManager); | 126 DISALLOW_COPY_AND_ASSIGN(HardwareDisplayPlaneManager); |
| 119 }; | 127 }; |
| 120 | 128 |
| 121 } // namespace ui | 129 } // namespace ui |
| 122 | 130 |
| 123 #endif // UI_OZONE_PLATFORM_DRM_GPU_HARDWARE_DISPLAY_PLANE_MANAGER_H_ | 131 #endif // UI_OZONE_PLATFORM_DRM_GPU_HARDWARE_DISPLAY_PLANE_MANAGER_H_ |
| OLD | NEW |