#include "Ecore_Drm.h"
#include <wayland-tbm-server.h>
+#ifdef FRAMES
+ #include <time.h>
+#endif
+
E_API E_Module_Api e_modapi = { E_MODULE_API_VERSION, "EOM Module" };
static E_EomPtr g_eom = NULL;
Eina_Bool eom_server_debug_on = EINA_FALSE;
-#ifdef DUMP_PRESENTATION
-static int dump = 0;
-#endif
-
static const struct wl_eom_interface _e_eom_wl_implementation =
{
_e_eom_cb_wl_request_set_attribute,
#endif
#ifdef DUMP_PRESENTATION
- if (dump < 29)
- {
- tbm_surface_internal_dump_buffer(external_buffer, "kyky");
- dump++;
- }
- else
- {
- tbm_surface_internal_dump_end();
- EOM_DBG("dump end");
- }
+ if (eom_output->dump_do)
+ {
+ tbm_surface_internal_dump_buffer(external_buffer, "eom_buffer");
+ eom_output->dump_count++;
+
+ if (eom_output->dump_count > DUMP_NUM)
+ {
+ tbm_surface_internal_dump_end();
+ eom_output->dump_do = EINA_FALSE;
+ }
+ }
#endif
err = tdm_layer_set_buffer(eom_output->layer, external_buffer);
EOM_DBG("COMMIT <+++++++++++++++");
}
+
+#ifdef FRAMES
+ _e_eom_util_check_frames(eom_output);
+#endif
}
static void
eom_output->status = plug;
eom_output->name = eina_stringshare_add(new_name);
eom_output->type = (eom_output_type_e)tdm_type;
+#ifdef DUMP_PRESENTATION
+ eom_output->dump_do = EINA_TRUE;
+ eom_output->dump_count = 1;
+ EOM_DBG("dump init");
+ tbm_surface_internal_dump_start("/eom_buffers", eom_output->width, eom_output->height, DUMP_NUM);
+#endif
/* TODO: check output mode(presentation set) and HDMI type */
_e_eom_output_start_mirror(eom_output);
eom_error_e eom_error = EOM_ERROR_NONE;
E_EomClientPtr eom_client = NULL, current_eom_client = NULL, iterator = NULL;
E_EomOutputPtr eom_output = NULL;
- Eina_Bool changes = EINA_FALSE;
Eina_Bool ret = EINA_FALSE;
Eina_List *l;
{
/* Current client can set any flag it wants */
_e_eom_output_state_set_force_attribute(eom_output, attribute);
- changes = EINA_TRUE;
}
else
{
eom_error = EOM_ERROR_INVALID_PARAMETER;
goto end;
}
-
- changes = EINA_TRUE;
- }
-
- /* If there was no new changes applied do nothing */
- if (changes == EINA_FALSE)
- {
- EOM_DBG("no new changes");
- return;
}
EOM_DBG("set attribute OK");
EOM_DBG("new client buffer wl:%p tbm:%p",
buffer->wl_buffer, buffer->tbm_buffer);
-#ifdef DUMP_PRESENTATION
- if (dump == 0)
- {
- EOM_DBG("dump start");
- tbm_surface_internal_dump_start("/A", wl_buffer->w, wl_buffer->h, 30);
- }
-#endif
-
#if 0
buffer->stamp = _e_eom_util_get_stamp();
#endif
tbm_bo_unmap(bo);
}
#endif
+#ifdef FRAMES
+static void _e_eom_util_check_frames(E_EomOutputPtr eom_output)
+{
+ int res = 0;
+ static int first = 1;
+
+ eom_output->num_frames += 1;
+ res = gettimeofday(&eom_output->curr, NULL);
+ if (res)
+ {
+ EOM_ERR("gettimeofday");
+ return;
+ }
+
+ if (eom_output->curr.tv_sec > eom_output->prev.tv_sec && !first)
+ {
+ EOM_DBG("FPS:%d", eom_output->num_frames);
+
+ eom_output->num_frames = 0;
+ eom_output->prev.tv_sec = eom_output->curr.tv_sec;
+ eom_output->prev.tv_usec = eom_output->curr.tv_usec;
+ }
+ else
+ {
+ eom_output->prev.tv_sec = eom_output->curr.tv_sec;
+ eom_output->prev.tv_usec = eom_output->curr.tv_usec;
+ first = 0;
+ }
+}
+#endif
static void
_e_eom_client_add_buffer(E_EomClientPtr client, E_EomClientBufferPtr buffer)
#if 0
#define DUMP_PRESENTATION
+ #define DUMP_NUM 30
+#endif
+
+#if 0
+ #define FRAMES
+ #include <time.h>
#endif
extern Eina_Bool eom_server_debug_on;
/* E Module */
E_API extern E_Module_Api e_modapi;
-
-/**
- * @brief Called when Enlightenment is going to load the module
- * @param[in] m structure which defines Enlightenment module
- * @see e_modapi_shutdown()
- * @see e_modapi_save()
- */
E_API void *e_modapi_init(E_Module *m);
-
-/**
- * @brief Called when Enlightenment is going to unload the module
- * @param[in] m structure which defines Enlightenment module
- * @see e_modapi_init()
- * @see e_modapi_save()
- */
E_API int e_modapi_shutdown(E_Module *m);
-
-/**
- * @brief Called when Enlightenment is going to save some info in the module
- * @param[in] m structure which defines Enlightenment module
- * @see e_modapi_init()
- * @see e_modapi_shutdown()
- */
E_API int e_modapi_save(E_Module *m);
#define NUM_MAIN_BUF 2
int pp_buffer;
tbm_surface_h dummy_buffer;
+
+#ifdef DUMP_PRESENTATION
+ Eina_Bool dump_do;
+ int dump_count;
+#endif
+#ifdef FRAMES
+ /* for testing purposes */
+ struct timeval prev;
+ struct timeval curr;
+
+ int num_frames;
+#endif
};
struct _E_Eom
#ifdef DRAW_DUMMY
static void _e_eom_util_draw(tbm_surface_h surface);
#endif
-
+#ifdef FRAMES
+static void _e_eom_util_check_frames(E_EomOutputPtr eom_output);
+#endif
static void _e_eom_client_add_buffer(E_EomClientPtr client, E_EomClientBufferPtr buffer);
static void _e_eom_client_free_buffers(E_EomClientPtr client);
static E_EomClientBufferPtr _e_eom_client_get_buffer(E_EomClientPtr client);