Discussion:
How to run Weston on specific devices?
m***@beroal.in.ua
2016-01-04 22:08:56 UTC
Permalink
Hello. My computer has 2 seats. By seat I mean a set containing a
monitor, a videocard, a mouse, and a keyboard. I can drive them with 2
Xorg server, and I am looking for how to replicate this configuration
with Wayland.

AFAIK, Weston uses "libinput", so I assigned "WL_SEAT" of input devices
to "seat1" using "udev" rules according to
http://wayland.freedesktop.org/libinput/doc/latest/udev_config.html . I
run "weston-launch" with a configuration file {{{
[output]
name=card1-VGA-2
seat=seat1
}}}
Weston drives the wrong videocard and the wrong input devices. I see in
its "stderr" that it is scanning all devices.
Pekka Paalanen
2016-01-05 08:07:56 UTC
Permalink
On Tue, 5 Jan 2016 00:08:56 +0200
Post by m***@beroal.in.ua
Hello. My computer has 2 seats. By seat I mean a set containing a
monitor, a videocard, a mouse, and a keyboard. I can drive them with 2
Xorg server, and I am looking for how to replicate this configuration
with Wayland.
AFAIK, Weston uses "libinput", so I assigned "WL_SEAT" of input devices
Hi,

should that not be ID_SEAT?

Also remember to set it for the DRM device you want to use with the
seat.

ID_SEAT is for physical seats which is what you are setting up. WL_SEAT
is for "seats" inside a single Weston session so that you can group
input devices to different wl_seat Wayland objects. Particularly, two
mouse devices in the same wl_seat move the same pointer, while two
mouse devices in different wl_seats gets you two independent pointers
in the same session.
Post by m***@beroal.in.ua
to "seat1" using "udev" rules according to
http://wayland.freedesktop.org/libinput/doc/latest/udev_config.html . I
run "weston-launch" with a configuration file {{{
[output]
name=card1-VGA-2
seat=seat1
}}}
Weston drives the wrong videocard and the wrong input devices. I see in
its "stderr" that it is scanning all devices.
Have you tried using the --seat command line argument to make Weston's
DRM-backend pick a seat other than the default "seat0"?

You would be running an instance of Weston per each seat / gfx card.


Thanks,
pq
m***@beroal.in.ua
2016-01-05 16:10:23 UTC
Permalink
Thank you for your answer.
Post by Pekka Paalanen
On Tue, 5 Jan 2016 00:08:56 +0200
Post by m***@beroal.in.ua
Hello. My computer has 2 seats. By seat I mean a set containing a
monitor, a videocard, a mouse, and a keyboard. I can drive them with 2
Xorg server, and I am looking for how to replicate this configuration
with Wayland.
AFAIK, Weston uses "libinput", so I assigned "WL_SEAT" of input devices
Hi,
should that not be ID_SEAT?
Also remember to set it for the DRM device you want to use with the
seat.
ID_SEAT is for physical seats which is what you are setting up. WL_SEAT
is for "seats" inside a single Weston session so that you can group
input devices to different wl_seat Wayland objects. Particularly, two
mouse devices in the same wl_seat move the same pointer, while two
mouse devices in different wl_seats gets you two independent pointers
in the same session.
In fact, this is the thing I don't quite understand. In what situations
having 2 logical seats inside 1 physical seat is useful? And what seats
the event "wl_registry::global" announces--logical or physical?

Anyway, I set WL_SEAT and ID_SEAT to "seat1" before writing to this
list. For example. {{{
$ udevadm info /sys/devices/pci0000:00/0000:00:0d.0/drm/renderD129
calling: info
P: /devices/pci0000:00/0000:00:0d.0/drm/renderD129
N: dri/renderD129
E: DEVNAME=/dev/dri/renderD129
E: DEVPATH=/devices/pci0000:00/0000:00:0d.0/drm/renderD129
E: DEVTYPE=drm_minor
E: ID_FOR_SEAT=drm-pci-0000_00_0d_0
E: ID_PATH=pci-0000:00:0d.0
E: ID_PATH_TAG=pci-0000_00_0d_0
E: ID_SEAT=seat1
E: MAJOR=226
E: MINOR=129
E: SUBSYSTEM=drm
E: TAGS=:seat:seat1:uaccess:
E: USEC_INITIALIZED=13962813
E: WL_SEAT=seat1
}}}
Post by Pekka Paalanen
Have you tried using the --seat command line argument to make Weston's
DRM-backend pick a seat other than the default "seat0"?
Okay, Weston drives "seat1" if given the option "--seat=seat1" and no
configuration file. But "seat0" where I start Weston freezes until
Weston terminates.

Why should I run "weston-launch" from a virtual terminal? I would like
to run it from "gnome-terminal".

BTW, the option "--connectorid=card1-VGA-2" gives the "unhandled option"
error.
Post by Pekka Paalanen
You would be running an instance of Weston per each seat / gfx card.
It is an old dream of mine to attach all seats to 1 videocard. Is it
possible? If not, is this a limitation of Weston, Wayland, or Linux? I
mean, may 2 processes drive 1 videocard?
Peter Hutterer
2016-01-06 01:11:31 UTC
Permalink
Post by m***@beroal.in.ua
Thank you for your answer.
Post by Pekka Paalanen
On Tue, 5 Jan 2016 00:08:56 +0200
Post by m***@beroal.in.ua
Hello. My computer has 2 seats. By seat I mean a set containing a
monitor, a videocard, a mouse, and a keyboard. I can drive them with 2
Xorg server, and I am looking for how to replicate this configuration
with Wayland.
AFAIK, Weston uses "libinput", so I assigned "WL_SEAT" of input devices
Hi,
should that not be ID_SEAT?
Also remember to set it for the DRM device you want to use with the
seat.
ID_SEAT is for physical seats which is what you are setting up. WL_SEAT
is for "seats" inside a single Weston session so that you can group
input devices to different wl_seat Wayland objects. Particularly, two
mouse devices in the same wl_seat move the same pointer, while two
mouse devices in different wl_seats gets you two independent pointers
in the same session.
In fact, this is the thing I don't quite understand. In what situations
having 2 logical seats inside 1 physical seat is useful?
Multi-pointer scenarios, i.e. you want multiple sets of devices
to interact independently on the same display. google for multi-pointer X
for some more info.
Post by m***@beroal.in.ua
And what seats the
event "wl_registry::global" announces--logical or physical?
logical. any device not on the same physical seat won't be visible at all.
so in the example below, if the input devices are all assigned
ID_SEAT=seat1, you won't have any input devices for the seat 0 instance.

Cheers,
Peter
Post by m***@beroal.in.ua
Anyway, I set WL_SEAT and ID_SEAT to "seat1" before writing to this list.
For example. {{{
$ udevadm info /sys/devices/pci0000:00/0000:00:0d.0/drm/renderD129
calling: info
P: /devices/pci0000:00/0000:00:0d.0/drm/renderD129
N: dri/renderD129
E: DEVNAME=/dev/dri/renderD129
E: DEVPATH=/devices/pci0000:00/0000:00:0d.0/drm/renderD129
E: DEVTYPE=drm_minor
E: ID_FOR_SEAT=drm-pci-0000_00_0d_0
E: ID_PATH=pci-0000:00:0d.0
E: ID_PATH_TAG=pci-0000_00_0d_0
E: ID_SEAT=seat1
E: MAJOR=226
E: MINOR=129
E: SUBSYSTEM=drm
E: USEC_INITIALIZED=13962813
E: WL_SEAT=seat1
}}}
Post by Pekka Paalanen
Have you tried using the --seat command line argument to make Weston's
DRM-backend pick a seat other than the default "seat0"?
Okay, Weston drives "seat1" if given the option "--seat=seat1" and no
configuration file. But "seat0" where I start Weston freezes until Weston
terminates.
Why should I run "weston-launch" from a virtual terminal? I would like to
run it from "gnome-terminal".
BTW, the option "--connectorid=card1-VGA-2" gives the "unhandled option"
error.
Post by Pekka Paalanen
You would be running an instance of Weston per each seat / gfx card.
It is an old dream of mine to attach all seats to 1 videocard. Is it
possible? If not, is this a limitation of Weston, Wayland, or Linux? I mean,
may 2 processes drive 1 videocard?
_______________________________________________
wayland-devel mailing list
http://lists.freedesktop.org/mailman/listinfo/wayland-devel
m***@beroal.in.ua
2016-01-06 11:03:02 UTC
Permalink
Post by m***@beroal.in.ua
Post by Pekka Paalanen
Have you tried using the --seat command line argument to make Weston's
DRM-backend pick a seat other than the default "seat0"?
Okay, Weston drives "seat1" if given the option "--seat=seat1" and no
configuration file. But "seat0" where I start Weston freezes until
Weston terminates.
So, what can I do about freezing?
Pekka Paalanen
2016-01-07 08:42:59 UTC
Permalink
On Tue, 5 Jan 2016 18:10:23 +0200
Post by m***@beroal.in.ua
Thank you for your answer.
Post by Pekka Paalanen
On Tue, 5 Jan 2016 00:08:56 +0200
Post by m***@beroal.in.ua
Hello. My computer has 2 seats. By seat I mean a set containing a
monitor, a videocard, a mouse, and a keyboard. I can drive them with 2
Xorg server, and I am looking for how to replicate this configuration
with Wayland.
AFAIK, Weston uses "libinput", so I assigned "WL_SEAT" of input devices
Hi,
should that not be ID_SEAT?
Also remember to set it for the DRM device you want to use with the
seat.
ID_SEAT is for physical seats which is what you are setting up. WL_SEAT
is for "seats" inside a single Weston session so that you can group
input devices to different wl_seat Wayland objects. Particularly, two
mouse devices in the same wl_seat move the same pointer, while two
mouse devices in different wl_seats gets you two independent pointers
in the same session.
In fact, this is the thing I don't quite understand. In what situations
having 2 logical seats inside 1 physical seat is useful? And what seats
the event "wl_registry::global" announces--logical or physical?
Anyway, I set WL_SEAT and ID_SEAT to "seat1" before writing to this
list. For example. {{{
$ udevadm info /sys/devices/pci0000:00/0000:00:0d.0/drm/renderD129
calling: info
P: /devices/pci0000:00/0000:00:0d.0/drm/renderD129
N: dri/renderD129
E: DEVNAME=/dev/dri/renderD129
E: DEVPATH=/devices/pci0000:00/0000:00:0d.0/drm/renderD129
E: DEVTYPE=drm_minor
E: ID_FOR_SEAT=drm-pci-0000_00_0d_0
E: ID_PATH=pci-0000:00:0d.0
E: ID_PATH_TAG=pci-0000_00_0d_0
E: ID_SEAT=seat1
E: MAJOR=226
E: MINOR=129
E: SUBSYSTEM=drm
E: USEC_INITIALIZED=13962813
E: WL_SEAT=seat1
}}}
Peter already replied to the above.
Post by m***@beroal.in.ua
Post by Pekka Paalanen
Have you tried using the --seat command line argument to make Weston's
DRM-backend pick a seat other than the default "seat0"?
Okay, Weston drives "seat1" if given the option "--seat=seat1" and no
configuration file. But "seat0" where I start Weston freezes until
Weston terminates.
What do you mean by "freeze"? Black screen? Blank screen? Desktop, but
no reaction to any input? Does the clock update? Got a log from that,
does it open any input devices then?
Post by m***@beroal.in.ua
Why should I run "weston-launch" from a virtual terminal? I would like
to run it from "gnome-terminal".
You cannot run it from X, because the X server is already holding the
DRM master for the gfx card. The X server must release DRM master
before Weston can get it, and you do that by switching away from X's VT
or quitting X. DRM master status is required for controlling KMS
resources by the Weston DRM-backend.

Essentially, this way a random program cannot steal your gfx card away
from your desktop session.

If you want to run Weston from X, use 'weston' which will then open an
X window for Weston and it behaves like any X app, using the X11-backend.
Post by m***@beroal.in.ua
BTW, the option "--connectorid=card1-VGA-2" gives the "unhandled option"
error.
That's because the option is --connector, not --connectorid. The value
is also an integer, not a name.
Post by m***@beroal.in.ua
Post by Pekka Paalanen
You would be running an instance of Weston per each seat / gfx card.
It is an old dream of mine to attach all seats to 1 videocard. Is it
possible? If not, is this a limitation of Weston, Wayland, or Linux? I
mean, may 2 processes drive 1 videocard?
It is not possible. It is a limitation of DRM in the Linux kernel. It
does not implement splitting KMS resources of a single device to
several device nodes. A program that opens a device node gets exclusive
control of all KMS resources on that node by becoming "DRM master".
It's all or nothing.

Another solution would be to run a system compositor controlling all
heads, and then running one compositor per seat under the system
compositor. I think this is largely unimplemented in Weston as a system
compositor, though, particularly for the input side.


Thanks,
pq
m***@beroal.in.ua
2016-01-07 10:32:17 UTC
Permalink
Post by Pekka Paalanen
Post by m***@beroal.in.ua
Post by Pekka Paalanen
Have you tried using the --seat command line argument to make Weston's
DRM-backend pick a seat other than the default "seat0"?
Okay, Weston drives "seat1" if given the option "--seat=seat1" and no
configuration file. But "seat0" where I start Weston freezes until
Weston terminates.
What do you mean by "freeze"? Black screen? Blank screen? Desktop, but
no reaction to any input? Does the clock update? Got a log from that,
does it open any input devices then?
I run "weston-launch" from a virtual terminal/agetty/login/bash. The
screen does not change, the cursor does not blink. No reaction. I don't
understand what log should I provide.
Post by Pekka Paalanen
Post by m***@beroal.in.ua
Why should I run "weston-launch" from a virtual terminal? I would like
to run it from "gnome-terminal".
You cannot run it from X, because the X server is already holding the
DRM master for the gfx card. The X server must release DRM master
before Weston can get it, and you do that by switching away from X's VT
or quitting X. DRM master status is required for controlling KMS
resources by the Weston DRM-backend.
But I want to run Weston on a gfx card other than X is running on. I
have 2 gfx cards.
Pekka Paalanen
2016-01-07 11:14:37 UTC
Permalink
On Thu, 7 Jan 2016 12:32:17 +0200
Post by m***@beroal.in.ua
Post by Pekka Paalanen
Post by m***@beroal.in.ua
Post by Pekka Paalanen
Have you tried using the --seat command line argument to make Weston's
DRM-backend pick a seat other than the default "seat0"?
Okay, Weston drives "seat1" if given the option "--seat=seat1" and no
configuration file. But "seat0" where I start Weston freezes until
Weston terminates.
What do you mean by "freeze"? Black screen? Blank screen? Desktop, but
no reaction to any input? Does the clock update? Got a log from that,
does it open any input devices then?
I run "weston-launch" from a virtual terminal/agetty/login/bash. The
screen does not change, the cursor does not blink. No reaction. I don't
understand what log should I provide.
Weston stdout and stderr are generally referred to as Weston's log.
There is also a --log command line option, but that catches only
Weston's own messages.
Post by m***@beroal.in.ua
Post by Pekka Paalanen
Post by m***@beroal.in.ua
Why should I run "weston-launch" from a virtual terminal? I would like
to run it from "gnome-terminal".
You cannot run it from X, because the X server is already holding the
DRM master for the gfx card. The X server must release DRM master
before Weston can get it, and you do that by switching away from X's VT
or quitting X. DRM master status is required for controlling KMS
resources by the Weston DRM-backend.
But I want to run Weston on a gfx card other than X is running on. I
have 2 gfx cards.
Ok, then you are left with the VT management issues, which I didn't
mention yet. I don't actually know what is needed to (not) do when
using a gfx card that is not used for the console. I believe this is a
use case Weston hasn't considered yet.

VT management issues might also be responsible for the "freeze" you
described.


Thanks,
pq
m***@beroal.in.ua
2016-01-07 12:36:42 UTC
Permalink
Post by Pekka Paalanen
Post by m***@beroal.in.ua
But I want to run Weston on a gfx card other than X is running on. I
have 2 gfx cards.
Ok, then you are left with the VT management issues, which I didn't
mention yet. I don't actually know what is needed to (not) do when
using a gfx card that is not used for the console. I believe this is a
use case Weston hasn't considered yet.
VT management issues might also be responsible for the "freeze" you
described.
I just run Xorg on "seat1" with "-sharevts" and "-novtswitch" and don't
give it much thought. I use VTs on "seat0" only.
Post by Pekka Paalanen
Post by m***@beroal.in.ua
Post by Pekka Paalanen
Post by m***@beroal.in.ua
Post by Pekka Paalanen
Have you tried using the --seat command line argument to make Weston's
DRM-backend pick a seat other than the default "seat0"?
Okay, Weston drives "seat1" if given the option "--seat=seat1" and no
configuration file. But "seat0" where I start Weston freezes until
Weston terminates.
What do you mean by "freeze"? Black screen? Blank screen? Desktop, but
no reaction to any input? Does the clock update? Got a log from that,
does it open any input devices then?
I run "weston-launch" from a virtual terminal/agetty/login/bash. The
screen does not change, the cursor does not blink. No reaction. I don't
understand what log should I provide.
Weston stdout and stderr are generally referred to as Weston's log.
There is also a --log command line option, but that catches only
Weston's own messages.
{{{
Date: 2016-01-07 EET
[14:11:23.025] weston 1.9.0
http://wayland.freedesktop.org
Bug reports to:
https://bugs.freedesktop.org/enter_bug.cgi?product=Wayland&component=weston&version=1.9.0
Build: 1.8.93-2-gb05cdb8 configure.ac: bump to version
1.9.0 for the official release (2015-09-21 18:11:26 -0700)
[14:11:23.026] OS: Linux, 4.3.3-2-ARCH, #1 SMP PREEMPT Wed Dec 23
20:09:18 CET 2015, x86_64
[14:11:23.026] Using config file './weston.ini'
[14:11:23.027] Loading module '/usr/lib/weston/drm-backend.so'
[14:11:23.169] Output repaint window is 7 ms maximum.
[14:11:23.169] initializing drm backend
device-enumerator: scan all dirs
device-enumerator: scanning /sys/bus
device-enumerator: scanning /sys/class
[14:11:23.171] using /dev/dri/card1
[14:11:23.171] Loading module '/usr/lib/weston/gl-renderer.so'
[14:11:23.601] EGL client extensions: EGL_EXT_client_extensions
EGL_EXT_platform_base EGL_EXT_platform_wayland
EGL_EXT_platform_x11 EGL_KHR_client_get_all_proc_addresses
EGL_MESA_platform_gbm
[14:11:23.601] warning: EGL_EXT_swap_buffers_with_damage not supported.
Performance could be affected.
device-enumerator: scan all dirs
device-enumerator: scanning /sys/bus
device-enumerator: scanning /sys/class
[14:11:23.616] input device 'USB USB Keyboard', /dev/input/event1 is
tagged by udev as: Keyboard
[14:11:23.616] input device 'USB USB Keyboard', /dev/input/event1 is a
keyboard
[14:11:23.617] input device 'USB USB Keyboard', /dev/input/event2 is
tagged by udev as: Keyboard
[14:11:23.617] input device 'USB USB Keyboard', /dev/input/event2 is a
keyboard
[14:11:23.618] input device 'ImPS/2 Generic Wheel Mouse',
/dev/input/event8 is tagged by udev as: Mouse
[14:11:23.618] input device 'ImPS/2 Generic Wheel Mouse',
/dev/input/event8 is a pointer caps
[14:11:23.662] EGL version: 1.4 (DRI2)
[14:11:23.662] EGL vendor: Mesa Project
[14:11:23.662] EGL client APIs: OpenGL OpenGL_ES OpenGL_ES2
[14:11:23.662] EGL extensions: EGL_EXT_buffer_age
EGL_EXT_image_dma_buf_import
EGL_KHR_create_context EGL_KHR_get_all_proc_addresses
EGL_KHR_gl_renderbuffer_image EGL_KHR_gl_texture_2D_image
EGL_KHR_gl_texture_cubemap_image EGL_KHR_image
EGL_KHR_image_base EGL_KHR_image_pixmap
EGL_KHR_surfaceless_context EGL_MESA_configless_context
EGL_MESA_drm_image EGL_MESA_image_dma_buf_export
EGL_WL_bind_wayland_display
[14:11:23.662] GL version: OpenGL ES 2.0 Mesa 11.1.0
[14:11:23.662] GLSL version: OpenGL ES GLSL ES 1.0.16
[14:11:23.662] GL vendor: nouveau
[14:11:23.662] GL renderer: Gallium 0.4 on NV4C
[14:11:23.662] GL extensions: GL_EXT_blend_minmax GL_EXT_multi_draw_arrays
GL_EXT_texture_filter_anisotropic
GL_EXT_texture_compression_dxt1
GL_EXT_texture_format_BGRA8888
GL_OES_depth24 GL_OES_element_index_uint
GL_OES_fbo_render_mipmap GL_OES_mapbuffer GL_OES_rgb8_rgba8
GL_OES_stencil8 GL_OES_texture_3D GL_OES_texture_npot
GL_OES_EGL_image GL_OES_depth_texture
GL_OES_packed_depth_stencil
GL_EXT_texture_type_2_10_10_10_REV
GL_OES_get_program_binary GL_APPLE_texture_max_level
GL_EXT_discard_framebuffer GL_EXT_read_format_bgra
GL_NV_fbo_color_attachments GL_OES_EGL_image_external
GL_OES_EGL_sync GL_OES_vertex_array_object
GL_ANGLE_texture_compression_dxt3
GL_ANGLE_texture_compression_dxt5 GL_EXT_unpack_subimage
GL_NV_draw_buffers GL_NV_read_buffer GL_NV_read_depth
GL_NV_read_depth_stencil GL_NV_read_stencil
GL_EXT_draw_buffers
GL_EXT_map_buffer_range GL_KHR_debug
GL_OES_surfaceless_context
GL_EXT_separate_shader_objects
GL_EXT_draw_elements_base_vertex
GL_KHR_context_flush_control
GL_OES_draw_elements_base_vertex
[14:11:23.662] GL ES 2 renderer features:
read-back format: BGRA
wl_shm sub-image to texture: yes
EGL Wayland extension: yes
[14:11:23.662] Chosen EGL config details:
RGBA bits: 8 8 8 0
swap interval range: 0 - 0
[14:11:23.662] Failed to initialize backlight
[14:11:23.662] Output VGA-2, (connector 28, crtc 25)
mode ***@60.0, current
mode ***@60.3
mode ***@56.2
mode ***@60.0
mode ***@59.9
[14:11:23.663] Compositor capabilities:
arbitrary surface rotation: yes
screen capture uses y-flip: yes
presentation clock: CLOCK_MONOTONIC, id 1
[14:11:23.663] Loading module '/usr/lib/weston/desktop-shell.so'
[14:11:23.663] launching '/usr/lib/weston/weston-keyboard'
[14:11:23.664] launching '/usr/lib/weston/weston-desktop-shell'
[14:11:23.736] Warning: computed repaint delay is insane: -1392723845 msec
[14:11:23.921] unexpectedly large timestamp jump (from 12282989 to
2914526298)
}}}

Loading...