| 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_DRM_DEVICE_H_ | 5 #ifndef UI_OZONE_PLATFORM_DRM_GPU_DRM_DEVICE_H_ |
| 6 #define UI_OZONE_PLATFORM_DRM_GPU_DRM_DEVICE_H_ | 6 #define UI_OZONE_PLATFORM_DRM_GPU_DRM_DEVICE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 struct SkImageInfo; | 28 struct SkImageInfo; |
| 29 | 29 |
| 30 namespace base { | 30 namespace base { |
| 31 class SingleThreadTaskRunner; | 31 class SingleThreadTaskRunner; |
| 32 } // namespace base | 32 } // namespace base |
| 33 | 33 |
| 34 namespace ui { | 34 namespace ui { |
| 35 | 35 |
| 36 class HardwareDisplayPlaneManager; | 36 class HardwareDisplayPlaneManager; |
| 37 struct GammaRampRGBEntry; | |
| 38 | 37 |
| 39 // Wraps DRM calls into a nice interface. Used to provide different | 38 // Wraps DRM calls into a nice interface. Used to provide different |
| 40 // implementations of the DRM calls. For the actual implementation the DRM API | 39 // implementations of the DRM calls. For the actual implementation the DRM API |
| 41 // would be called. In unit tests this interface would be stubbed. | 40 // would be called. In unit tests this interface would be stubbed. |
| 42 class OZONE_EXPORT DrmDevice : public base::RefCountedThreadSafe<DrmDevice> { | 41 class OZONE_EXPORT DrmDevice : public base::RefCountedThreadSafe<DrmDevice> { |
| 43 public: | 42 public: |
| 44 typedef base::Callback<void(unsigned int /* frame */, | 43 typedef base::Callback<void(unsigned int /* frame */, |
| 45 unsigned int /* seconds */, | 44 unsigned int /* seconds */, |
| 46 unsigned int /* useconds */)> PageFlipCallback; | 45 unsigned int /* useconds */)> PageFlipCallback; |
| 47 | 46 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 virtual bool MapDumbBuffer(uint32_t handle, size_t size, void** pixels); | 153 virtual bool MapDumbBuffer(uint32_t handle, size_t size, void** pixels); |
| 155 | 154 |
| 156 virtual bool UnmapDumbBuffer(void* pixels, size_t size); | 155 virtual bool UnmapDumbBuffer(void* pixels, size_t size); |
| 157 | 156 |
| 158 virtual bool CloseBufferHandle(uint32_t handle); | 157 virtual bool CloseBufferHandle(uint32_t handle); |
| 159 | 158 |
| 160 virtual bool CommitProperties(drmModePropertySet* properties, | 159 virtual bool CommitProperties(drmModePropertySet* properties, |
| 161 uint32_t flags, | 160 uint32_t flags, |
| 162 const PageFlipCallback& callback); | 161 const PageFlipCallback& callback); |
| 163 | 162 |
| 164 // Set the gamma ramp for |crtc_id| to reflect the ramps in |lut|. | |
| 165 virtual bool SetGammaRamp(uint32_t crtc_id, | |
| 166 const std::vector<GammaRampRGBEntry>& lut); | |
| 167 | |
| 168 // Drm master related | 163 // Drm master related |
| 169 virtual bool SetMaster(); | 164 virtual bool SetMaster(); |
| 170 virtual bool DropMaster(); | 165 virtual bool DropMaster(); |
| 171 | 166 |
| 172 int get_fd() const { return file_.GetPlatformFile(); } | 167 int get_fd() const { return file_.GetPlatformFile(); } |
| 173 | 168 |
| 174 base::FilePath device_path() const { return device_path_; } | 169 base::FilePath device_path() const { return device_path_; } |
| 175 | 170 |
| 176 HardwareDisplayPlaneManager* plane_manager() { return plane_manager_.get(); } | 171 HardwareDisplayPlaneManager* plane_manager() { return plane_manager_.get(); } |
| 177 | 172 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 199 scoped_refptr<IOWatcher> watcher_; | 194 scoped_refptr<IOWatcher> watcher_; |
| 200 | 195 |
| 201 scoped_refptr<PageFlipManager> page_flip_manager_; | 196 scoped_refptr<PageFlipManager> page_flip_manager_; |
| 202 | 197 |
| 203 DISALLOW_COPY_AND_ASSIGN(DrmDevice); | 198 DISALLOW_COPY_AND_ASSIGN(DrmDevice); |
| 204 }; | 199 }; |
| 205 | 200 |
| 206 } // namespace ui | 201 } // namespace ui |
| 207 | 202 |
| 208 #endif // UI_OZONE_PLATFORM_DRM_GPU_DRM_DEVICE_H_ | 203 #endif // UI_OZONE_PLATFORM_DRM_GPU_DRM_DEVICE_H_ |
| OLD | NEW |