OSDN Git Service

Fixed the display pipe power off
authorPallavi G <pallavi.g@intel.com>
Mon, 18 Sep 2017 08:42:47 +0000 (14:12 +0530)
committerKalyan Kondapally <kalyan.kondapally@intel.com>
Tue, 19 Sep 2017 22:07:04 +0000 (15:07 -0700)
DPMS off is enough to turn off the display.
with this patch Hotplug works fine.

Jira: None
Test: Hotplug works fine in Android. Tried 10-15 times.
Signed-off-by: Pallavi G <pallavi.g@intel.com>
wsi/drm/drmdisplay.cpp

index db08403..48d9396 100644 (file)
@@ -540,27 +540,10 @@ bool DrmDisplay::GetFence(drmModeAtomicReqPtr property_set,
 void DrmDisplay::Disable(const DisplayPlaneStateList &composition_planes) {
   IHOTPLUGEVENTTRACE("Disable: Disabling Display: %p", this);
 
-  ScopedDrmAtomicReqPtr pset(drmModeAtomicAlloc());
-  if (pset) {
-    bool active = false;
-    int ret = drmModeAtomicAddProperty(pset.get(), crtc_id_, active_prop_,
-                                       active) < 0;
-    if (ret) {
-      ETRACE("Failed to set display to inactive");
-    }
-
-    for (const DisplayPlaneState &comp_plane : composition_planes) {
-      DrmPlane *plane = static_cast<DrmPlane *>(comp_plane.plane());
-      plane->SetEnabled(false);
-      plane->Disable(pset.get());
-    }
-
-    ret = drmModeAtomicCommit(gpu_fd_, pset.get(),
-                              DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
-    if (ret)
-      ETRACE("Failed to disable display:%s\n", PRINTERROR());
-  } else {
-    ETRACE("Failed to allocate property set %d", -ENOMEM);
+  for (const DisplayPlaneState &comp_plane : composition_planes) {
+    DrmPlane *plane = static_cast<DrmPlane *>(comp_plane.plane());
+    plane->SetEnabled(false);
+    plane->SetNativeFence(-1);
   }
 
   drmModeConnectorSetProperty(gpu_fd_, connector_, dpms_prop_,