[linux] reprogram font before mapping framebuffer

You can't reprogram the Linux console font while holding
a map of the framebuffer, annoyingly. Move the attempt to
reprogram the fonts prior to the acquisition of the
framebuffer. The problem with this is that it clears the
framebuffer, so we're going to need to get a copy of it
beforehand, which we will reblit afterwards #2108.
pull/2122/head
nick black 3 years ago
parent 38495fd00b
commit 4bcd773569
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -637,7 +637,7 @@ int reprogram_console_font(tinfo* ti, unsigned no_font_changes,
free(cfo.data);
return -1;
}
int r = reprogram_linux_font(ti->linux_fb_fd, &cfo, &map, no_font_changes,
int r = reprogram_linux_font(ti->ttyfd, &cfo, &map, no_font_changes,
halfblocks, quadrants);
free(cfo.data);
free(map.entries);

@ -582,6 +582,11 @@ apply_term_heuristics(tinfo* ti, const char* termname, queried_terminals_e qterm
if(uname(&un) == 0){
ti->termversion = strdup(un.release);
}
ti->caps.halfblocks = false;
ti->caps.braille = false; // no caps.braille, no caps.sextants in linux console
if(ti->ttyfd >= 0){
reprogram_console_font(ti, nonewfonts, &ti->caps.halfblocks, &ti->caps.quadrants);
}
if(is_linux_framebuffer(ti)){
termname = "Linux framebuffer";
setup_fbcon_bitmaps(ti, ti->linux_fb_fd);
@ -589,9 +594,6 @@ apply_term_heuristics(tinfo* ti, const char* termname, queried_terminals_e qterm
termname = "Linux console";
}
// assume no useful unicode drawing unless we're positively sure
ti->caps.halfblocks = false;
reprogram_console_font(ti, nonewfonts, &ti->caps.halfblocks, &ti->caps.quadrants);
ti->caps.braille = false; // no caps.braille, no caps.sextants in linux console
#else
(void)nonewfonts;
#endif

Loading…
Cancel
Save