aboutsummaryrefslogtreecommitdiff
path: root/backend/drm/drm.c
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2024-02-21 12:35:52 +0100
committerAlexander Orzechowski <alex@ozal.ski>2024-02-21 15:10:44 +0000
commit0d9ffef7747402734803441d312034926bff951e (patch)
tree039fa575eb5c78e1a78880e7de45e814534b8e9c /backend/drm/drm.c
parentd8f4a3d78c6eaf090c101de8a5a9b1bd85a369e4 (diff)
backend/drm: don't destroy previous DRM master blobs
On startup, we fetch the previous MODE_ID blob ID so that compositors can keep using the previous mode if they want to. However, that blob doesn't belong to us, it belongs to the previous DRM master. As a result, we get an error when trying to destroy it. Fix this by tracking whether the blob belongs to us or not. Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3811
Diffstat (limited to 'backend/drm/drm.c')
-rw-r--r--backend/drm/drm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c
index d92b41d3..fd6bf513 100644
--- a/backend/drm/drm.c
+++ b/backend/drm/drm.c
@@ -329,7 +329,7 @@ void finish_drm_resources(struct wlr_drm_backend *drm) {
for (size_t i = 0; i < drm->num_crtcs; ++i) {
struct wlr_drm_crtc *crtc = &drm->crtcs[i];
- if (crtc->mode_id) {
+ if (crtc->mode_id && crtc->own_mode_id) {
drmModeDestroyPropertyBlob(drm->fd, crtc->mode_id);
}
if (crtc->gamma_lut) {
@@ -1483,6 +1483,7 @@ static bool connect_drm_connector(struct wlr_drm_connector *wlr_conn,
get_drm_prop(drm->fd, wlr_conn->crtc->id,
wlr_conn->crtc->props.mode_id, &mode_id);
+ wlr_conn->crtc->own_mode_id = false;
wlr_conn->crtc->mode_id = mode_id;
wlr_conn->refresh = calculate_refresh_rate(current_modeinfo);
}