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