OSDN Git Service

drm_hwcomposer: in case of EBUSY, spin until commit succeeded
authorTapani Pälli <tapani.palli@intel.com>
Mon, 23 Jan 2017 22:03:21 +0000 (14:03 -0800)
committerKalyan Kondapally <kalyan.kondapally@intel.com>
Tue, 24 Jan 2017 17:44:20 +0000 (09:44 -0800)
Use this path when explicit fence is not supported.

Bug: #11
Test: AnTuTu Marooned demo works correctly
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
common/display/displayplanemanager.cpp

index 01d794d..65635e6 100644 (file)
@@ -297,6 +297,7 @@ bool DisplayPlaneManager::CommitFrame(DisplayPlaneStateList &comp_planes,
   int ret = drmModeAtomicCommit(gpu_fd_, pset, flags, state);
   if (ret) {
     if (ret == -EBUSY && state) {
+#ifndef DISABLE_EXPLICIT_SYNC
       if (fence.get() != -1) {
         if (!state->GetSyncObject()->Wait(fence.get())) {
           ETRACE("Failed to wait for fence ret=%s\n", PRINTERROR());
@@ -305,6 +306,14 @@ bool DisplayPlaneManager::CommitFrame(DisplayPlaneStateList &comp_planes,
       }
 
       ret = drmModeAtomicCommit(gpu_fd_, pset, flags, state);
+#else
+      /* FIXME - In case of EBUSY, we spin until succeed. What we
+       * probably should do is to queue commits and process them later.
+       */
+      ret = -EBUSY;
+      while (ret == -EBUSY)
+        ret = drmModeAtomicCommit(gpu_fd_, pset, flags, state);
+#endif
     }
   }