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

Side by Side Diff: ui/ozone/platform/dri/dri_wrapper.cc

Issue 522463005: [Ozone-GBM] Handle GPU crashes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reland of: [Ozone-GBM] Handle GPU crashes Created 6 years, 3 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 | « ui/ozone/platform/dri/dri_window_delegate_proxy.cc ('k') | ui/ozone/platform/dri/gbm.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "ui/ozone/platform/dri/dri_wrapper.h" 5 #include "ui/ozone/platform/dri/dri_wrapper.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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 } 82 }
83 83
84 bool DriWrapper::SetCrtc(uint32_t crtc_id, 84 bool DriWrapper::SetCrtc(uint32_t crtc_id,
85 uint32_t framebuffer, 85 uint32_t framebuffer,
86 std::vector<uint32_t> connectors, 86 std::vector<uint32_t> connectors,
87 drmModeModeInfo* mode) { 87 drmModeModeInfo* mode) {
88 DCHECK(fd_ >= 0); 88 DCHECK(fd_ >= 0);
89 DCHECK(!connectors.empty()); 89 DCHECK(!connectors.empty());
90 DCHECK(mode); 90 DCHECK(mode);
91 91
92 TRACE_EVENT1("dri", "DriWrapper::SetCrtc", 92 TRACE_EVENT2("dri",
93 "crtc", crtc_id); 93 "DriWrapper::SetCrtc",
94 "crtc",
95 crtc_id,
96 "size",
97 gfx::Size(mode->hdisplay, mode->vdisplay).ToString());
94 return !drmModeSetCrtc(fd_, 98 return !drmModeSetCrtc(fd_,
95 crtc_id, 99 crtc_id,
96 framebuffer, 100 framebuffer,
97 0, 101 0,
98 0, 102 0,
99 vector_as_array(&connectors), 103 vector_as_array(&connectors),
100 connectors.size(), mode); 104 connectors.size(), mode);
101 } 105 }
102 106
103 bool DriWrapper::SetCrtc(drmModeCrtc* crtc, std::vector<uint32_t> connectors) { 107 bool DriWrapper::SetCrtc(drmModeCrtc* crtc, std::vector<uint32_t> connectors) {
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 uint32_t stride, 295 uint32_t stride,
292 void* pixels) { 296 void* pixels) {
293 DCHECK(fd_ >= 0); 297 DCHECK(fd_ >= 0);
294 TRACE_EVENT1("dri", "DriWrapper::DestroyDumbBuffer", "handle", handle); 298 TRACE_EVENT1("dri", "DriWrapper::DestroyDumbBuffer", "handle", handle);
295 munmap(pixels, info.getSafeSize(stride)); 299 munmap(pixels, info.getSafeSize(stride));
296 DrmDestroyDumbBuffer(fd_, handle); 300 DrmDestroyDumbBuffer(fd_, handle);
297 } 301 }
298 302
299 303
300 } // namespace ui 304 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/dri/dri_window_delegate_proxy.cc ('k') | ui/ozone/platform/dri/gbm.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698