uxa: Do not register hotplug without RandR

When using Xinerama, RandR is automatically disabled, and calling RR
routines will trigger an assert() because the RR keys/resources are
not set, leading to an Xserver abort.

Hotplug makes little sense without RandR, so no need to install a
udev monitor if RandR is not available, as done in sna.

v3: Rebase onto backwards compatible rrPrivKey detection [ickle]

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Olivier Fourdan 2015-04-09 11:45:27 +01:00 committed by Chris Wilson
parent 148777f028
commit fbefc8f2bd
1 changed files with 13 additions and 0 deletions

View File

@ -766,6 +766,15 @@ I830HandleUEvents(int fd, void *closure)
udev_device_unref(dev);
}
static bool has_randr(void)
{
#if HAS_DIXREGISTERPRIVATEKEY
return dixPrivateKeyRegistered(rrPrivKey);
#else
return *rrPrivKey;
#endif
}
static void
I830UeventInit(ScrnInfoPtr scrn)
{
@ -775,6 +784,10 @@ I830UeventInit(ScrnInfoPtr scrn)
Bool hotplug;
MessageType from = X_CONFIG;
/* Without RR, nothing we can do here */
if (!has_randr())
return;
if (!xf86GetOptValBool(intel->Options, OPTION_HOTPLUG, &hotplug)) {
from = X_DEFAULT;
hotplug = TRUE;