OLD | NEW |
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/gbm_buffer.h" | 5 #include "ui/ozone/platform/dri/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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 } | 79 } |
80 return true; | 80 return true; |
81 } | 81 } |
82 | 82 |
83 GbmPixmap::~GbmPixmap() { | 83 GbmPixmap::~GbmPixmap() { |
84 if (dma_buf_ > 0) | 84 if (dma_buf_ > 0) |
85 close(dma_buf_); | 85 close(dma_buf_); |
86 } | 86 } |
87 | 87 |
88 void* GbmPixmap::GetEGLClientBuffer() { | 88 void* GbmPixmap::GetEGLClientBuffer() { |
89 // TODO(achaulk): change back to null when dma_buf bug is fixed. | 89 return nullptr; |
90 return buffer_->bo(); | |
91 } | 90 } |
92 | 91 |
93 int GbmPixmap::GetDmaBufFd() { | 92 int GbmPixmap::GetDmaBufFd() { |
94 return dma_buf_; | 93 return dma_buf_; |
95 } | 94 } |
96 | 95 |
97 int GbmPixmap::GetDmaBufPitch() { | 96 int GbmPixmap::GetDmaBufPitch() { |
98 return gbm_bo_get_stride(buffer_->bo()); | 97 return gbm_bo_get_stride(buffer_->bo()); |
99 } | 98 } |
100 | 99 |
101 } // namespace ui | 100 } // namespace ui |
OLD | NEW |