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

Unified Diff: ui/ozone/platform/drm/gpu/crtc_controller.cc

Issue 1294113005: Atomic: Don’t keep track of Cursor planes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review fixes Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/ozone/platform/drm/gpu/crtc_controller.h ('k') | ui/ozone/platform/drm/gpu/hardware_display_plane.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "
« no previous file with comments | « ui/ozone/platform/drm/gpu/crtc_controller.h ('k') | ui/ozone/platform/drm/gpu/hardware_display_plane.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698