Compare commits

...

4 Commits

Author SHA1 Message Date
Christopher Michael 9717994d06 wl-drm: Add call to set cloned or not cloned output 3 years ago
Chris Michael 0525154d25 wl_drm: refactor _drm2_randr_apply function to support multi-output 3 years ago
Chris Michael 9b83f001a3 wl-drm: remove old randr apply code 3 years ago
Chris Michael 7769a2240b wl-drm: move variable declaration to top and add TODO comment 3 years ago
  1. 83
      src/modules/wl_drm/e_mod_main.c

@ -434,7 +434,9 @@ _drm2_randr_create(void)
s->config.rotation = 0;
}
printf("DRM2 RRR: drm output rotation=%i\n", s->config.rotation);
printf("DRM2 RRR: drm output rotation=%i\n", s->config.rotation);
/* TODO: get current output rotation and store in
* s->config.rotation */
s->info.can_rot_0 = EINA_FALSE;
s->info.can_rot_90 = EINA_FALSE;
@ -551,12 +553,14 @@ _drm2_rotation_exists(Ecore_Drm2_Output *output, int rot)
int rots;
rots = ecore_drm2_output_supported_rotations_get(output);
printf("RRR: DRM2 ..... rots for %p rots=%x input=%x\n", output, rots, rot);
// hack for ... broken drivers that don't say anything about rotations
if (!(rots &
(ECORE_DRM2_ROTATION_NORMAL | ECORE_DRM2_ROTATION_90 |
ECORE_DRM2_ROTATION_180 | ECORE_DRM2_ROTATION_270)))
rots |= ECORE_DRM2_ROTATION_NORMAL;
if (rots >= 0)
{
if ((rot == 0) && (rots & ECORE_DRM2_ROTATION_NORMAL))
@ -580,7 +584,6 @@ _drm2_randr_apply(void)
Ecore_Drm2_Output **outconf, *out;
int nw = 0, nh = 0;
int minw, minh, maxw, maxh;
int rot;
unsigned int *crtcs = NULL;
int num_crtcs = 0, numout = 0;
const Eina_List *outputs = NULL;
@ -616,35 +619,31 @@ _drm2_randr_apply(void)
{
printf("RRR: find output for '%s'\n", s->info.name);
if (!s->config.configured)
{
printf("RRR: unconfigured screen: %s\n", s->info.name);
continue;
}
out = _drm2_output_find(outputs, s->info.name);
if (out)
if (s->config.configured)
{
printf("RRR: enabled: %i\n", s->config.enabled);
if (s->config.enabled)
out = _drm2_output_find(outputs, s->info.name);
if (out)
{
if (s->config.priority > top_priority)
top_priority = s->config.priority;
for (i = 0; i < num_crtcs; i++)
printf("RRR: enabled: %i\n", s->config.enabled);
if (s->config.enabled)
{
if (!outconf[i])
if (s->config.priority > top_priority)
top_priority = s->config.priority;
for (i = 0; i < num_crtcs; i++)
{
printf("RRR: crtc slot empty: %i\n", i);
if (ecore_drm2_output_possible_crtc_get(out, crtcs[i]))
if (!outconf[i])
{
printf("RRR: output is possible...\n");
if (_drm2_rotation_exists(out, s->config.rotation))
printf("RRR: crtc slot empty: %i\n", i);
if (ecore_drm2_output_possible_crtc_get(out, crtcs[i]))
{
printf("RRR: assign slot out: %p\n", out);
outconf[i] = out;
screenconf[i] = s;
break;
if (_drm2_rotation_exists(out, s->config.rotation))
{
printf("RRR: assign slot out: %p\n", out);
outconf[i] = out;
screenconf[i] = s;
break;
}
}
}
}
@ -702,16 +701,30 @@ _drm2_randr_apply(void)
ecore_drm2_output_enabled_set(outconf[i],
screenconf[i]->config.enabled);
e_drm2_output_rotation_set(outconf[i], orient);
ecore_evas_rotation_with_resize_set(e_comp->ee,
screenconf[i]->config.rotation);
if ((screenconf[i]->config.relative.to) &&
(screenconf[i]->config.relative.mode ==
E_RANDR2_RELATIVE_CLONE))
{
Ecore_Drm2_Output *clone;
clone =
_drm2_output_find(outputs,
screenconf[i]->config.relative.to);
fprintf(stderr, "WL_DRM: SET OUTPUT CLONED !!\n");
ecore_evas_output_clone_set(e_comp->ee, outconf[i], clone);
}
else
{
fprintf(stderr, "WL_DRM: SET OUTPUT NOT CLONED !!\n");
ecore_evas_output_clone_set(e_comp->ee, outconf[i], NULL);
}
}
else
{
printf("RRR: crtc off: %i\n", i);
/* FIXME: Need new drm2 API to disable crtc...
* one which Does Not Take an Output as param */
}
}
}
@ -724,17 +737,9 @@ _drm2_randr_apply(void)
if (nh > maxh) nh = maxh;
if (nw < minw) nw = minw;
if (nh < minh) nh = minh;
printf("RRR: set vsize: %ix%i, rot=%i\n", nw, nh, ecore_evas_rotation_get(e_comp->ee));
printf("RRR: set vsize: %ix%i\n", nw, nh);
ecore_drm2_device_calibrate(dev, nw, nh);
rot = ecore_evas_rotation_get(e_comp->ee);
if ((rot == 90) || (rot == 270))
ecore_drm2_device_pointer_max_set(dev, nh, nw);
else
ecore_drm2_device_pointer_max_set(dev, nw, nh);
ecore_drm2_device_pointer_rotation_set(dev, rot);
if (!e_randr2_cfg->ignore_hotplug_events)
e_randr2_screen_refresh_queue(EINA_FALSE);
ecore_drm2_device_pointer_max_set(dev, nw, nh);
}
static void

Loading…
Cancel
Save