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

Side by Side Diff: ui/ozone/platform/dri/hardware_display_plane.cc

Issue 409793007: Add plane manager to the atomic swap path. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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/dri/hardware_display_plane.h" 5 #include "ui/ozone/platform/dri/hardware_display_plane.h"
6 6
7 #include <drm.h> 7 #include <drm.h>
8 #include <errno.h> 8 #include <errno.h>
9 #include <xf86drm.h> 9 #include <xf86drm.h>
10 10
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 ScopedDrmPlanePtr plane) 55 ScopedDrmPlanePtr plane)
56 : drm_(drm), 56 : drm_(drm),
57 property_set_(atomic_property_set), 57 property_set_(atomic_property_set),
58 plane_(plane.Pass()), 58 plane_(plane.Pass()),
59 plane_id_(plane_->plane_id) { 59 plane_id_(plane_->plane_id) {
60 } 60 }
61 61
62 HardwareDisplayPlane::~HardwareDisplayPlane() { 62 HardwareDisplayPlane::~HardwareDisplayPlane() {
63 } 63 }
64 64
65 bool HardwareDisplayPlane::CanUseForCrtc(uint32_t crtc_id) {
66 return plane_->possible_crtcs & (1 << crtc_id);
67 }
68
65 bool HardwareDisplayPlane::SetPlaneData(uint32_t crtc_id, 69 bool HardwareDisplayPlane::SetPlaneData(uint32_t crtc_id,
66 uint32_t framebuffer, 70 uint32_t framebuffer,
67 const gfx::Rect& crtc_rect, 71 const gfx::Rect& crtc_rect,
68 const gfx::Rect& src_rect) { 72 const gfx::Rect& src_rect) {
69 int plane_set_error = 73 int plane_set_error =
70 drmModePropertySetAdd( 74 drmModePropertySetAdd(
71 property_set_, plane_id_, crtc_prop_.id_, crtc_id) || 75 property_set_, plane_id_, crtc_prop_.id_, crtc_id) ||
72 drmModePropertySetAdd( 76 drmModePropertySetAdd(
73 property_set_, plane_id_, fb_prop_.id_, framebuffer) || 77 property_set_, plane_id_, fb_prop_.id_, framebuffer) ||
74 drmModePropertySetAdd( 78 drmModePropertySetAdd(
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 src_h_prop_.Initialize(drm_, kSrcHPropName, plane_props); 121 src_h_prop_.Initialize(drm_, kSrcHPropName, plane_props);
118 122
119 if (!props_init) { 123 if (!props_init) {
120 LOG(ERROR) << "Unable to get plane properties."; 124 LOG(ERROR) << "Unable to get plane properties.";
121 return false; 125 return false;
122 } 126 }
123 return true; 127 return true;
124 } 128 }
125 129
126 } // namespace ui 130 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698