SHL_EXPORT void uterm_mode_unbind(struct uterm_mode *mode) { if (!mode) return; mode->disp = NULL; shl_dlist_unlink(&mode->list); uterm_mode_unref(mode); }
static void display_deactivate_force(struct uterm_display *disp, bool force) { if (!disp->video || !(disp->flags & DISPLAY_ONLINE)) return; log_info("deactivating device %s", disp->fbdev.node); uterm_mode_unref(disp->modes); disp->modes = NULL; disp->current_mode = NULL; munmap(disp->fbdev.map, disp->fbdev.len); if (!force) disp->flags &= ~DISPLAY_ONLINE; }
void uterm_display_unref(struct uterm_display *disp) { struct uterm_mode *mode; if (!disp || !disp->ref || --disp->ref) return; log_info("free display %p", disp); VIDEO_CALL(disp->ops->destroy, 0, disp); while ((mode = disp->modes)) { disp->modes = mode->next; mode->next = NULL; uterm_mode_unref(mode); } free(disp); }