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

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

Issue 2627193003: ozone: Allocate scanout buffers according to KMS modifiers. (Closed)
Patch Set: Created 3 years, 11 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/crtc_controller.cc ('k') | ui/ozone/platform/drm/gpu/drm_device.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/drm/gpu/drm_buffer.h" 5 #include "ui/ozone/platform/drm/gpu/drm_buffer.h"
6 6
7 #include <drm_fourcc.h> 7 #include <drm_fourcc.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "third_party/skia/include/core/SkSurface.h" 10 #include "third_party/skia/include/core/SkSurface.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 } 64 }
65 65
66 if (should_register_framebuffer) { 66 if (should_register_framebuffer) {
67 uint32_t handles[4] = {0}; 67 uint32_t handles[4] = {0};
68 handles[0] = handle_; 68 handles[0] = handle_;
69 uint32_t strides[4] = {0}; 69 uint32_t strides[4] = {0};
70 strides[0] = stride_; 70 strides[0] = stride_;
71 uint32_t offsets[4] = {0}; 71 uint32_t offsets[4] = {0};
72 fb_pixel_format_ = GetFourCCCodeForSkColorType(info.colorType()); 72 fb_pixel_format_ = GetFourCCCodeForSkColorType(info.colorType());
73 if (!drm_->AddFramebuffer2(info.width(), info.height(), fb_pixel_format_, 73 if (!drm_->AddFramebuffer2(info.width(), info.height(), fb_pixel_format_,
74 handles, strides, offsets, &framebuffer_, 0)) { 74 handles, strides, offsets, nullptr,
75 &framebuffer_, 0)) {
75 PLOG(ERROR) << "DrmBuffer: AddFramebuffer2: handle " << handle_; 76 PLOG(ERROR) << "DrmBuffer: AddFramebuffer2: handle " << handle_;
76 return false; 77 return false;
77 } 78 }
78 } 79 }
79 80
80 surface_ = SkSurface::MakeRasterDirect(info, mmap_base_, stride_); 81 surface_ = SkSurface::MakeRasterDirect(info, mmap_base_, stride_);
81 if (!surface_) { 82 if (!surface_) {
82 LOG(ERROR) << "DrmBuffer: Failed to create SkSurface: handle " << handle_; 83 LOG(ERROR) << "DrmBuffer: Failed to create SkSurface: handle " << handle_;
83 return false; 84 return false;
84 } 85 }
(...skipping 23 matching lines...) Expand all
108 109
109 const DrmDevice* DrmBuffer::GetDrmDevice() const { 110 const DrmDevice* DrmBuffer::GetDrmDevice() const {
110 return drm_.get(); 111 return drm_.get();
111 } 112 }
112 113
113 bool DrmBuffer::RequiresGlFinish() const { 114 bool DrmBuffer::RequiresGlFinish() const {
114 return false; 115 return false;
115 } 116 }
116 117
117 } // namespace ui 118 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/drm/gpu/crtc_controller.cc ('k') | ui/ozone/platform/drm/gpu/drm_device.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698