Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Side by Side Diff: ui/ozone/platform/drm/gpu/drm_device.h

Issue 1914343003: Reland: ash: reset color management when new screens are hotplugged (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add an error when trying to set a gamma table without driver support Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 153
154 virtual bool UnmapDumbBuffer(void* pixels, size_t size); 154 virtual bool UnmapDumbBuffer(void* pixels, size_t size);
155 155
156 virtual bool CloseBufferHandle(uint32_t handle); 156 virtual bool CloseBufferHandle(uint32_t handle);
157 157
158 virtual bool CommitProperties(drmModeAtomicReq* properties, 158 virtual bool CommitProperties(drmModeAtomicReq* properties,
159 uint32_t flags, 159 uint32_t flags,
160 uint32_t crtc_count, 160 uint32_t crtc_count,
161 const PageFlipCallback& callback); 161 const PageFlipCallback& callback);
162 162
163 // Set the gamma ramp for |crtc_id| to reflect the ramps in |lut|.
164 virtual bool SetGammaRamp(uint32_t crtc_id,
165 const std::vector<GammaRampRGBEntry>& lut);
166 virtual bool SetColorCorrection( 163 virtual bool SetColorCorrection(
167 uint32_t crtc_id, 164 uint32_t crtc_id,
168 const std::vector<GammaRampRGBEntry>& degamma_lut, 165 const std::vector<GammaRampRGBEntry>& degamma_lut,
169 const std::vector<GammaRampRGBEntry>& gamma_lut, 166 const std::vector<GammaRampRGBEntry>& gamma_lut,
170 const std::vector<float>& correction_matrix); 167 const std::vector<float>& correction_matrix);
171 168
172 virtual bool SetCapability(uint64_t capability, uint64_t value); 169 virtual bool SetCapability(uint64_t capability, uint64_t value);
173 170
174 // Drm master related 171 // Drm master related
175 virtual bool SetMaster(); 172 virtual bool SetMaster();
176 virtual bool DropMaster(); 173 virtual bool DropMaster();
177 174
178 int get_fd() const { return file_.GetPlatformFile(); } 175 int get_fd() const { return file_.GetPlatformFile(); }
179 176
180 base::FilePath device_path() const { return device_path_; } 177 base::FilePath device_path() const { return device_path_; }
181 178
182 HardwareDisplayPlaneManager* plane_manager() { return plane_manager_.get(); } 179 HardwareDisplayPlaneManager* plane_manager() { return plane_manager_.get(); }
183 180
184 protected: 181 protected:
185 friend class base::RefCountedThreadSafe<DrmDevice>; 182 friend class base::RefCountedThreadSafe<DrmDevice>;
186 183
187 virtual ~DrmDevice(); 184 virtual ~DrmDevice();
188 185
189 std::unique_ptr<HardwareDisplayPlaneManager> plane_manager_; 186 std::unique_ptr<HardwareDisplayPlaneManager> plane_manager_;
190 187
191 private: 188 private:
192 class IOWatcher; 189 class IOWatcher;
193 class PageFlipManager; 190 class PageFlipManager;
194 191
192 bool SetGammaRamp(uint32_t crtc_id,
193 const std::vector<GammaRampRGBEntry>& lut);
194
195 // Path to the DRM device (in sysfs). 195 // Path to the DRM device (in sysfs).
196 const base::FilePath device_path_; 196 const base::FilePath device_path_;
197 197
198 // DRM device. 198 // DRM device.
199 base::File file_; 199 base::File file_;
200 200
201 std::unique_ptr<PageFlipManager> page_flip_manager_; 201 std::unique_ptr<PageFlipManager> page_flip_manager_;
202 202
203 // Watcher for |fd_| listening for page flip events. 203 // Watcher for |fd_| listening for page flip events.
204 std::unique_ptr<IOWatcher> watcher_; 204 std::unique_ptr<IOWatcher> watcher_;
205 205
206 bool is_primary_device_; 206 bool is_primary_device_;
207 207
208 DISALLOW_COPY_AND_ASSIGN(DrmDevice); 208 DISALLOW_COPY_AND_ASSIGN(DrmDevice);
209 }; 209 };
210 210
211 } // namespace ui 211 } // namespace ui
212 212
213 #endif // UI_OZONE_PLATFORM_DRM_GPU_DRM_DEVICE_H_ 213 #endif // UI_OZONE_PLATFORM_DRM_GPU_DRM_DEVICE_H_
OLDNEW
« no previous file with comments | « ash/display/display_color_manager_chromeos_unittest.cc ('k') | ui/ozone/platform/drm/gpu/drm_device.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698