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>
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;
+ }
}
}