Skip to content

Commit

Permalink
(egl-dri) retain device display mapping
Browse files Browse the repository at this point in the history
When a display is unmapped or lost, avoid NULL-ing out the reference
to the device itself as the conductor registration / deregistration
still need the reference for bookkeeping.

This fixes some NULL-deref-on-unmapped-display unplug.
  • Loading branch information
letoram committed Mar 18, 2023
1 parent c19355f commit f8d1dbd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -30,6 +30,7 @@
* audio: stub platform added
* egl-dri: evict streams
* egl-dri: default to atomic over legacy
* egl-dri: retain device tracking for unmapped display

## Shmif
* add audio only- segment type
Expand Down
4 changes: 2 additions & 2 deletions src/platform/egl-dri/video.c
Expand Up @@ -2756,7 +2756,6 @@ static void disable_display(struct dispout* d, bool dealloc)
}

if (d->state == DISP_KNOWN){
d->device = NULL;
d->state = DISP_UNUSED;
return;
}
Expand Down Expand Up @@ -2861,7 +2860,8 @@ static void disable_display(struct dispout* d, bool dealloc)
drmModeFreeCrtc(d->display.old_crtc);
d->display.old_crtc = NULL;

/* d->device = NULL; */
/* keep the device mapping around as the conductor and other parts might
* need to scan/probe the device itself without the display actually used */
d->state = DISP_UNUSED;

if (d->backlight){
Expand Down

0 comments on commit f8d1dbd

Please sign in to comment.