temp_id = strchr(out->id, '/');
if (temp_id == NULL)
{
- if (!strcmp(out->id, id))
- output = out;
+ if (!strcmp(out->id, id))
+ output = out;
}
else
{
- int loc = temp_id - out->id;
+ int loc = temp_id - out->id;
- if (!strncmp(out->id, id, loc))
- output = out;
+ if (!strncmp(out->id, id, loc))
+ output = out;
}
num_outputs += 1;
*/
if (strcmp(id, "HDMI-A-0"))
{
- EOM_DBG("not find output\n");
- return NULL;
+ EOM_DBG("not find output\n");
+ return NULL;
}
EINA_LIST_FOREACH(ecore_drm_devices_get(), l, dev)
if (!drm_output)
{
- EOM_DBG("not find drm output\n");
- return NULL;
+ EOM_DBG("not find drm output\n");
+ return NULL;
}
crtc_id = ecore_drm_output_crtc_id_get(drm_output);
if (crtc_id == 0)
{
- EOM_DBG("crtc is 0\n");
- return NULL;
+ EOM_DBG("crtc is 0\n");
+ return NULL;
}
output = tdm_display_get_output(g_eom->dpy, crtc_id, NULL);
if (!output)
{
- EOM_DBG("there is no HAL output for:%d\n", crtc_id);
- return NULL;
+ EOM_DBG("there is no HAL output for:%d\n", crtc_id);
+ return NULL;
}
int min_w, min_h, max_w, max_h, preferred_align;
err = tdm_output_get_available_size(output, &min_w, &min_h, &max_w, &max_h,
- &preferred_align);
+ &preferred_align);
if (err != TDM_ERROR_NONE)
{
- EOM_DBG("Gent get geometry for hal output");
- return NULL;
+ EOM_DBG("Gent get geometry for hal output");
+ return NULL;
}
EOM_DBG("HAL size min:%dx%d max:%dx%d alighn:%d\n",
- min_w, min_h, max_w, max_h, preferred_align);
+ min_w, min_h, max_w, max_h, preferred_align);
/*
* Force TDM to make setCrtc onto new buffer
int i = 0;
for (i = 0; i < count; i++)
- {
- if ((modes[i].vdisplay + modes[i].hdisplay) >=
- (big_mode->vdisplay + big_mode->hdisplay))
- {
- big_mode = &modes[i];
- }
- }
+ {
+ if ((modes[i].vdisplay + modes[i].hdisplay) >=
+ (big_mode->vdisplay + big_mode->hdisplay))
+ {
+ big_mode = &modes[i];
+ }
+ }
if (!big_mode)
{
- EOM_DBG("no Big mode\n");
- return NULL;
+ EOM_DBG("no Big mode\n");
+ return NULL;
}
EOM_DBG("BIG_MODE: %dx%d\n", big_mode->hdisplay, big_mode->vdisplay);
err = tdm_output_set_mode(output, big_mode);
if (err != TDM_ERROR_NONE)
{
- EOM_DBG("set Mode failed\n");
- return NULL;
+ EOM_DBG("set Mode failed\n");
+ return NULL;
}
EOM_DBG("find\n");
err = tdm_output_get_layer_count(output, &count);
if (err != TDM_ERROR_NONE)
{
- EOM_DBG ("tdm_output_get_layer_count fail(%d)\n", err);
- return NULL;
+ EOM_DBG ("tdm_output_get_layer_count fail(%d)\n", err);
+ return NULL;
}
for (i = 0; i < count; i++)
{
- layer = (tdm_layer *)tdm_output_get_layer(output, i, &err);
- if (err != TDM_ERROR_NONE)
- {
- EOM_DBG ("tdm_output_get_layer fail(%d)\n", err);
- return NULL;
- }
-
- err = tdm_layer_get_capabilities(layer, &capa);
+ layer = (tdm_layer *)tdm_output_get_layer(output, i, &err);
if (err != TDM_ERROR_NONE)
{
- EOM_DBG ("tdm_layer_get_capabilities fail(%d)\n", err);
- return NULL;
+ EOM_DBG ("tdm_output_get_layer fail(%d)\n", err);
+ return NULL;
}
- if (capa & TDM_LAYER_CAPABILITY_PRIMARY)
- {
- EOM_DBG("TDM_LAYER_CAPABILITY_PRIMARY layer found : %d\n", i);
- break;
- }
+ err = tdm_layer_get_capabilities(layer, &capa);
+ if (err != TDM_ERROR_NONE)
+ {
+ EOM_DBG ("tdm_layer_get_capabilities fail(%d)\n", err);
+ return NULL;
+ }
+
+ if (capa & TDM_LAYER_CAPABILITY_PRIMARY)
+ {
+ EOM_DBG("TDM_LAYER_CAPABILITY_PRIMARY layer found : %d\n", i);
+ break;
+ }
}
memset(&set_layer_info, 0x0, sizeof(tdm_info_layer));
err = tdm_layer_set_info(layer, &set_layer_info);
if (err != TDM_ERROR_NONE)
{
- EOM_DBG ("tdm_layer_set_info fail(%d)\n", err);
- return NULL;
+ EOM_DBG ("tdm_layer_set_info fail(%d)\n", err);
+ return NULL;
}
return layer;
if (!e_comp)
{
- EOM_DBG("e_comp NULL\n");
- return NULL;
+ EOM_DBG("e_comp NULL\n");
+ return NULL;
}
if (!e_comp->evas)
- {
- EOM_DBG("e_comp->evas NULL");
- return NULL;
- }
+ {
+ EOM_DBG("e_comp->evas NULL");
+ return NULL;
+ }
einfo = (Evas_Engine_Info_Drm *)evas_engine_info_get(e_comp->evas);
fb = _ecore_drm_display_fb_find_with_id(einfo->info.buffer_id);
if (!fb)
{
- EOM_DBG("no Ecore_Drm_Fb for dci_output_id:%d\n", einfo->info.buffer_id);
- return NULL;
+ EOM_DBG("no Ecore_Drm_Fb for dci_output_id:%d\n", einfo->info.buffer_id);
+ return NULL;
}
if (!fb->hal_buffer)
{
- EOM_DBG("no hal_buffer\n");
- return NULL;
+ EOM_DBG("no hal_buffer\n");
+ return NULL;
}
EOM_DBG("find hal_buffer");
src_buffer = _e_eom_root_window_tdm_surface_get();
if (!src_buffer )
{
- EOM_ERR("Event: tdm_buffer is NULL\n");
- return;
+ EOM_ERR("Event: tdm_buffer is NULL\n");
+ return;
}
dst_buffer = eom_event->dst_buffers;
err = tdm_output_commit(eom_event->output, 0, NULL, eom_event);
if (err != TDM_ERROR_NONE)
{
- EOM_ERR("Event: Cannot commit crtc\n");
- return;
+ EOM_ERR("Event: Cannot commit crtc\n");
+ return;
}
}
TBM_FORMAT_ARGB8888, TBM_BO_SCANOUT);
if (!buffer)
{
- EOM_DBG("can not create dst_buffer\n");
- return NULL;
+ EOM_DBG("can not create dst_buffer\n");
+ return NULL;
}
/*
if (tbm_surface_map(buffer,
TBM_SURF_OPTION_READ | TBM_SURF_OPTION_WRITE,
&buffer_info) != TBM_SURFACE_ERROR_NONE)
- {
- EOM_DBG("can not mmap buffer\n");
- return NULL;
- }
+ {
+ EOM_DBG("can not mmap buffer\n");
+ return NULL;
+ }
memset(buffer_info.planes[0].ptr, 0xff, buffer_info.planes[0].size);
tbm_surface_unmap(buffer);
wl_output = _e_eom_e_comp_wl_output_get(e_comp_wl->outputs, buff);
if (!wl_output)
{
- EOM_ERR("no e_comp_wl_outputs. (%s)\n", buff);
- goto end;
+ EOM_ERR("no e_comp_wl_outputs. (%s)\n", buff);
+ goto end;
}
/* Get hal output */
hal_output = _e_eom_hal_output_get(buff, e->id);
if (!hal_output)
{
- EOM_ERR("no hal outputs, (%s)\n", buff);
- goto end;
+ EOM_ERR("no hal outputs, (%s)\n", buff);
+ goto end;
}
hal_layer = _e_eom_hal_layer_get(hal_output, e->w, e->h);
if (!hal_layer)
{
- EOM_ERR("no hal layer\n");
- goto end;
+ EOM_ERR("no hal layer\n");
+ goto end;
}
/* Get main frame buffer */
dst_buffer = _e_eom_create_extrenal_output_buffer(e->w, e->h);
if (!dst_buffer )
{
- EOM_ERR("no dst buffer\n");
- goto end;
+ EOM_ERR("no dst buffer\n");
+ goto end;
}
/*
tdm_err = tdm_layer_get_info(hal_layer, &layer_info);
if (tdm_err != TDM_ERROR_NONE)
{
- EOM_ERR ("failed get layer info", tdm_err);
- goto end;
+ EOM_ERR ("failed get layer info", tdm_err);
+ goto end;
}
EOM_DBG("LAYER INFO: %dx%d, pos (x:%d, y:%d, w:%d, h:%d, dpos (x:%d, y:%d, w:%d, h:%d))",
tdm_err = tdm_layer_set_buffer(hal_layer, dst_buffer);
if (tdm_err != TDM_ERROR_NONE)
{
- EOM_ERR("Failed set buffer on layer:%d\n", tdm_err);
- goto end;
+ EOM_ERR("Failed set buffer on layer:%d\n", tdm_err);
+ goto end;
}
eom_event->layer = hal_layer;
tdm_err = tdm_output_commit(hal_output, 0, _e_eom_output_cb_commit, &eom_event);
if (tdm_err != TDM_ERROR_NONE)
{
- EOM_ERR("Cannot commit crtc:%d\n", tdm_err);
- goto end;
+ EOM_ERR("Cannot commit crtc:%d\n", tdm_err);
+ goto end;
}
EINA_LIST_FOREACH(wl_output->resources, l2, output_resource)
if (e->plug)
{
- wl_eom_send_output_type(eom->resource,
+ wl_eom_send_output_type(eom->resource,
output_resource,
eom_type,
WL_EOM_STATUS_CONNECTION);
}
else
{
- EOM_DBG("7\n");
+ EOM_DBG("7\n");
- wl_eom_send_output_type(eom->resource,
+ wl_eom_send_output_type(eom->resource,
output_resource,
eom_type,
WL_EOM_STATUS_DISCONNECTION);
/* TODO: get real output, now we just return HDMI */
EINA_LIST_FOREACH(ecore_drm_devices_get(), l, dev)
{
- drm_output = ecore_drm_device_output_name_find(dev, "HDMI-A-0");
- if (drm_output)
- return drm_output;
+ drm_output = ecore_drm_device_output_name_find(dev, "HDMI-A-0");
+ if (drm_output)
+ return drm_output;
}
return NULL;
}
if (e->active)
{
- /* TODO: do something */
+ /* TODO: do something */
}
else
{
- /* TODO: do something */
+ /* TODO: do something */
}
end:
id);
if (!resource)
{
- EOM_ERR("error. resource is null. (version :%d, id:%d)\n", version, id);
- wl_client_post_no_memory(client);
- return;
+ EOM_ERR("error. resource is null. (version :%d, id:%d)\n", version, id);
+ wl_client_post_no_memory(client);
+ return;
}
wl_resource_set_implementation(resource,
if (g_eom->handlers)
{
- EINA_LIST_FREE(g_eom->handlers, h)
- ecore_event_handler_del(h);
+ EINA_LIST_FREE(g_eom->handlers, h)
+ ecore_event_handler_del(h);
}
if (fullscreen_pre_hook)
{
- e_client_hook_del(fullscreen_pre_hook);
- fullscreen_pre_hook = NULL;
+ e_client_hook_del(fullscreen_pre_hook);
+ fullscreen_pre_hook = NULL;
}
if (g_eom->global) wl_global_destroy(g_eom->global);
g_eom->dpy = tdm_display_init(&err);
if (err != TDM_ERROR_NONE)
{
- EOM_DBG("failed initialize TDM\n");
- goto err;
+ EOM_DBG("failed initialize TDM\n");
+ goto err;
}
EOM_DBG("2\n");
err = tdm_display_get_fd(g_eom->dpy, &g_eom->fd);
if (err != TDM_ERROR_NONE)
{
- EOM_DBG("failed get FD\n");
- goto err;
+ EOM_DBG("failed get FD\n");
+ goto err;
}
EOM_DBG("3\n");
g_eom->bufmgr = tbm_bufmgr_init(g_eom->fd);
if (!g_eom->bufmgr)
{
- EOM_DBG("failed initialize buffer manager\n");
- goto err;
+ EOM_DBG("failed initialize buffer manager\n");
+ goto err;
}
EOM_DBG("4\n");
ret = _e_eom_init_internal();
if (!ret)
{
- EOM_ERR("failed init_internal()");
- goto err;
+ EOM_ERR("failed init_internal()");
+ goto err;
}
E_LIST_HANDLER_APPEND(g_eom->handlers, ECORE_DRM_EVENT_ACTIVATE, _e_eom_ecore_drm_activate_cb, g_eom);