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

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: 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
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..1cae85b4c9be6edbe11468e51cf6387d7602187b 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_) {
+ const ScopedVector<HardwareDisplayPlane>& all_planes =
+ drm_->plane_manager()->planes();
+ for (auto* plane : all_planes) {
+ if (plane->CanUseForCrtc(crtc_) && !plane->owning_crtc() &&
dnicoara 2015/08/20 14:22:45 I think that the plane allocation logic will serve
kalyank 2015/08/20 16:36:17 Removed the extra check related to owned crtc.
kalyank 2015/08/20 16:36:18 Done.
+ (plane->type() == HardwareDisplayPlane::Cursor)) {
+ 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 "

Powered by Google App Engine
This is Rietveld 408576698