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