hyprwm / aquamarine

Aquamarine is a very light linux rendering backend library
BSD 3-Clause "New" or "Revised" License
261 stars 21 forks source link

Multiseat support with DRM lease #48

Open garlett opened 2 months ago

garlett commented 2 months ago

I am considering to patch aquamarine, to use drm lease from automotive linux drm lease manager. I have a stub patch for wlroots commented on this issue. But I need help to adapt it on aquamarine.

Does hyprland pass the the current seat name to libseat? (yes: env?argument? no: where to patch?)

In my case, the udev enumeration will return no devices, because logind/elogind/seatd does not alocate it. Do you think that on the beggining of scanGPUs, something like this works?

struct dlm_lease *lease = dlm_get_lease(getenv("DRM_LEASE"));
fd = dlm_lease_fd(lease);
fstat(fd, &s);
device = udev_device_new_from_devnum(  backend->session->udevHandle, 'c', s.st_rdev );

vecDevices.push_back( CSessionDevice::openIfKMS(backend->session, udev_device_get_devnode(device)) );
return vecDevices;

thx

vaxerski commented 2 months ago

I am not very knowledgeable in the area, but for the seat question:

image

The seat name is automatic

garlett commented 2 months ago

code above on wlroots, but they have this wlr_seat_create too

Weston sets to 'seat0' when no arg --seat is passed, I tried to remove that and, hopping that env "XDG_SEAT" was used by logind, then the seat manager probably set to 'seat0' too.

the gpuscan bypass that I 'wrote', is supposed to get the leaseFD and create a udev device, then return the result of CSessionDevice::openIfKMS.

I was going to do this inside seatd, but it do not support multiseat yet.

About merge (with an #ifdef ), is it possible ? (at least until I can move to seatd)

vaxerski commented 2 months ago

if you want to merge some code, make a MR and we'll discuss there. I am unsure I understand what you want to do

garlett commented 2 months ago

Sorry, its multiseat with more than one seat per gpu, it's working with weston.