forked from enlightenment/enlightenment
Compare commits
4 Commits
master
...
devs/devil
Author | SHA1 | Date |
---|---|---|
Christopher Michael | 9717994d06 | |
Chris Michael | 0525154d25 | |
Chris Michael | 9b83f001a3 | |
Chris Michael | 7769a2240b |
|
@ -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)
|
||||
if (s->config.configured)
|
||||
{
|
||||
printf("RRR: unconfigured screen: %s\n", s->info.name);
|
||||
continue;
|
||||
}
|
||||
|
||||
out = _drm2_output_find(outputs, s->info.name);
|
||||
if (out)
|
||||
{
|
||||
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…
Reference in New Issue