Index: ui/ozone/platform/drm/gpu/crtc_controller.cc |
diff --git a/ui/ozone/platform/drm/gpu/crtc_controller.cc b/ui/ozone/platform/drm/gpu/crtc_controller.cc |
index 8871a1719fc8facc88149ac2093ce576ee7cf6ff..ffaf6d6d3621889513abe15e0127927c626481d4 100644 |
--- a/ui/ozone/platform/drm/gpu/crtc_controller.cc |
+++ b/ui/ozone/platform/drm/gpu/crtc_controller.cc |
@@ -15,9 +15,7 @@ namespace ui { |
CrtcController::CrtcController(const scoped_refptr<DrmDevice>& drm, |
uint32_t crtc, |
uint32_t connector) |
- : drm_(drm), |
- crtc_(crtc), |
- connector_(connector) {} |
+ : drm_(drm), cursor_plane_(nullptr), crtc_(crtc), connector_(connector) {} |
CrtcController::~CrtcController() { |
if (!is_disabled_) { |
@@ -146,13 +144,35 @@ bool CrtcController::MoveCursor(const gfx::Point& location) { |
bool CrtcController::ResetCursor() { |
uint32_t handle = 0; |
gfx::Size size; |
- |
+#if defined(USE_DRM_ATOMIC) |
+ if (!cursor_plane_) { |
dnicoara
2015/08/21 21:38:38
I was thinking that HardwareDisplayPlaneManager sh
kalyank
2015/08/21 22:05:58
K, I have changed so that we dont even keep track
|
+ const ScopedVector<HardwareDisplayPlane>& all_planes = |
+ drm_->plane_manager()->planes(); |
+ for (auto* plane : all_planes) { |
+ if (plane->CanUseForCrtc(crtc_) && |
+ (plane->type() == HardwareDisplayPlane::kCursor)) { |
+ cursor_plane_ = plane; |
+ } |
+ } |
+ } |
+#endif |
if (cursor_buffer_) { |
handle = cursor_buffer_->GetHandle(); |
size = cursor_buffer_->GetSize(); |
} |
bool status = drm_->SetCursor(crtc_, handle, size); |
+ if (cursor_plane_) { |
+ if (status && handle) { |
+ cursor_plane_->set_owning_crtc(crtc_); |
+ cursor_plane_->set_in_use(true); |
+ } else { |
+ cursor_plane_->set_owning_crtc(0); |
+ cursor_plane_->set_in_use(false); |
+ cursor_plane_ = nullptr; |
+ } |
+ } |
+ |
if (!status) { |
PLOG(ERROR) << "drmModeSetCursor: device " << drm_->device_path().value() |
<< " crtc " << crtc_ << " handle " << handle << " size " |