Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/common/client_native_pixmap_dmabuf.h" | 5 #include "ui/ozone/platform/drm/common/client_native_pixmap_dmabuf.h" |
| 6 | 6 |
| 7 #include <fcntl.h> | 7 #include <fcntl.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <sys/mman.h> | 9 #include <sys/mman.h> |
| 10 #include <xf86drm.h> | 10 #include <xf86drm.h> |
| 11 | 11 |
| 12 #include "base/memory/ptr_util.h" | 12 #include "base/memory/ptr_util.h" |
| 13 #include "base/process/memory.h" | 13 #include "base/process/memory.h" |
| 14 #include "base/trace_event/trace_event.h" | 14 #include "base/trace_event/trace_event.h" |
| 15 | 15 |
| 16 #if defined(OS_CHROMEOS) | 16 #if defined(USE_OZONE) |
|
tonikitoo
2016/11/08 13:45:37
quick post mortem note: checking USE_OZONE seems r
| |
| 17 // TODO(vignatti): replace the local definitions below with #include | 17 // TODO(vignatti): replace the local definitions below with #include |
| 18 // <linux/dma-buf.h> once kernel version 4.6 becomes widely used. | 18 // <linux/dma-buf.h> once kernel version 4.6 becomes widely used. |
| 19 #include <linux/types.h> | 19 #include <linux/types.h> |
| 20 | 20 |
| 21 struct local_dma_buf_sync { | 21 struct local_dma_buf_sync { |
| 22 __u64 flags; | 22 __u64 flags; |
| 23 }; | 23 }; |
| 24 | 24 |
| 25 #define LOCAL_DMA_BUF_SYNC_READ (1 << 0) | 25 #define LOCAL_DMA_BUF_SYNC_READ (1 << 0) |
| 26 #define LOCAL_DMA_BUF_SYNC_WRITE (2 << 0) | 26 #define LOCAL_DMA_BUF_SYNC_WRITE (2 << 0) |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 110 uint8_t* address = reinterpret_cast<uint8_t*>(data_); | 110 uint8_t* address = reinterpret_cast<uint8_t*>(data_); |
| 111 return address + pixmap_handle_.planes[plane].offset; | 111 return address + pixmap_handle_.planes[plane].offset; |
| 112 } | 112 } |
| 113 | 113 |
| 114 int ClientNativePixmapDmaBuf::GetStride(size_t plane) const { | 114 int ClientNativePixmapDmaBuf::GetStride(size_t plane) const { |
| 115 DCHECK_LT(plane, pixmap_handle_.planes.size()); | 115 DCHECK_LT(plane, pixmap_handle_.planes.size()); |
| 116 return pixmap_handle_.planes[plane].stride; | 116 return pixmap_handle_.planes[plane].stride; |
| 117 } | 117 } |
| 118 | 118 |
| 119 } // namespace ui | 119 } // namespace ui |
| OLD | NEW |