backend-drm: handle multiple drm nodes with logind

When using logind launcher, we receive a PauseDevice "gone" message
from logind session management for each device we close while looking
for KMS devices.

Make logind notify the backend of the device add/remove so that the
backend can decide what to do, instead of assuming that if it is a
DRM_MAJOR device the session should be (de)activated. The backend can
then react to its specific device.

Fixes #251

Signed-off-by: Robert Beckett <bob.beckett@collabora.com>
This commit is contained in:
Robert Beckett
2019-06-13 16:55:44 +01:00
parent 68d49d772c
commit 8d23ab78bd
3 changed files with 51 additions and 7 deletions
+13
View File
@@ -1034,6 +1034,19 @@ struct weston_backend {
struct weston_output *
(*create_output)(struct weston_compositor *compositor,
const char *name);
/** Notify of device addition/removal
*
* @param compositor The compositor.
* @param device The device that has changed.
* @param added Where it was added (or removed)
*
* Called when a device has been added/removed from the session.
* The backend can decide what to do based on whether it is a
* device that it is controlling or not.
*/
void (*device_changed)(struct weston_compositor *compositor,
dev_t device, bool added);
};
/** Callback for saving calibration