EINA_LIST_FOREACH_SAFE(e_comp->zones, l, ll, zone)
{
E_Client *ec;
- E_Output_Screen *eout;
+ E_Output *eout;
int mode = E_HWC_MODE_INVALID;
int num_of_ly = 0, ly_cnt = 0;
Eina_List *clist = NULL;
if (!zone && !zone->output_id) continue;
- eout = e_output_screen_id_find(zone->output_id);
- num_of_ly = eout->plane_count;
+ eout = e_output_find(zone->output_id);
E_CLIENT_REVERSE_FOREACH(ec)
{
EINA_LIST_FOREACH(e_comp->zones, l, zone)
{
- E_Output_Screen * eout;
+ E_Output * eout;
if (!zone->output_id) continue;
- eout = e_output_screen_id_find(zone->output_id);
+ eout = e_output_find(zone->output_id);
if(eout) mode_set |= e_output_planes_apply(eout);
}
else if (_e_comp_hwc_active())
{
Eina_List *l, *ll;
- E_Output_Screen * screen;
+ E_Output * eout;
E_Plane *ep;
if (!ec->zone) return EINA_FALSE;
- screen = e_output_screen_id_find(ec->zone->output_id);
- EINA_LIST_FOREACH_SAFE(screen->planes, l, ll, ep)
+ eout = e_output_find(ec->zone->output_id);
+ EINA_LIST_FOREACH_SAFE(eout->planes, l, ll, ep)
{
E_Client *overlay_ec = ep->ec;
if (overlay_ec == ec) return EINA_TRUE;
{
Ecore_Drm_Device *dev;
Ecore_Drm_Output *drm_output;
- E_Output_Screen *s;
+ E_Output *eout;
const Eina_List *l, *ll;
int x, y, w, h;
EINA_LIST_FOREACH(ecore_drm_devices_get(), l, dev)
{
- EINA_LIST_FOREACH(e_output->screens, ll, s)
+ EINA_LIST_FOREACH(e_comp_screen->outputs, ll, eout)
{
- ELOGF("HWC", "find output for '%s'", NULL, NULL, s->info.name);
+ ELOGF("HWC", "find output for '%s'", NULL, NULL, eout->info.name);
- if (!s->config.enabled) continue;
- drm_output = ecore_drm_device_output_name_find(dev, s->info.name);
+ if (!eout->config.enabled) continue;
+ drm_output = ecore_drm_device_output_name_find(dev, eout->info.name);
if (!drm_output) continue;
ecore_drm_output_position_get(drm_output, &x, &y);
hwc_output->w = w;
hwc_output->h = h;
- ELOGF("HWC", "%s %d,%d,%d,%d", NULL, NULL, s->info.name, x, y, w, h);
+ ELOGF("HWC", "%s %d,%d,%d,%d", NULL, NULL, eout->info.name, x, y, w, h);
}
}
}
_e_comp_screen_cb_output(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
{
const Eina_List *l;
- E_Output_Screen *screen;
+ E_Output *eout;
Ecore_Drm_Event_Output *e;
if (!(e = event)) goto end;
DBG("WL_DRM OUTPUT CHANGE");
- EINA_LIST_FOREACH(e_output->screens, l, screen)
+ EINA_LIST_FOREACH(e_comp_screen->outputs, l, eout)
{
- if ((!strcmp(screen->info.name, e->name)) &&
- (!strcmp(screen->info.screen, e->model)))
+ if ((!strcmp(eout->info.name, e->name)) &&
+ (!strcmp(eout->info.screen, e->model)))
{
if (e->plug)
{
- if (!e_comp_wl_output_init(screen->id, e->make, e->model,
+ if (!e_comp_wl_output_init(eout->id, e->make, e->model,
e->x, e->y, e->w, e->h,
e->phys_width, e->phys_height,
e->refresh, e->subpixel_order,
e->transform))
{
- ERR("Could not setup new output: %s", screen->id);
+ ERR("Could not setup new output: %s", eout->id);
}
}
else
- e_comp_wl_output_remove(screen->id);
+ e_comp_wl_output_remove(eout->id);
break;
}
}
static Ecore_Drm_Output_Mode *
-_e_comp_screen_mode_screen_find(E_Output_Screen *s, Ecore_Drm_Output *output)
+_e_comp_screen_mode_screen_find(E_Output *eout, Ecore_Drm_Output *output)
{
Ecore_Drm_Output_Mode *mode, *m = NULL;
const Eina_List *l;
EINA_LIST_FOREACH(ecore_drm_output_modes_get(output), l, mode)
{
- diff = (100 * abs(s->config.mode.w - mode->width)) +
- (100 * abs(s->config.mode.h - mode->height)) +
- fabs((100 * s->config.mode.refresh) - (100 * mode->refresh));
+ diff = (100 * abs(eout->config.mode.w - mode->width)) +
+ (100 * abs(eout->config.mode.h - mode->height)) +
+ fabs((100 * eout->config.mode.refresh) - (100 * mode->refresh));
if (diff < distance)
{
m = mode;
return strdup(model);
}
-EINTERN E_Output *
+EINTERN E_Comp_Screen *
e_comp_screen_init_outputs(void)
{
Ecore_Drm_Device *dev;
Ecore_Drm_Output *output;
const Eina_List *l, *ll;
- E_Output *r = NULL;
+ E_Comp_Screen *r = NULL;
- r = E_NEW(E_Output, 1);
+ r = E_NEW(E_Comp_Screen, 1);
if (!r) return NULL;
EINA_LIST_FOREACH(ecore_drm_devices_get(), l, dev)
{
EINA_LIST_FOREACH(dev->outputs, ll, output)
{
- E_Output_Screen *s;
+ E_Output *eout;
const Eina_List *m;
Ecore_Drm_Output_Mode *omode;
unsigned int j;
Eina_Bool possible = EINA_FALSE;
int len = 0;
- s = E_NEW(E_Output_Screen, 1);
- if (!s) continue;
+ eout = E_NEW(E_Output, 1);
+ if (!eout) continue;
- s->info.name = ecore_drm_output_name_get(output);
- printf("COMP DRM: .... out %s\n", s->info.name);
+ eout->info.name = ecore_drm_output_name_get(output);
+ printf("COMP TDM: .... out %s\n", eout->info.name);
- s->info.connected = ecore_drm_output_connected_get(output);
- printf("COMP DRM: ...... connected %i\n", s->info.connected);
+ eout->info.connected = ecore_drm_output_connected_get(output);
+ printf("COMP TDM: ...... connected %i\n", eout->info.connected);
- s->info.screen = _e_comp_screen_output_screen_get(output);
+ eout->info.screen = _e_comp_screen_output_screen_get(output);
- s->info.edid = ecore_drm_output_edid_get(output);
- if (s->info.edid)
- s->id = malloc(strlen(s->info.name) + 1 + strlen(s->info.edid) + 1);
+ eout->info.edid = ecore_drm_output_edid_get(output);
+ if (eout->info.edid)
+ eout->id = malloc(strlen(eout->info.name) + 1 + strlen(eout->info.edid) + 1);
else
- s->id = malloc(strlen(s->info.name) + 1 + 1);
- if (!s->id)
+ eout->id = malloc(strlen(eout->info.name) + 1 + 1);
+ if (!eout->id)
{
- free(s->info.screen);
- free(s->info.edid);
- free(s);
+ free(eout->info.screen);
+ free(eout->info.edid);
+ free(eout);
continue;
}
- len = strlen(s->info.name);
- strncpy(s->id, s->info.name, len + 1);
- strncat(s->id, "/", 1);
- if (s->info.edid) strncat(s->id, s->info.edid, strlen(s->info.edid));
+ len = strlen(eout->info.name);
+ strncpy(eout->id, eout->info.name, len + 1);
+ strncat(eout->id, "/", 1);
+ if (eout->info.edid) strncat(eout->id, eout->info.edid, strlen(eout->info.edid));
- printf("COMP DRM: ...... screen: %s\n", s->id);
+ printf("COMP TDM: ...... screen: %s\n", eout->id);
- ecore_drm_output_physical_size_get(output, &s->info.size.w,
- &s->info.size.h);
+ ecore_drm_output_physical_size_get(output, &eout->info.size.w,
+ &eout->info.size.h);
EINA_LIST_FOREACH(ecore_drm_output_modes_get(output), m, omode)
{
rmode->refresh = omode->refresh;
rmode->preferred = (omode->flags & DRM_MODE_TYPE_PREFERRED);
- s->info.modes = eina_list_append(s->info.modes, rmode);
+ eout->info.modes = eina_list_append(eout->info.modes, rmode);
}
priority = 0;
if (ecore_drm_output_primary_get(dev) == output)
priority = 100;
- s->config.priority = priority;
+ eout->config.priority = priority;
for (j = 0; j < dev->crtc_count; j++)
{
{
unsigned int refresh;
- ecore_drm_output_position_get(output, &s->config.geom.x,
- &s->config.geom.y);
- ecore_drm_output_crtc_size_get(output, &s->config.geom.w,
- &s->config.geom.h);
+ ecore_drm_output_position_get(output, &eout->config.geom.x,
+ &eout->config.geom.y);
+ ecore_drm_output_crtc_size_get(output, &eout->config.geom.w,
+ &eout->config.geom.h);
ecore_drm_output_current_resolution_get(output,
- &s->config.mode.w,
- &s->config.mode.h,
+ &eout->config.mode.w,
+ &eout->config.mode.h,
&refresh);
- s->config.mode.refresh = refresh;
- s->config.enabled =
- ((s->config.mode.w != 0) && (s->config.mode.h != 0));
+ eout->config.mode.refresh = refresh;
+ eout->config.enabled =
+ ((eout->config.mode.w != 0) && (eout->config.mode.h != 0));
- printf("COMP DRM: '%s' %i %i %ix%i\n", s->info.name,
- s->config.geom.x, s->config.geom.y,
- s->config.geom.w, s->config.geom.h);
+ printf("COMP TDM: '%s' %i %i %ix%i\n", eout->info.name,
+ eout->config.geom.x, eout->config.geom.y,
+ eout->config.geom.w, eout->config.geom.h);
}
/* TODO: are rotations possible ?? */
}
- s->plane_count = 1; // TODO: get proper value using libtdm
- printf("COMP DRM: planes %i\n", s->plane_count);
- for (j = 0; j < s->plane_count; j++)
+ eout->plane_count = 1; // TODO: get proper value using libtdm
+ printf("COMP TDM: planes %i\n", eout->plane_count);
+ for (j = 0; j < eout->plane_count; j++)
{
- printf("COMP DRM: added plane %i\n", j);
- e_plane_new(s);
+ printf("COMP TDM: added plane %i\n", j);
+ e_plane_new(eout);
}
- r->screens = eina_list_append(r->screens, s);
+ r->outputs = eina_list_append(r->outputs, eout);
}
}
{
Ecore_Drm_Device *dev;
Ecore_Drm_Output *out;
- E_Output_Screen *s;
+ E_Output *eout;
const Eina_List *l, *ll;
int nw, nh, pw, ph, ww, hh;
int minw, minh, maxw, maxh;
int top_priority = 0;
/* TODO: what the actual fuck */
- nw = e_output->w;
- nh = e_output->h;
+ nw = e_comp_screen->w;
+ nh = e_comp_screen->h;
EINA_LIST_FOREACH(ecore_drm_devices_get(), l, dev)
{
ecore_drm_screen_size_range_get(dev, &minw, &minh, &maxw, &maxh);
- printf("COMP DRM: size range: %ix%i -> %ix%i\n", minw, minh, maxw, maxh);
+ printf("COMP TDM: size range: %ix%i -> %ix%i\n", minw, minh, maxw, maxh);
ecore_drm_outputs_geometry_get(dev, NULL, NULL, &pw, &ph);
if (nw > maxw) nw = maxw;
if (nw < pw) ww = pw;
if (nh < ph) hh = ph;
- printf("COMP DRM: set vsize: %ix%i\n", ww, hh);
+ printf("COMP TDM: set vsize: %ix%i\n", ww, hh);
- EINA_LIST_FOREACH(e_output->screens, ll, s)
+ EINA_LIST_FOREACH(e_comp_screen->outputs, ll, eout)
{
Ecore_Drm_Output_Mode *mode = NULL;
- printf("COMP DRM: find output for '%s'\n", s->info.name);
+ printf("COMP TDM: find output for '%s'\n", eout->info.name);
- out = ecore_drm_device_output_name_find(dev, s->info.name);
+ out = ecore_drm_device_output_name_find(dev, eout->info.name);
if (!out) continue;
- mode = _e_comp_screen_mode_screen_find(s, out);
+ mode = _e_comp_screen_mode_screen_find(eout, out);
- if (s->config.priority > top_priority)
- top_priority = s->config.priority;
+ if (eout->config.priority > top_priority)
+ top_priority = eout->config.priority;
- printf("\tCOMP DRM: Priority: %d\n", s->config.priority);
+ printf("\tCOMP TDM: Priority: %d\n", eout->config.priority);
- printf("\tCOMP DRM: Geom: %d %d %d %d\n",
- s->config.geom.x, s->config.geom.y,
- s->config.geom.w, s->config.geom.h);
+ printf("\tCOMP TDM: Geom: %d %d %d %d\n",
+ eout->config.geom.x, eout->config.geom.y,
+ eout->config.geom.w, eout->config.geom.h);
if (mode)
{
- printf("\tCOMP DRM: Found Valid Drm Mode\n");
- printf("\t\tCOMP DRM: %dx%d\n", mode->width, mode->height);
+ printf("\tCOMP TDM: Found Valid Drm Mode\n");
+ printf("\t\tCOMP TDM: %dx%d\n", mode->width, mode->height);
}
else
- printf("\tCOMP DRM: No Valid Drm Mode Found\n");
+ printf("\tCOMP TDM: No Valid Drm Mode Found\n");
ecore_drm_output_mode_set(out, mode,
- s->config.geom.x, s->config.geom.y);
- if (s->config.priority == top_priority)
+ eout->config.geom.x, eout->config.geom.y);
+ if (eout->config.priority == top_priority)
ecore_drm_output_primary_set(out);
ecore_drm_output_enable(out);
- printf("\tCOMP DRM: Mode\n");
- printf("\t\tCOMP DRM: Geom: %d %d\n",
- s->config.mode.w, s->config.mode.h);
- printf("\t\tCOMP DRM: Refresh: %f\n", s->config.mode.refresh);
- printf("\t\tCOMP DRM: Preferred: %d\n",
- s->config.mode.preferred);
+ printf("\tCOMP TDM: Mode\n");
+ printf("\t\tCOMP TDM: Geom: %d %d\n",
+ eout->config.mode.w, eout->config.mode.h);
+ printf("\t\tCOMP TDM: Refresh: %f\n", eout->config.mode.refresh);
+ printf("\t\tCOMP TDM: Preferred: %d\n",
+ eout->config.mode.preferred);
}
}
}
EINTERN Eina_Bool e_comp_screen_available(void);
EINTERN void e_comp_screen_stub(void);
EINTERN void e_comp_screen_apply(void);
-EINTERN E_Output * e_comp_screen_init_outputs(void);
+EINTERN E_Comp_Screen * e_comp_screen_init_outputs(void);
EINTERN void e_comp_screen_dpms(int set);
E_API Eina_Bool e_comp_screen_init(void);
_e_comp_wl_cb_randr_change(void *data EINA_UNUSED, int type EINA_UNUSED, void *event EINA_UNUSED)
{
Eina_List *l;
- E_Output_Screen *screen;
+ E_Output *eout;
unsigned int transform = WL_OUTPUT_TRANSFORM_NORMAL;
- if (!e_output) return ECORE_CALLBACK_RENEW;
+ if (!e_comp_screen) return ECORE_CALLBACK_RENEW;
- EINA_LIST_FOREACH(e_output->screens, l, screen)
+ EINA_LIST_FOREACH(e_comp_screen->outputs, l, eout)
{
- if (!screen->config.enabled)
+ if (!eout->config.enabled)
{
- e_comp_wl_output_remove(screen->id);
+ e_comp_wl_output_remove(eout->id);
continue;
}
- switch (screen->config.rotation)
+ switch (eout->config.rotation)
{
case 90:
transform = WL_OUTPUT_TRANSFORM_90;
break;
}
- if (!e_comp_wl_output_init(screen->id, screen->info.name,
- screen->info.screen,
- screen->config.geom.x, screen->config.geom.y,
- screen->config.geom.w, screen->config.geom.h,
- screen->info.size.w, screen->info.size.h,
- screen->config.mode.refresh, 0, transform))
- ERR("Could not initialize screen %s", screen->info.name);
+ if (!e_comp_wl_output_init(eout->id, eout->info.name,
+ eout->info.screen,
+ eout->config.geom.x, eout->config.geom.y,
+ eout->config.geom.w, eout->config.geom.h,
+ eout->info.size.w, eout->info.size.h,
+ eout->config.mode.refresh, 0, transform))
+ ERR("Could not initialize screen %s", eout->info.name);
}
return ECORE_CALLBACK_RENEW;
/////////////////////////////////////////////////////////////////////////
static void _do_apply(void);
-static void _info_free(E_Output *r);
+static void _info_free(E_Comp_Screen *r);
static void _screen_config_eval(void);
static void _screen_config_maxsize(void);
-static Eina_Bool _hwc_set(E_Output_Screen * screen, E_Hwc_Mode mode, Eina_List* prepare_ec_list);
-
/////////////////////////////////////////////////////////////////////////
-E_API E_Output *e_output = NULL;
+E_API E_Comp_Screen *e_comp_screen = NULL;
E_API int E_EVENT_SCREEN_CHANGE = 0;
if (!E_EVENT_SCREEN_CHANGE) E_EVENT_SCREEN_CHANGE = ecore_event_type_new();
if (!e_comp_screen_available()) return EINA_FALSE;
- e_output = e_comp_screen_init_outputs();
+ e_comp_screen = e_comp_screen_init_outputs();
_do_apply();
e_output_shutdown(void)
{
// free up screen info
- _info_free(e_output);
- e_output = NULL;
+ _info_free(e_comp_screen);
+ e_comp_screen = NULL;
return 1;
}
}
static void
-_info_free(E_Output *r)
+_info_free(E_Comp_Screen *r)
{
- E_Output_Screen *s;
+ E_Output *eout;
E_Output_Mode *m;
E_Plane *ep;
if (!r) return;
// free up our output screen data
- EINA_LIST_FREE(r->screens, s)
+ EINA_LIST_FREE(r->outputs, eout)
{
- free(s->id);
- free(s->info.screen);
- free(s->info.name);
- free(s->info.edid);
- EINA_LIST_FREE(s->info.modes, m) free(m);
- EINA_LIST_FREE(s->planes, ep) e_plane_free(ep);
- free(s);
+ free(eout->id);
+ free(eout->info.screen);
+ free(eout->info.name);
+ free(eout->info.edid);
+ EINA_LIST_FREE(eout->info.modes, m) free(m);
+ EINA_LIST_FREE(eout->planes, ep) e_plane_free(ep);
+ free(eout);
}
free(r);
}
_screen_config_eval(void)
{
Eina_List *l;
- E_Output_Screen *s;
+ E_Output *eout;
int minx, miny, maxx, maxy;
minx = 65535;
maxx = -65536;
maxy = -65536;
- EINA_LIST_FOREACH(e_output->screens, l, s)
+ EINA_LIST_FOREACH(e_comp_screen->outputs, l, eout)
{
- if (!s->config.enabled) continue;
- if (s->config.geom.x < minx) minx = s->config.geom.x;
- if (s->config.geom.y < miny) miny = s->config.geom.y;
- if ((s->config.geom.x + s->config.geom.w) > maxx)
- maxx = s->config.geom.x + s->config.geom.w;
- if ((s->config.geom.y + s->config.geom.h) > maxy)
- maxy = s->config.geom.y + s->config.geom.h;
+ if (!eout->config.enabled) continue;
+ if (eout->config.geom.x < minx) minx = eout->config.geom.x;
+ if (eout->config.geom.y < miny) miny = eout->config.geom.y;
+ if ((eout->config.geom.x + eout->config.geom.w) > maxx)
+ maxx = eout->config.geom.x + eout->config.geom.w;
+ if ((eout->config.geom.y + eout->config.geom.h) > maxy)
+ maxy = eout->config.geom.y + eout->config.geom.h;
printf("OUTPUT: s: '%s' @ %i %i - %ix%i\n",
- s->info.name,
- s->config.geom.x, s->config.geom.y,
- s->config.geom.w, s->config.geom.h);
+ eout->info.name,
+ eout->config.geom.x, eout->config.geom.y,
+ eout->config.geom.w, eout->config.geom.h);
}
printf("OUTPUT:--- %i %i -> %i %i\n", minx, miny, maxx, maxy);
- EINA_LIST_FOREACH(e_output->screens, l, s)
+ EINA_LIST_FOREACH(e_comp_screen->outputs, l, eout)
{
- s->config.geom.x -= minx;
- s->config.geom.y -= miny;
+ eout->config.geom.x -= minx;
+ eout->config.geom.y -= miny;
}
- e_output->w = maxx - minx;
- e_output->h = maxy - miny;
+ e_comp_screen->w = maxx - minx;
+ e_comp_screen->h = maxy - miny;
}
static void
_screen_config_maxsize(void)
{
Eina_List *l;
- E_Output_Screen *s;
+ E_Output *eout;
int maxx, maxy;
maxx = -65536;
maxy = -65536;
- EINA_LIST_FOREACH(e_output->screens, l, s)
+ EINA_LIST_FOREACH(e_comp_screen->outputs, l, eout)
{
- if (!s->config.enabled) continue;
- if ((s->config.geom.x + s->config.geom.w) > maxx)
- maxx = s->config.geom.x + s->config.geom.w;
- if ((s->config.geom.y + s->config.geom.h) > maxy)
- maxy = s->config.geom.y + s->config.geom.h;
+ if (!eout->config.enabled) continue;
+ if ((eout->config.geom.x + eout->config.geom.w) > maxx)
+ maxx = eout->config.geom.x + eout->config.geom.w;
+ if ((eout->config.geom.y + eout->config.geom.h) > maxy)
+ maxy = eout->config.geom.y + eout->config.geom.h;
printf("OUTPUT: '%s': %i %i %ix%i\n",
- s->info.name,
- s->config.geom.x, s->config.geom.y,
- s->config.geom.w, s->config.geom.h);
+ eout->info.name,
+ eout->config.geom.x, eout->config.geom.y,
+ eout->config.geom.w, eout->config.geom.h);
}
printf("OUTPUT: result max: %ix%i\n", maxx, maxy);
- e_output->w = maxx;
- e_output->h = maxy;
+ e_comp_screen->w = maxx;
+ e_comp_screen->h = maxy;
}
static int
_screen_sort_cb(const void *data1, const void *data2)
{
- const E_Output_Screen *s1 = data1, *s2 = data2;
+ const E_Output *s1 = data1, *s2 = data2;
int dif;
dif = -(s1->config.priority - s2->config.priority);
all_screens = screens;
}
-static Eina_Bool
-_hwc_set(E_Output_Screen * screen, E_Hwc_Mode mode, Eina_List* prepare_ec_list)
-{
- Eina_List *l_p, *l_ec;
- Eina_List *l, *ll;
- E_Plane *ep;
- int num_c, num_p;
-
- EINA_SAFETY_ON_NULL_RETURN_VAL(screen, EINA_FALSE);
- EINA_SAFETY_ON_NULL_RETURN_VAL(screen->planes, EINA_FALSE);
- INF("HWC : mode(%d) (%d)overlays\n", mode, eina_list_count(prepare_ec_list));
-
- l_p = screen->planes; // Overlay sort by Z
- num_p = screen->plane_count;
-
- l_ec = prepare_ec_list; // Visible clients sort by Z
- num_c = eina_list_count(prepare_ec_list);
-
- if ((mode == E_HWC_MODE_COMPOSITE) ||
- (mode == E_HWC_MODE_HWC_COMPOSITE))
- {
- ep = eina_list_data_get(l_p);
- if (ep)
- {
- num_p--;
- e_client_redirected_set(ep->ec, 1);
- ep->ec = NULL; // 1st plane is assigned for e_comp->evas
- }
- l_p = eina_list_next(l_p);
- }
-
- if ((num_c < 1) || (num_p < 1))
- {
- INF("HWC : prepared (%d) overlays on (%d) planes are wrong\n", num_c, num_p);
- return EINA_FALSE;
- }
-
- EINA_SAFETY_ON_NULL_RETURN_VAL(l_p, EINA_FALSE);
- EINA_LIST_REVERSE_FOREACH_SAFE(l_p, l, ll, ep)
- {
- E_Client *ec = NULL;
-
- if (ep->ec) e_client_redirected_set(ep->ec, 1);
-
- if (num_p < 1) break;
-
- if (num_c < num_p)
- {
- num_p--; continue;
- }
-
- if (!l_ec) break;
- ec = eina_list_data_get(l_ec);
- if(ec)
- {
- INF("HWC : set '%s' on overlay(%d)\n", ec->icccm.title, num_p);
- e_client_redirected_set(ec, 0);
- ep->ec = ec;
- }
- num_p--;
- l_ec = eina_list_next(l_ec);
- }
- e_comp->hwc_mode = mode;
-
- return EINA_TRUE;
-}
-
EINTERN void
e_output_screens_setup(int rw, int rh)
{
int i;
E_Screen *screen;
- Eina_List *screens = NULL, *screens_rem;
+ Eina_List *outputs = NULL, *outputs_rem;
Eina_List *e_screens = NULL;
Eina_List *l, *ll;
- E_Output_Screen *s, *s2, *s_chosen;
+ E_Output *eout, *s2, *s_chosen;
Eina_Bool removed;
- if ((!e_output) || (!e_output->screens)) goto out;
+ if ((!e_comp_screen) || (!e_comp_screen->outputs)) goto out;
// put screens in tmp list
- EINA_LIST_FOREACH(e_output->screens, l, s)
+ EINA_LIST_FOREACH(e_comp_screen->outputs, l, eout)
{
- if ((s->config.enabled) &&
- (s->config.geom.w > 0) &&
- (s->config.geom.h > 0))
+ if ((eout->config.enabled) &&
+ (eout->config.geom.w > 0) &&
+ (eout->config.geom.h > 0))
{
- screens = eina_list_append(screens, s);
+ outputs = eina_list_append(outputs, eout);
}
}
// remove overlapping screens - if a set of screens overlap, keep the
{
removed = EINA_FALSE;
- EINA_LIST_FOREACH(screens, l, s)
+ EINA_LIST_FOREACH(outputs, l, eout)
{
- screens_rem = NULL;
+ outputs_rem = NULL;
EINA_LIST_FOREACH(l->next, ll, s2)
{
- if (E_INTERSECTS(s->config.geom.x, s->config.geom.y,
- s->config.geom.w, s->config.geom.h,
+ if (E_INTERSECTS(eout->config.geom.x, eout->config.geom.y,
+ eout->config.geom.w, eout->config.geom.h,
s2->config.geom.x, s2->config.geom.y,
s2->config.geom.w, s2->config.geom.h))
{
- if (!screens_rem)
- screens_rem = eina_list_append(screens_rem, s);
- screens_rem = eina_list_append(screens_rem, s2);
+ if (!outputs_rem)
+ outputs_rem = eina_list_append(outputs_rem, eout);
+ outputs_rem = eina_list_append(outputs_rem, s2);
}
}
// we have intersecting screens - choose the lowest res one
- if (screens_rem)
+ if (outputs_rem)
{
removed = EINA_TRUE;
// find the smallest screen (chosen one)
s_chosen = NULL;
- EINA_LIST_FOREACH(screens_rem, ll, s2)
+ EINA_LIST_FOREACH(outputs_rem, ll, s2)
{
if (!s_chosen) s_chosen = s2;
else
}
}
// remove all from screens but the chosen one
- EINA_LIST_FREE(screens_rem, s2)
+ EINA_LIST_FREE(outputs_rem, s2)
{
if (s2 != s_chosen)
- screens = eina_list_remove_list(screens, l);
+ outputs = eina_list_remove_list(outputs, l);
}
// break our list walk and try again
break;
}
while (removed);
// sort screens by priority etc.
- screens = eina_list_sort(screens, 0, _screen_sort_cb);
+ outputs = eina_list_sort(outputs, 0, _screen_sort_cb);
i = 0;
- EINA_LIST_FOREACH(screens, l, s)
+ EINA_LIST_FOREACH(outputs, l, eout)
{
screen = E_NEW(E_Screen, 1);
screen->escreen = screen->screen = i;
- screen->x = s->config.geom.x;
- screen->y = s->config.geom.y;
- screen->w = s->config.geom.w;
- screen->h = s->config.geom.h;
- if (s->id) screen->id = strdup(s->id);
+ screen->x = eout->config.geom.x;
+ screen->y = eout->config.geom.y;
+ screen->w = eout->config.geom.w;
+ screen->h = eout->config.geom.h;
+ if (eout->id) screen->id = strdup(eout->id);
e_screens = eina_list_append(e_screens, screen);
INF("E INIT: SCREEN: [%i][%i], %ix%i+%i+%i",
i, i, screen->w, screen->h, screen->x, screen->y);
i++;
}
- eina_list_free(screens);
+ eina_list_free(outputs);
// if we have NO screens at all (above - i will be 0) AND we have no
// existing screens set up in xinerama - then just say root window size
// is the entire screen. this should handle the case where you unplug ALL
_escreens_set(e_screens);
}
-E_API const Eina_List *
+EINTERN const Eina_List *
e_output_screens_get(void)
{
return all_screens;
}
-EINTERN E_Output_Screen *
-e_output_screen_id_find(const char *id)
+EINTERN E_Output *
+e_output_find(const char *id)
{
- E_Output_Screen *s;
+ E_Output *eout;
Eina_List *l;
- EINA_LIST_FOREACH(e_output->screens, l, s)
+ EINA_LIST_FOREACH(e_comp_screen->outputs, l, eout)
{
- if (!strcmp(s->id, id)) return s;
+ if (!strcmp(eout->id, id)) return eout;
}
return NULL;
}
-
-E_API Eina_Bool
-e_output_planes_prepare(E_Output_Screen * screen, E_Hwc_Mode mode, Eina_List* clist)
-{
- if (!e_comp) return EINA_FALSE;
-
- e_comp->prepare_mode = mode;
- if (e_comp->prepare_ec_list)
- {
- eina_list_free(e_comp->prepare_ec_list);
- e_comp->prepare_ec_list = NULL;
- }
- e_comp->prepare_ec_list = eina_list_clone(clist);
- return EINA_TRUE;
-}
-
-E_API Eina_Bool
-e_output_planes_apply(E_Output_Screen * screen)
-{
- e_comp->hwc_mode = e_comp->prepare_mode;
- switch (e_comp->prepare_mode)
- {
- case E_HWC_MODE_NO_COMPOSITE:
- case E_HWC_MODE_HWC_COMPOSITE:
- case E_HWC_MODE_HWC_NO_COMPOSITE:
- return _hwc_set(screen, e_comp->prepare_mode, e_comp->prepare_ec_list);
-
- default :
- e_output_planes_clear(screen);
- break;
- }
-
- return EINA_FALSE;
-}
-
-EINTERN Eina_Bool
-e_output_planes_clear(E_Output_Screen * screen)
-{
- Eina_List *l, *ll;
- E_Plane *ep;
-
- EINA_SAFETY_ON_NULL_RETURN_VAL(screen, EINA_FALSE);
- EINA_SAFETY_ON_NULL_RETURN_VAL(screen->planes, EINA_FALSE);
-
- e_comp->hwc_mode = 0;
-
- EINA_LIST_FOREACH_SAFE(screen->planes, l, ll, ep)
- {
- if (ep->ec) e_client_redirected_set(ep->ec, 1);
- ep->ec = NULL;
- }
-
- return EINA_TRUE;
-}
-
-EINTERN Eina_Bool
-e_output_planes_need_change()
+E_API const Eina_List *
+e_output_planes_get(E_Output *eout)
{
- E_Zone *zone;
- E_Output_Screen * screen;
- E_Plane *ep;
- int num_ov;
- Eina_List *l_p, *l_ov, *l, *ll;
-
- if (!e_comp) return EINA_FALSE;
- if (e_comp->hwc_mode != e_comp->prepare_mode)
- return EINA_FALSE;
+ EINA_SAFETY_ON_NULL_RETURN_VAL(eout, NULL);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(eout->planes, NULL);
- zone = eina_list_data_get(e_comp->zones);
- if (!zone) return EINA_FALSE;
- screen = e_output_screen_id_find(zone->output_id);
- if (!screen) return EINA_FALSE;
- l_p = screen->planes;
- if (!l_p) return EINA_FALSE;
-
- num_ov = eina_list_count(e_comp->prepare_ec_list);
- if ((num_ov > screen->plane_count) ||
- (num_ov < 1))
- return EINA_FALSE;
-
- l_ov = e_comp->prepare_ec_list;
-
- if ((e_comp->prepare_mode == E_HWC_MODE_COMPOSITE) ||
- (e_comp->prepare_mode == E_HWC_MODE_HWC_COMPOSITE))
- {
- ep = eina_list_data_get(l_p);
- if (ep) return EINA_FALSE;
- l_p = eina_list_next(l_p);
- }
-
- EINA_SAFETY_ON_NULL_RETURN_VAL(l_p, EINA_FALSE);
- EINA_LIST_FOREACH_SAFE(l_p, l, ll, ep)
- {
- E_Client *ec = NULL;
-
- if (!l_ov) break;
- ec = eina_list_data_get(l_ov);
- if(ec)
- {
- if (ep->ec != ec) return EINA_TRUE;
- }
-
- l_ov = eina_list_next(l_ov);
- }
-
- return EINA_FALSE;
+ return eout->planes;
}
E_API Eina_Bool
e_output_util_planes_print(void)
{
Eina_List *l, *ll;
- E_Zone *zone;
+ E_Output * eout = NULL;
- EINA_LIST_FOREACH_SAFE(e_comp->zones, l, ll, zone)
+ EINA_LIST_FOREACH_SAFE(e_comp_screen->outputs, l, ll, eout)
{
- E_Output_Screen * screen = NULL;
E_Plane *ep;
E_Client *ec;
- if (!zone && !zone->output_id) continue;
- screen = e_output_screen_id_find(zone->output_id);
- if (!screen) continue;
- if (!screen->planes) continue;
+ if (!eout && !eout->planes) continue;
- EINA_LIST_FOREACH_SAFE(screen->planes, l, ll, ep)
+ EINA_LIST_FOREACH_SAFE(eout->planes, l, ll, ep)
{
ec = ep->ec;
if (ec) INF("HWC:\t|---\t %s 0x%08x\n", ec->icccm.title, (unsigned int)ec->frame);
return EINA_FALSE; // SHALL BE EINA_TRUE after hwc multi plane implementation
}
+
#ifdef E_TYPEDEFS
-//typedef struct _E_Output E_Output;
+typedef struct _E_Comp_Screen E_Comp_Screen;
typedef struct _E_Output E_Output;
-typedef struct _E_Output_Screen E_Output_Screen;
typedef struct _E_Output_Mode E_Output_Mode;
typedef struct _E_Screen E_Screen;
#define E_OUTPUT_TYPE (int)0xE0b11002
-struct _E_Output
+struct _E_Comp_Screen
{
- Eina_List *screens; // available screens
- int w, h; // virtual resolution needed for screens (calculated)
+ Eina_List *outputs; // available screens
+ int w, h; // virtual resolution (calculated)
unsigned char ignore_hotplug_events;
unsigned char ignore_acpi_events;
};
Eina_Bool preferred : 1; // is this the preferred mode for the device?
};
-struct _E_Output_Screen
+struct _E_Output
{
char *id; // string id which is "name/edid";
struct {
{
int screen, escreen;
int x, y, w, h;
- char *id; // this is the same id we get from _E_Output_Screen so look it up there
+ char *id; // this is the same id we get from _E_Output so look it up there
};
-extern E_API E_Output *e_output;
+extern E_API E_Comp_Screen *e_comp_screen;
extern E_API int E_EVENT_SCREEN_CHANGE;
-EINTERN Eina_Bool e_output_init(void);
-EINTERN int e_output_shutdown(void);
-EINTERN E_Output_Screen * e_output_screen_new(E_Zone *zone, int nlayer);
-EINTERN Eina_Bool e_output_planes_need_change(void);
-EINTERN E_Output_Screen * e_output_screen_id_find(const char *id);
-EINTERN Eina_Bool e_output_planes_clear(E_Output_Screen * screen);
+EINTERN Eina_Bool e_output_init(void);
+EINTERN int e_output_shutdown(void);
+EINTERN E_Output * e_output_find(const char *id);
EINTERN void e_output_screens_setup(int rw, int rh);
+EINTERN const Eina_List * e_output_screens_get(void);
+E_API const Eina_List * e_output_planes_get(E_Output *eout);
+E_API Eina_Bool e_output_util_planes_print(void);
-E_API const Eina_List * e_output_screens_get(void);
-E_API Eina_Bool e_output_planes_prepare(E_Output_Screen * screen, E_Hwc_Mode mode, Eina_List* clist);
-E_API Eina_Bool e_output_util_planes_print(void);
-
#endif
#endif
#include "e.h"
-/* E_Plane is a child object of E_Output_Screen. There is one Output per screen
+/* E_Plane is a child object of E_Output. There is one Output per screen
* E_plane represents hw overlay and a surface is assigned to disable composition
* Each Output always has dedicated canvas and a zone
*/
}
E_API E_Plane *
-e_plane_new(E_Output_Screen *screen)
+e_plane_new(E_Output *eout)
{
E_Plane *plane;
char name[40];
- if (!screen) return NULL;
+ if (!eout) return NULL;
//plane = E_OBJECT_ALLOC(E_Plane, E_PLANE_TYPE, _e_plane_free);
plane = E_NEW(E_Plane, 1);
if (!plane) return NULL;
printf("%s 2", __FUNCTION__);
- snprintf(name, sizeof(name), "Plane %s", screen->id);
+ snprintf(name, sizeof(name), "Plane %s", eout->id);
plane->name = eina_stringshare_add(name);
plane->type = E_PLANE_TYPE_INVALID;
- plane->screen = screen;
+ plane->eout = eout;
/* config default resolution with output size*/
- plane->resolution.x = screen->config.geom.x;
- plane->resolution.y = screen->config.geom.y;
- plane->resolution.w = screen->config.geom.w;
- plane->resolution.h = screen->config.geom.h;
+ plane->resolution.x = eout->config.geom.x;
+ plane->resolution.y = eout->config.geom.y;
+ plane->resolution.w = eout->config.geom.w;
+ plane->resolution.h = eout->config.geom.h;
- screen->planes = eina_list_append(screen->planes, plane);
+ eout->planes = eina_list_append(eout->planes, plane);
printf("@@@@@@@@@@ e_plane_new:| %i %i %ix%i\n", plane->resolution.x , plane->resolution.y, plane->resolution.w, plane->resolution.h);
const char *name;
E_Plane_Type_State type;
E_Client *ec;
- E_Output_Screen *screen;
+ E_Output *eout;
};
extern E_API int E_EVENT_PLANE_ADD;
EINTERN int e_plane_init(void);
EINTERN int e_plane_shutdown(void);
-E_API E_Plane * e_plane_new(E_Output_Screen *screen);
+E_API E_Plane * e_plane_new(E_Output *eout);
E_API void e_plane_free(E_Plane *plane);
E_API Eina_Bool e_plane_resolution_set(E_Plane *plane, int x, int y, int w, int h);
E_API void e_plane_type_set(E_Plane *plane, E_Plane_Type_State type);