Chromium Code Reviews| 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 |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "ui/ozone/platform/drm/common/scoped_drm_types.h" | 14 #include "ui/ozone/platform/drm/common/scoped_drm_types.h" |
| 15 | 15 |
| 16 namespace ui { | 16 namespace ui { |
| 17 | 17 |
| 18 class DrmDevice; | 18 class DrmDevice; |
| 19 | 19 |
| 20 class HardwareDisplayPlane { | 20 class HardwareDisplayPlane { |
| 21 public: | 21 public: |
| 22 enum Type { kDummy, kPrimary, kOverlay, kCursor }; | 22 enum Type { kDummy, kPrimary, kOverlay, kCursor }; |
| 23 | 23 |
| 24 HardwareDisplayPlane(uint32_t plane_id, uint32_t possible_crtcs); | 24 HardwareDisplayPlane(uint32_t plane_id, uint32_t possible_crtcs); |
| 25 | 25 |
| 26 virtual ~HardwareDisplayPlane(); | 26 virtual ~HardwareDisplayPlane(); |
| 27 | 27 |
| 28 bool Initialize(DrmDevice* drm, | 28 bool Initialize(DrmDevice* drm, |
| 29 const std::vector<uint32_t>& formats, | 29 const std::vector<uint32_t>& formats, |
| 30 const std::vector<struct drm_format_modifier>& format_info, | |
|
Daniele Castagna
2016/12/20 18:03:29
should we typedef drm_format modifier?
hoegsberg1
2016/12/22 23:05:21
Fixed by including xf86drmMode.h in the right plac
| |
| 30 bool is_dummy, | 31 bool is_dummy, |
| 31 bool test_only); | 32 bool test_only); |
| 32 | 33 |
| 33 bool IsSupportedFormat(uint32_t format); | 34 bool IsSupportedFormat(uint32_t format); |
| 34 | 35 |
| 36 std::vector<uint64_t> ModifiersForFormat(uint32_t format); | |
| 37 | |
| 35 bool CanUseForCrtc(uint32_t crtc_index); | 38 bool CanUseForCrtc(uint32_t crtc_index); |
| 36 | 39 |
| 37 bool in_use() const { return in_use_; } | 40 bool in_use() const { return in_use_; } |
| 38 void set_in_use(bool in_use) { in_use_ = in_use; } | 41 void set_in_use(bool in_use) { in_use_ = in_use; } |
| 39 | 42 |
| 40 uint32_t plane_id() const { return plane_id_; } | 43 uint32_t plane_id() const { return plane_id_; } |
| 41 | 44 |
| 42 Type type() const { return type_; } | 45 Type type() const { return type_; } |
| 43 | 46 |
| 44 void set_owning_crtc(uint32_t crtc) { owning_crtc_ = crtc; } | 47 void set_owning_crtc(uint32_t crtc) { owning_crtc_ = crtc; } |
| 45 uint32_t owning_crtc() const { return owning_crtc_; } | 48 uint32_t owning_crtc() const { return owning_crtc_; } |
| 46 | 49 |
| 47 const std::vector<uint32_t>& supported_formats() const; | 50 const std::vector<uint32_t>& supported_formats() const; |
| 48 | 51 |
| 49 protected: | 52 protected: |
| 50 virtual bool InitializeProperties( | 53 virtual bool InitializeProperties( |
| 51 DrmDevice* drm, | 54 DrmDevice* drm, |
| 52 const ScopedDrmObjectPropertyPtr& plane_props); | 55 const ScopedDrmObjectPropertyPtr& plane_props); |
| 53 | 56 |
| 54 uint32_t plane_id_ = 0; | 57 uint32_t plane_id_ = 0; |
| 55 uint32_t possible_crtcs_ = 0; | 58 uint32_t possible_crtcs_ = 0; |
| 56 uint32_t owning_crtc_ = 0; | 59 uint32_t owning_crtc_ = 0; |
| 57 uint32_t last_used_format_ = 0; | 60 uint32_t last_used_format_ = 0; |
| 58 bool in_use_ = false; | 61 bool in_use_ = false; |
| 59 Type type_ = kPrimary; | 62 Type type_ = kPrimary; |
| 60 std::vector<uint32_t> supported_formats_; | 63 std::vector<uint32_t> supported_formats_; |
| 64 std::vector<struct drm_format_modifier> supported_format_modifiers_; | |
| 61 | 65 |
| 62 DISALLOW_COPY_AND_ASSIGN(HardwareDisplayPlane); | 66 DISALLOW_COPY_AND_ASSIGN(HardwareDisplayPlane); |
| 63 }; | 67 }; |
| 64 | 68 |
| 65 } // namespace ui | 69 } // namespace ui |
| 66 | 70 |
| 67 #endif // UI_OZONE_PLATFORM_DRM_GPU_HARDWARE_DISPLAY_PLANE_H_ | 71 #endif // UI_OZONE_PLATFORM_DRM_GPU_HARDWARE_DISPLAY_PLANE_H_ |
| OLD | NEW |