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 #include "ui/ozone/platform/drm/gpu/drm_device.h" | 5 #include "ui/ozone/platform/drm/gpu/drm_device.h" |
6 | 6 |
7 #include <fcntl.h> | 7 #include <fcntl.h> |
8 #include <sys/mman.h> | 8 #include <sys/mman.h> |
9 #include <unistd.h> | 9 #include <unistd.h> |
10 #include <xf86drm.h> | 10 #include <xf86drm.h> |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 uint64_t next_id_; | 345 uint64_t next_id_; |
346 | 346 |
347 std::vector<PageFlip> callbacks_; | 347 std::vector<PageFlip> callbacks_; |
348 | 348 |
349 DISALLOW_COPY_AND_ASSIGN(PageFlipManager); | 349 DISALLOW_COPY_AND_ASSIGN(PageFlipManager); |
350 }; | 350 }; |
351 | 351 |
352 class DrmDevice::IOWatcher : public base::MessagePumpLibevent::Watcher { | 352 class DrmDevice::IOWatcher : public base::MessagePumpLibevent::Watcher { |
353 public: | 353 public: |
354 IOWatcher(int fd, DrmDevice::PageFlipManager* page_flip_manager) | 354 IOWatcher(int fd, DrmDevice::PageFlipManager* page_flip_manager) |
355 : page_flip_manager_(page_flip_manager), fd_(fd) { | 355 : page_flip_manager_(page_flip_manager), controller_(FROM_HERE), fd_(fd) { |
356 Register(); | 356 Register(); |
357 } | 357 } |
358 | 358 |
359 ~IOWatcher() override { Unregister(); } | 359 ~IOWatcher() override { Unregister(); } |
360 | 360 |
361 private: | 361 private: |
362 void Register() { | 362 void Register() { |
363 DCHECK(base::MessageLoopForIO::IsCurrent()); | 363 DCHECK(base::MessageLoopForIO::IsCurrent()); |
364 base::MessageLoopForIO::current()->WatchFileDescriptor( | 364 base::MessageLoopForIO::current()->WatchFileDescriptor( |
365 fd_, true, base::MessageLoopForIO::WATCH_READ, &controller_, this); | 365 fd_, true, base::MessageLoopForIO::WATCH_READ, &controller_, this); |
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
818 reinterpret_cast<unsigned char*>(ctm_blob_data.get()), | 818 reinterpret_cast<unsigned char*>(ctm_blob_data.get()), |
819 sizeof(DrmColorCtm))) | 819 sizeof(DrmColorCtm))) |
820 return false; | 820 return false; |
821 } | 821 } |
822 } | 822 } |
823 | 823 |
824 return true; | 824 return true; |
825 } | 825 } |
826 | 826 |
827 } // namespace ui | 827 } // namespace ui |
OLD | NEW |