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

Side by Side Diff: ui/ozone/platform/drm/gpu/gbm_buffer.cc

Issue 991963002: [Ozone-Drm] More LOG cleanup (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « ui/ozone/platform/drm/gpu/drm_util.cc ('k') | ui/ozone/platform/drm/gpu/gbm_buffer_base.cc » ('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/drm/gpu/gbm_buffer.h" 5 #include "ui/ozone/platform/drm/gpu/gbm_buffer.h"
6 6
7 #include <drm.h> 7 #include <drm.h>
8 #include <fcntl.h> 8 #include <fcntl.h>
9 #include <gbm.h> 9 #include <gbm.h>
10 #include <xf86drm.h> 10 #include <xf86drm.h>
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 GbmPixmap::GbmPixmap(const scoped_refptr<GbmBuffer>& buffer) 68 GbmPixmap::GbmPixmap(const scoped_refptr<GbmBuffer>& buffer)
69 : buffer_(buffer), dma_buf_(-1) { 69 : buffer_(buffer), dma_buf_(-1) {
70 } 70 }
71 71
72 bool GbmPixmap::Initialize() { 72 bool GbmPixmap::Initialize() {
73 // We want to use the GBM API because it's going to call into libdrm 73 // We want to use the GBM API because it's going to call into libdrm
74 // which might do some optimizations on buffer allocation, 74 // which might do some optimizations on buffer allocation,
75 // especially when sharing buffers via DMABUF. 75 // especially when sharing buffers via DMABUF.
76 dma_buf_ = gbm_bo_get_fd(buffer_->bo()); 76 dma_buf_ = gbm_bo_get_fd(buffer_->bo());
77 if (dma_buf_ < 0) { 77 if (dma_buf_ < 0) {
78 LOG(ERROR) << "Failed to export buffer to dma_buf"; 78 PLOG(ERROR) << "Failed to export buffer to dma_buf";
79 return false; 79 return false;
80 } 80 }
81 return true; 81 return true;
82 } 82 }
83 83
84 GbmPixmap::~GbmPixmap() { 84 GbmPixmap::~GbmPixmap() {
85 if (dma_buf_ > 0) 85 if (dma_buf_ > 0)
86 close(dma_buf_); 86 close(dma_buf_);
87 } 87 }
88 88
89 void* GbmPixmap::GetEGLClientBuffer() { 89 void* GbmPixmap::GetEGLClientBuffer() {
90 return nullptr; 90 return nullptr;
91 } 91 }
92 92
93 int GbmPixmap::GetDmaBufFd() { 93 int GbmPixmap::GetDmaBufFd() {
94 return dma_buf_; 94 return dma_buf_;
95 } 95 }
96 96
97 int GbmPixmap::GetDmaBufPitch() { 97 int GbmPixmap::GetDmaBufPitch() {
98 return gbm_bo_get_stride(buffer_->bo()); 98 return gbm_bo_get_stride(buffer_->bo());
99 } 99 }
100 100
101 } // namespace ui 101 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/drm/gpu/drm_util.cc ('k') | ui/ozone/platform/drm/gpu/gbm_buffer_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698