randr: Add "RANDR Emulation" property

When RANDR is emulated as with Xwayland, the actual output configuration
does not change as RANDR is emulated using viewports.

As a result, changes to the CRTC may be skipped, resulting in the
configuration being (wrongly) assumed to be unchanged.

Add a new output property "RANDR Emulation" that the DDX can set to
force RRCrtcSet() to reconfigure the CRTC regardless of the change.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
Olivier Fourdan 2022-04-04 14:22:20 +02:00
parent 972603845e
commit 0904421f57

View File

@ -709,6 +709,25 @@ rrCheckPixmapBounding(ScreenPtr pScreen,
return TRUE;
}
#define XRANDR_EMULATION_PROP "RANDR Emulation"
static Bool
rrCheckEmulated(RROutputPtr output)
{
const char *emulStr = XRANDR_EMULATION_PROP;
Atom emulProp;
RRPropertyValuePtr val;
emulProp = MakeAtom(emulStr, strlen(emulStr), FALSE);
if (emulProp == None)
return FALSE;
val = RRGetOutputProperty(output, emulProp, TRUE);
if (val && val->data)
return !!val->data;
return FALSE;
}
/*
* Request that the Crtc be reconfigured
*/
@ -728,9 +747,11 @@ RRCrtcSet(RRCrtcPtr crtc,
crtcChanged = FALSE;
for (o = 0; o < numOutputs; o++) {
if (outputs[o] && outputs[o]->crtc != crtc) {
crtcChanged = TRUE;
break;
if (outputs[o]) {
if (rrCheckEmulated(outputs[o]) || (outputs[o]->crtc != crtc)) {
crtcChanged = TRUE;
break;
}
}
}