mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-05 15:48:05 +02:00
backend-drm: obtain DRM backend from listener in session_notify()
The session_listener is embedded in the DRM backend structure. Use this to obtain the DRM backend with container_of(). That way the DRM backend will not have to be found from the compositor. This is trivial now, but in the multi-backend case would entail iterating over all backends to find the correct one. Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
This commit is contained in:
parent
d0301c9a82
commit
9e070c0840
1 changed files with 2 additions and 1 deletions
|
|
@ -3206,7 +3206,8 @@ static void
|
|||
session_notify(struct wl_listener *listener, void *data)
|
||||
{
|
||||
struct weston_compositor *compositor = data;
|
||||
struct drm_backend *b = to_drm_backend(compositor);
|
||||
struct drm_backend *b =
|
||||
container_of(listener, struct drm_backend, session_listener);
|
||||
struct drm_device *device = b->drm;
|
||||
struct weston_output *output;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue