[PATCH] Respect seat assignments when assigning drm devices to server. Currently, drm devices go to whichever server can get them first.

Dave Airlie airlied at gmail.com
Thu Jan 22 18:22:39 PST 2015


Just a style-nit, but C requires the #ifdef at the 0 column not tabbed in,
and it looks better.

this also to me seems like it should be in config/udev.c,
since that is where all the other seat handling code lives.

Dave.

>> ---
>>   hw/xfree86/os-support/linux/lnx_platform.c | 39
>> ++++++++++++++++++++++++++++++
>>   1 file changed, 39 insertions(+)
>>
>> diff --git a/hw/xfree86/os-support/linux/lnx_platform.c
>> b/hw/xfree86/os-support/linux/lnx_platform.c
>> index 1d145b3..59f1083 100644
>> --- a/hw/xfree86/os-support/linux/lnx_platform.c
>> +++ b/hw/xfree86/os-support/linux/lnx_platform.c
>> @@ -20,6 +20,10 @@
>>   #include "hotplug.h"
>>   #include "systemd-logind.h"
>>
>> +#ifdef CONFIG_UDEV_KMS
>> +#include <libudev.h>
>> +#endif
>> +
>>   static Bool
>>   get_drm_info(struct OdevAttributes *attribs, char *path, int
>> delayed_index)
>>   {
>> @@ -161,6 +165,41 @@ xf86PlatformDeviceProbe(struct OdevAttributes
>> *attribs)
>>       if (i != xf86_num_platform_devices)
>>           goto out_free;
>>
>> +    #ifdef CONFIG_UDEV_KMS
>> +    {
>> +        struct udev_device *udev_device;
>> +        const char *dev_seat;
>> +        char *syspath = NULL;
>> +        struct udev *udev;
>> +
>> +        udev = udev_new();
>> +        if (!udev)
>> +            goto out_free;
>> +
>> +        syspath = config_odev_get_attribute(attribs,
>> ODEV_ATTRIB_SYSPATH);
>> +
>> +        udev_device = udev_device_new_from_syspath(udev, syspath);
>> +        if (!udev_device) {
>> +            udev_unref(udev);
>> +            goto out_free;
>> +        }
>> +
>> +        dev_seat = udev_device_get_property_value(udev_device,
>> "ID_SEAT");
>> +        if (!dev_seat)
>> +            dev_seat = "seat0";
>> +
>> +        if ((SeatId && strcmp(dev_seat, SeatId)) ||
>> +            (!SeatId && strcmp(dev_seat, "seat0"))) {
>> +            LogMessage(X_INFO, "xfree86: Not adding drm device (%s) as
>> it's assigned to seat: %s\n", path, dev_seat);
>> +            udev_unref(udev);
>> +            udev_device_unref(udev_device);
>> +            goto out_free;
>> +        }
>> +
>> +        udev_unref(udev);
>> +        udev_device_unref(udev_device);
>> +    }
>> +    #endif
>>       LogMessage(X_INFO, "xfree86: Adding drm device (%s)\n", path);
>>
>>       if (!xf86VTOwner()) {
>>
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel


More information about the xorg-devel mailing list