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

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

Issue 1906253003: Ozone GBM: i915_gem_end_cpu_access causes crash. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <stddef.h> 8 #include <stddef.h>
9 #include <sys/mman.h> 9 #include <sys/mman.h>
10 #include <xf86drm.h> 10 #include <xf86drm.h>
(...skipping 22 matching lines...) Expand all
33 #endif 33 #endif
34 34
35 namespace ui { 35 namespace ui {
36 36
37 namespace { 37 namespace {
38 38
39 void PrimeSyncStart(int dmabuf_fd) { 39 void PrimeSyncStart(int dmabuf_fd) {
40 struct local_dma_buf_sync sync_start = {0}; 40 struct local_dma_buf_sync sync_start = {0};
41 41
42 sync_start.flags = LOCAL_DMA_BUF_SYNC_START | LOCAL_DMA_BUF_SYNC_READ; 42 sync_start.flags = LOCAL_DMA_BUF_SYNC_START | LOCAL_DMA_BUF_SYNC_READ;
43 if (drmIoctl(dmabuf_fd, LOCAL_DMA_BUF_IOCTL_SYNC, &sync_start)) 43 // TODO(tiago.vignatti): fix the crash bug. crbug.com/605774
44 if (false && drmIoctl(dmabuf_fd, LOCAL_DMA_BUF_IOCTL_SYNC, &sync_start))
44 PLOG(ERROR) << "Failed DMA_BUF_SYNC_START"; 45 PLOG(ERROR) << "Failed DMA_BUF_SYNC_START";
45 } 46 }
46 47
47 void PrimeSyncEnd(int dmabuf_fd) { 48 void PrimeSyncEnd(int dmabuf_fd) {
48 struct local_dma_buf_sync sync_end = {0}; 49 struct local_dma_buf_sync sync_end = {0};
49 50
50 sync_end.flags = LOCAL_DMA_BUF_SYNC_END | LOCAL_DMA_BUF_SYNC_WRITE; 51 sync_end.flags = LOCAL_DMA_BUF_SYNC_END | LOCAL_DMA_BUF_SYNC_WRITE;
51 if (drmIoctl(dmabuf_fd, LOCAL_DMA_BUF_IOCTL_SYNC, &sync_end)) 52 if (false && drmIoctl(dmabuf_fd, LOCAL_DMA_BUF_IOCTL_SYNC, &sync_end))
52 PLOG(ERROR) << "Failed DMA_BUF_SYNC_END"; 53 PLOG(ERROR) << "Failed DMA_BUF_SYNC_END";
53 } 54 }
54 55
55 } // namespace 56 } // namespace
56 57
57 // static 58 // static
58 std::unique_ptr<ClientNativePixmap> ClientNativePixmapDmaBuf::ImportFromDmabuf( 59 std::unique_ptr<ClientNativePixmap> ClientNativePixmapDmaBuf::ImportFromDmabuf(
59 int dmabuf_fd, 60 int dmabuf_fd,
60 const gfx::Size& size, 61 const gfx::Size& size,
61 int stride) { 62 int stride) {
(...skipping 29 matching lines...) Expand all
91 void ClientNativePixmapDmaBuf::Unmap() { 92 void ClientNativePixmapDmaBuf::Unmap() {
92 TRACE_EVENT0("drm", "DmaBuf:Unmap"); 93 TRACE_EVENT0("drm", "DmaBuf:Unmap");
93 PrimeSyncEnd(dmabuf_fd_.get()); 94 PrimeSyncEnd(dmabuf_fd_.get());
94 } 95 }
95 96
96 void ClientNativePixmapDmaBuf::GetStride(int* stride) const { 97 void ClientNativePixmapDmaBuf::GetStride(int* stride) const {
97 *stride = stride_; 98 *stride = stride_;
98 } 99 }
99 100
100 } // namespace ui 101 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698