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

Side by Side Diff: ui/ozone/platform/drm/common/client_native_pixmap_dmabuf.cc

Issue 2768343002: Change namespace from ui to gfx for NativePixmap related code (Closed)
Patch Set: Addressed sadrul's remark Created 3 years, 9 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 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 <linux/version.h> 8 #include <linux/version.h>
9 #include <stddef.h> 9 #include <stddef.h>
10 #include <sys/mman.h> 10 #include <sys/mman.h>
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 struct local_dma_buf_sync sync_end = {0}; 55 struct local_dma_buf_sync sync_end = {0};
56 56
57 sync_end.flags = LOCAL_DMA_BUF_SYNC_END | LOCAL_DMA_BUF_SYNC_RW; 57 sync_end.flags = LOCAL_DMA_BUF_SYNC_END | LOCAL_DMA_BUF_SYNC_RW;
58 if (drmIoctl(dmabuf_fd, LOCAL_DMA_BUF_IOCTL_SYNC, &sync_end)) 58 if (drmIoctl(dmabuf_fd, LOCAL_DMA_BUF_IOCTL_SYNC, &sync_end))
59 PLOG(ERROR) << "Failed DMA_BUF_SYNC_END"; 59 PLOG(ERROR) << "Failed DMA_BUF_SYNC_END";
60 } 60 }
61 61
62 } // namespace 62 } // namespace
63 63
64 // static 64 // static
65 std::unique_ptr<ClientNativePixmap> ClientNativePixmapDmaBuf::ImportFromDmabuf( 65 std::unique_ptr<gfx::ClientNativePixmap>
66 ClientNativePixmapDmaBuf::ImportFromDmabuf(
66 const gfx::NativePixmapHandle& handle, 67 const gfx::NativePixmapHandle& handle,
67 const gfx::Size& size) { 68 const gfx::Size& size) {
68 return base::WrapUnique(new ClientNativePixmapDmaBuf(handle, size)); 69 return base::WrapUnique(new ClientNativePixmapDmaBuf(handle, size));
69 } 70 }
70 71
71 ClientNativePixmapDmaBuf::ClientNativePixmapDmaBuf( 72 ClientNativePixmapDmaBuf::ClientNativePixmapDmaBuf(
72 const gfx::NativePixmapHandle& handle, 73 const gfx::NativePixmapHandle& handle,
73 const gfx::Size& size) 74 const gfx::Size& size)
74 : pixmap_handle_(handle), size_(size), data_{0} { 75 : pixmap_handle_(handle), size_(size), data_{0} {
75 TRACE_EVENT0("drm", "ClientNativePixmapDmaBuf"); 76 TRACE_EVENT0("drm", "ClientNativePixmapDmaBuf");
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 uint8_t* address = reinterpret_cast<uint8_t*>(data_); 141 uint8_t* address = reinterpret_cast<uint8_t*>(data_);
141 return address + pixmap_handle_.planes[plane].offset; 142 return address + pixmap_handle_.planes[plane].offset;
142 } 143 }
143 144
144 int ClientNativePixmapDmaBuf::GetStride(size_t plane) const { 145 int ClientNativePixmapDmaBuf::GetStride(size_t plane) const {
145 DCHECK_LT(plane, pixmap_handle_.planes.size()); 146 DCHECK_LT(plane, pixmap_handle_.planes.size());
146 return pixmap_handle_.planes[plane].stride; 147 return pixmap_handle_.planes[plane].stride;
147 } 148 }
148 149
149 } // namespace ui 150 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/drm/common/client_native_pixmap_dmabuf.h ('k') | ui/ozone/platform/drm/gpu/gbm_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698