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

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

Issue 471433007: [Ozone-Dri] Adding initial content protection support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cast 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_wrapper.h ('k') | ui/ozone/platform/dri/test/mock_dri_wrapper.h » ('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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 &crtc->mode); 114 &crtc->mode);
115 } 115 }
116 116
117 bool DriWrapper::DisableCrtc(uint32_t crtc_id) { 117 bool DriWrapper::DisableCrtc(uint32_t crtc_id) {
118 DCHECK(fd_ >= 0); 118 DCHECK(fd_ >= 0);
119 TRACE_EVENT1("dri", "DriWrapper::DisableCrtc", 119 TRACE_EVENT1("dri", "DriWrapper::DisableCrtc",
120 "crtc", crtc_id); 120 "crtc", crtc_id);
121 return !drmModeSetCrtc(fd_, crtc_id, 0, 0, 0, NULL, 0, NULL); 121 return !drmModeSetCrtc(fd_, crtc_id, 0, 0, 0, NULL, 0, NULL);
122 } 122 }
123 123
124 ScopedDrmConnectorPtr DriWrapper::GetConnector(uint32_t connector_id) {
125 DCHECK(fd_ >= 0);
126 TRACE_EVENT1("dri", "DriWrapper::GetConnector", "connector", connector_id);
127 return ScopedDrmConnectorPtr(drmModeGetConnector(fd_, connector_id));
128 }
129
124 bool DriWrapper::AddFramebuffer(uint32_t width, 130 bool DriWrapper::AddFramebuffer(uint32_t width,
125 uint32_t height, 131 uint32_t height,
126 uint8_t depth, 132 uint8_t depth,
127 uint8_t bpp, 133 uint8_t bpp,
128 uint32_t stride, 134 uint32_t stride,
129 uint32_t handle, 135 uint32_t handle,
130 uint32_t* framebuffer) { 136 uint32_t* framebuffer) {
131 DCHECK(fd_ >= 0); 137 DCHECK(fd_ >= 0);
132 TRACE_EVENT1("dri", "DriWrapper::AddFramebuffer", 138 TRACE_EVENT1("dri", "DriWrapper::AddFramebuffer",
133 "handle", handle); 139 "handle", handle);
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 uint32_t stride, 285 uint32_t stride,
280 void* pixels) { 286 void* pixels) {
281 DCHECK(fd_ >= 0); 287 DCHECK(fd_ >= 0);
282 TRACE_EVENT1("dri", "DriWrapper::DestroyDumbBuffer", "handle", handle); 288 TRACE_EVENT1("dri", "DriWrapper::DestroyDumbBuffer", "handle", handle);
283 munmap(pixels, info.getSafeSize(stride)); 289 munmap(pixels, info.getSafeSize(stride));
284 DrmDestroyDumbBuffer(fd_, handle); 290 DrmDestroyDumbBuffer(fd_, handle);
285 } 291 }
286 292
287 293
288 } // namespace ui 294 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/dri/dri_wrapper.h ('k') | ui/ozone/platform/dri/test/mock_dri_wrapper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698