| 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_CRTC_CONTROLLER_H_ | 5 #ifndef UI_OZONE_PLATFORM_DRM_GPU_CRTC_CONTROLLER_H_ |
| 6 #define UI_OZONE_PLATFORM_DRM_GPU_CRTC_CONTROLLER_H_ | 6 #define UI_OZONE_PLATFORM_DRM_GPU_CRTC_CONTROLLER_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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 // Schedule a page flip event and present the overlays in |planes|. | 51 // Schedule a page flip event and present the overlays in |planes|. |
| 52 bool SchedulePageFlip(HardwareDisplayPlaneList* plane_list, | 52 bool SchedulePageFlip(HardwareDisplayPlaneList* plane_list, |
| 53 const OverlayPlaneList& planes, | 53 const OverlayPlaneList& planes, |
| 54 bool test_only, | 54 bool test_only, |
| 55 scoped_refptr<PageFlipRequest> page_flip_request); | 55 scoped_refptr<PageFlipRequest> page_flip_request); |
| 56 | 56 |
| 57 // Returns true if hardware plane with z_order equal to |z_order| can support | 57 // Returns true if hardware plane with z_order equal to |z_order| can support |
| 58 // |fourcc_format| format. | 58 // |fourcc_format| format. |
| 59 bool IsFormatSupported(uint32_t fourcc_format, uint32_t z_order) const; | 59 bool IsFormatSupported(uint32_t fourcc_format, uint32_t z_order) const; |
| 60 | 60 |
| 61 // Returns a vector of format modifiers for the given fourcc format |
| 62 // on this CRTCs primary plane. A format modifier describes the |
| 63 // actual layout of the buffer, such as whether it's linear, tiled |
| 64 // one way or another or maybe compressed. Except for generic |
| 65 // modifiers such as DRM_FORMAT_MOD_NONE (linear), the modifier |
| 66 // values are 64 bit values that we don't understand at this |
| 67 // level. We pass the modifers to gbm_bo_create_with_modifiers() and |
| 68 // gbm will pick a modifier as it allocates the bo. |
| 69 std::vector<uint64_t> GetFormatModifiers(uint32_t fourcc_format); |
| 70 |
| 61 // Called if the page flip event wasn't scheduled (ie: page flip fails). This | 71 // Called if the page flip event wasn't scheduled (ie: page flip fails). This |
| 62 // will then signal the request such that the caller doesn't wait for the | 72 // will then signal the request such that the caller doesn't wait for the |
| 63 // event forever. | 73 // event forever. |
| 64 void SignalPageFlipRequest(gfx::SwapResult result); | 74 void SignalPageFlipRequest(gfx::SwapResult result); |
| 65 | 75 |
| 66 // Called when the page flip event occurred. The event is provided by the | 76 // Called when the page flip event occurred. The event is provided by the |
| 67 // kernel when a VBlank event finished. This allows the controller to | 77 // kernel when a VBlank event finished. This allows the controller to |
| 68 // update internal state and propagate the update to the surface. | 78 // update internal state and propagate the update to the surface. |
| 69 // The tuple (seconds, useconds) represents the event timestamp. |seconds| | 79 // The tuple (seconds, useconds) represents the event timestamp. |seconds| |
| 70 // represents the number of seconds while |useconds| represents the | 80 // represents the number of seconds while |useconds| represents the |
| (...skipping 30 matching lines...) Expand all Loading... |
| 101 | 111 |
| 102 // The time of the last page flip event as reported by the kernel callback. | 112 // The time of the last page flip event as reported by the kernel callback. |
| 103 uint64_t time_of_last_flip_ = 0; | 113 uint64_t time_of_last_flip_ = 0; |
| 104 | 114 |
| 105 DISALLOW_COPY_AND_ASSIGN(CrtcController); | 115 DISALLOW_COPY_AND_ASSIGN(CrtcController); |
| 106 }; | 116 }; |
| 107 | 117 |
| 108 } // namespace ui | 118 } // namespace ui |
| 109 | 119 |
| 110 #endif // UI_OZONE_PLATFORM_DRM_GPU_CRTC_CONTROLLER_H_ | 120 #endif // UI_OZONE_PLATFORM_DRM_GPU_CRTC_CONTROLLER_H_ |
| OLD | NEW |