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

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

Issue 2298353002: gfx: Use unsigned strides for gpu memory buffers. (Closed)
Patch Set: . Created 4 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
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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 // static 145 // static
146 scoped_refptr<GbmBuffer> GbmBuffer::CreateBufferFromFds( 146 scoped_refptr<GbmBuffer> GbmBuffer::CreateBufferFromFds(
147 const scoped_refptr<GbmDevice>& gbm, 147 const scoped_refptr<GbmDevice>& gbm,
148 gfx::BufferFormat format, 148 gfx::BufferFormat format,
149 const gfx::Size& size, 149 const gfx::Size& size,
150 std::vector<base::ScopedFD>&& fds, 150 std::vector<base::ScopedFD>&& fds,
151 const std::vector<gfx::NativePixmapPlane>& planes) { 151 const std::vector<gfx::NativePixmapPlane>& planes) {
152 TRACE_EVENT2("drm", "GbmBuffer::CreateBufferFromFD", "device", 152 TRACE_EVENT2("drm", "GbmBuffer::CreateBufferFromFD", "device",
153 gbm->device_path().value(), "size", size.ToString()); 153 gbm->device_path().value(), "size", size.ToString());
154 DCHECK_LE(fds.size(), planes.size()); 154 DCHECK_LE(fds.size(), planes.size());
155 DCHECK_EQ(planes[0].offset, 0); 155 DCHECK_EQ(planes[0].offset, 0u);
156 156
157 uint32_t fourcc_format = GetFourCCFormatFromBufferFormat(format); 157 uint32_t fourcc_format = GetFourCCFormatFromBufferFormat(format);
158 158
159 // Use scanout if supported. 159 // Use scanout if supported.
160 bool use_scanout = gbm_device_is_format_supported( 160 bool use_scanout = gbm_device_is_format_supported(
161 gbm->device(), fourcc_format, GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING); 161 gbm->device(), fourcc_format, GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING);
162 162
163 gbm_bo* bo = nullptr; 163 gbm_bo* bo = nullptr;
164 if (use_scanout) { 164 if (use_scanout) {
165 struct gbm_import_fd_data fd_data; 165 struct gbm_import_fd_data fd_data;
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 DCHECK(!processing_callback_.is_null()); 302 DCHECK(!processing_callback_.is_null());
303 if (!processing_callback_.Run(this, processed_pixmap_)) { 303 if (!processing_callback_.Run(this, processed_pixmap_)) {
304 LOG(ERROR) << "Failed processing NativePixmap"; 304 LOG(ERROR) << "Failed processing NativePixmap";
305 return nullptr; 305 return nullptr;
306 } 306 }
307 307
308 return processed_pixmap_->buffer(); 308 return processed_pixmap_->buffer();
309 } 309 }
310 310
311 } // namespace ui 311 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/drm/common/client_native_pixmap_dmabuf.cc ('k') | ui/ozone/public/client_native_pixmap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698