Compare commits

...

4 Commits

Author SHA1 Message Date
Christopher Michael 9717994d06 wl-drm: Add call to set cloned or not cloned output 2019-12-03 11:18:48 -05:00
Chris Michael 0525154d25 wl_drm: refactor _drm2_randr_apply function to support multi-output
This patch refactors the drm2_randr_apply function in order to support
clone & extended modes for multiple outputs. This is modeled closely
around the x11 randr apply code.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2019-12-03 11:18:48 -05:00
Chris Michael 9b83f001a3 wl-drm: remove old randr apply code
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2019-12-03 11:18:48 -05:00
Chris Michael 7769a2240b wl-drm: move variable declaration to top and add TODO comment
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2019-12-03 11:18:48 -05:00
1 changed files with 44 additions and 39 deletions

View File

@ -435,6 +435,8 @@ _drm2_randr_create(void)
}
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,12 +619,8 @@ _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)
{
@ -638,7 +637,6 @@ _drm2_randr_apply(void)
printf("RRR: crtc slot empty: %i\n", i);
if (ecore_drm2_output_possible_crtc_get(out, crtcs[i]))
{
printf("RRR: output is possible...\n");
if (_drm2_rotation_exists(out, s->config.rotation))
{
printf("RRR: assign slot out: %p\n", out);
@ -652,6 +650,7 @@ _drm2_randr_apply(void)
}
}
}
}
numout = 0;
for (i = 0; i < num_crtcs; i++)
@ -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);
}
static void