| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_DRM_DISPLAY_H_ | 5 #ifndef UI_OZONE_PLATFORM_DRM_GPU_DRM_DISPLAY_H_ |
| 6 #define UI_OZONE_PLATFORM_DRM_GPU_DRM_DISPLAY_H_ | 6 #define UI_OZONE_PLATFORM_DRM_GPU_DRM_DISPLAY_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "ui/display/types/display_constants.h" | 11 #include "ui/display/types/display_constants.h" |
| 12 #include "ui/gfx/geometry/point.h" |
| 13 #include "ui/ozone/common/gpu/ozone_gpu_message_params.h" |
| 12 | 14 |
| 13 typedef struct _drmModeModeInfo drmModeModeInfo; | 15 typedef struct _drmModeModeInfo drmModeModeInfo; |
| 14 | 16 |
| 15 namespace gfx { | |
| 16 class Point; | |
| 17 } | |
| 18 | |
| 19 namespace ui { | 17 namespace ui { |
| 20 | 18 |
| 21 class DrmDevice; | 19 class DrmDevice; |
| 20 class HardwareDisplayControllerInfo; |
| 22 class ScreenManager; | 21 class ScreenManager; |
| 23 | 22 |
| 24 struct GammaRampRGBEntry; | 23 struct GammaRampRGBEntry; |
| 25 | 24 |
| 26 class DrmDisplay { | 25 class DrmDisplay { |
| 27 public: | 26 public: |
| 28 DrmDisplay(ScreenManager* screen_manager, | 27 DrmDisplay(ScreenManager* screen_manager, |
| 29 int64_t display_id, | 28 const scoped_refptr<DrmDevice>& drm); |
| 30 const scoped_refptr<DrmDevice>& drm, | |
| 31 uint32_t crtc, | |
| 32 uint32_t connector, | |
| 33 const std::vector<drmModeModeInfo>& modes); | |
| 34 ~DrmDisplay(); | 29 ~DrmDisplay(); |
| 35 | 30 |
| 36 int64_t display_id() const { return display_id_; } | 31 int64_t display_id() const { return display_id_; } |
| 37 scoped_refptr<DrmDevice> drm() const { return drm_; } | 32 scoped_refptr<DrmDevice> drm() const { return drm_; } |
| 38 uint32_t crtc() const { return crtc_; } | 33 uint32_t crtc() const { return crtc_; } |
| 39 uint32_t connector() const { return connector_; } | 34 uint32_t connector() const { return connector_; } |
| 40 const std::vector<drmModeModeInfo>& modes() const { return modes_; } | 35 const std::vector<drmModeModeInfo>& modes() const { return modes_; } |
| 41 | 36 |
| 37 DisplaySnapshot_Params Update(HardwareDisplayControllerInfo* info, |
| 38 size_t display_index); |
| 39 |
| 42 bool Configure(const drmModeModeInfo* mode, const gfx::Point& origin); | 40 bool Configure(const drmModeModeInfo* mode, const gfx::Point& origin); |
| 43 bool GetHDCPState(HDCPState* state); | 41 bool GetHDCPState(HDCPState* state); |
| 44 bool SetHDCPState(HDCPState state); | 42 bool SetHDCPState(HDCPState state); |
| 45 void SetGammaRamp(const std::vector<GammaRampRGBEntry>& lut); | 43 void SetGammaRamp(const std::vector<GammaRampRGBEntry>& lut); |
| 46 | 44 |
| 47 private: | 45 private: |
| 48 ScreenManager* screen_manager_; // Not owned. | 46 ScreenManager* screen_manager_; // Not owned. |
| 49 | 47 |
| 50 int64_t display_id_; | 48 int64_t display_id_; |
| 51 scoped_refptr<DrmDevice> drm_; | 49 scoped_refptr<DrmDevice> drm_; |
| 52 uint32_t crtc_; | 50 uint32_t crtc_; |
| 53 uint32_t connector_; | 51 uint32_t connector_; |
| 54 std::vector<drmModeModeInfo> modes_; | 52 std::vector<drmModeModeInfo> modes_; |
| 53 gfx::Point origin_; |
| 55 | 54 |
| 56 DISALLOW_COPY_AND_ASSIGN(DrmDisplay); | 55 DISALLOW_COPY_AND_ASSIGN(DrmDisplay); |
| 57 }; | 56 }; |
| 58 | 57 |
| 59 } // namespace ui | 58 } // namespace ui |
| 60 | 59 |
| 61 #endif // UI_OZONE_PLATFORM_DRM_GPU_DRM_DISPLAY_H_ | 60 #endif // UI_OZONE_PLATFORM_DRM_GPU_DRM_DISPLAY_H_ |
| OLD | NEW |