ilmControl: issue send_stats request on getPropertiesOfSurface
authorMarcus Fritzsch <marcus.fritzsch@xse.de>
Tue, 19 Aug 2014 12:31:04 +0000 (14:31 +0200)
committerNobuhiko Tanibata <NOBUHIKO_TANIBATA@denso.co.jp>
Mon, 1 Sep 2014 06:55:44 +0000 (15:55 +0900)
In order to have a current set of statistics in surface properties,
request submission of stats prior to retrieval of actual properties.

Also, if display_roundtrip_queue() fails in this one we assume something
is really broken and don't bother returning properties w/o stats but
simply error out.

Signed-off-by: Marcus Fritzsch <marcus.fritzsch@xse.de>
ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c

index 73568d7..f09a307 100644 (file)
@@ -2535,9 +2535,19 @@ ilm_getPropertiesOfSurface(t_ilm_uint surfaceID,
 
         ctx_surf = get_surface_context(&ctx->wl, (uint32_t)surfaceID);
         if (ctx_surf != NULL) {
-
-            *pSurfaceProperties = ctx_surf->prop;
-            returnValue = ILM_SUCCESS;
+            // request statistics for surface
+            ivi_controller_surface_send_stats(ctx_surf->controller);
+            // force submission
+            int ret = display_roundtrip_queue(ctx->wl.display, ctx->wl.queue);
+
+            // If we got an error here, there is really no sense
+            // in returning the properties as something is fundamentally
+            // broken.
+            if (ret != -1)
+            {
+               *pSurfaceProperties = ctx_surf->prop;
+               returnValue = ILM_SUCCESS;
+            }
         }
     }