mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-01 22:58:38 -04:00
backend/drm: don't free connector immediately
When a pageflip is pending, we'll get a DRM event for the connector in the future. We don't want to free the connector immediately otherwise we'll use-after-free in the pageflip handler. This commit adds a new state, "DISAPPEARED". This asks the pageflip handler to destroy the output after it's done pageflipping.
This commit is contained in:
parent
19f3804548
commit
79dd9ba151
2 changed files with 18 additions and 5 deletions
|
|
@ -104,10 +104,14 @@ struct wlr_drm_backend {
|
|||
};
|
||||
|
||||
enum wlr_drm_connector_state {
|
||||
// Connector is available but no output is plugged in
|
||||
WLR_DRM_CONN_DISCONNECTED,
|
||||
// An output just has been plugged in and is waiting for a modeset
|
||||
WLR_DRM_CONN_NEEDS_MODESET,
|
||||
WLR_DRM_CONN_CLEANUP,
|
||||
WLR_DRM_CONN_CONNECTED,
|
||||
// Connector disappeared, waiting for being destroyed on next page-flip
|
||||
WLR_DRM_CONN_DISAPPEARED,
|
||||
};
|
||||
|
||||
struct wlr_drm_mode {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue