e_comp_hwc: calculate the client fps at the commit handler 28/68228/1
authorSooChan Lim <sc1.lim@samsung.com>
Tue, 3 May 2016 05:38:41 +0000 (14:38 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Tue, 3 May 2016 05:38:41 +0000 (14:38 +0900)
The no composite client can does the multliple commits at one
vblank time, so the calculation of fps do compare the sequence
with the last_sequece to avoid the multiple frame count.

Change-Id: I51852a4136ffc12fd67c29a2a5f6dd6eb5ee67d1

src/bin/e_comp_hwc.c

index 7eeb32e..59a31f0 100755 (executable)
@@ -79,6 +79,7 @@ struct _E_Comp_Hwc_Layer {
    int zpos;
    Eina_Bool primary;
    Eina_Bool reserved_memory;
+   unsigned int last_sequence;
 
    Eina_Bool pending;
    Eina_List *pending_tsurfaces;
@@ -930,6 +931,13 @@ _e_comp_hwc_output_commit_handler_reserved_memory(tdm_output *output, unsigned i
              _e_comp_hwc_layer_queue_release(hwc_layer, tsurface);
              hwc_layer->tsurface = tsurface;
           }
+
+        /* fps check at no composite */
+        if (hwc_layer->last_sequence != sequence)
+          {
+             _e_comp_hwc_update_client_fps();
+             hwc_layer->last_sequence = sequence;
+          }
      }
 
    /* send the done surface to the client  */
@@ -1004,6 +1012,13 @@ _e_comp_hwc_output_commit_handler(tdm_output *output, unsigned int sequence,
 
         tbm_surface_internal_unref(tsurface);
         _e_comp_hwc_commit_data_destroy(data);
+
+        /* fps check at no composite */
+        if (hwc_layer->last_sequence != sequence)
+          {
+             _e_comp_hwc_update_client_fps();
+             hwc_layer->last_sequence = sequence;
+          }
      }
 }
 
@@ -1111,10 +1126,6 @@ _e_comp_hwc_output_commit(E_Comp_Hwc_Output *hwc_output, E_Comp_Hwc_Layer *hwc_l
         return EINA_FALSE;
      }
 
-   /* fps check at no composite */
-   if (!is_canvas)
-      _e_comp_hwc_update_client_fps();
-
    /* commit handler is different */
    if (hwc_layer->reserved_memory)
      {