ecore-drm2: Don't assign plane to output list if test fails
authorChris Michael <cp.michael@samsung.com>
Wed, 3 May 2017 13:22:45 +0000 (09:22 -0400)
committerDerek Foreman <derekf@osg.samsung.com>
Fri, 5 May 2017 17:53:24 +0000 (12:53 -0500)
There is little point in assigning a plane to the output list if the
atomic flip test fails.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
src/lib/ecore_drm2/ecore_drm2_plane.c

index 6f2666d..6729486 100644 (file)
@@ -106,17 +106,17 @@ out:
    plane->type = pstate->type.value;
    plane->output = output;
 
-   DBG("FB %d assigned to Plane %d", fb->id, pstate->obj_id);
-   output->planes = eina_list_append(output->planes, plane);
-
    if (!_fb_atomic_flip_test(output))
      {
-        output->planes = eina_list_remove(output->planes, plane);
         plane->state->in_use = EINA_FALSE;
         free(plane);
 
         return NULL;
      }
+
+   DBG("FB %d assigned to Plane %d", fb->id, pstate->obj_id);
+   output->planes = eina_list_append(output->planes, plane);
+
    return plane;
 }