The efifb driver behaves almost identically to the inteldrm driver
for wscons, but did not implement the getchar() accessops, so
wsmoused would fail at startup.

Separately, I increased the maximum screen dimensions to 160x50 to
allow the 12x24 font to be used on an 1920 monitor, which looks great!

Unlike the intel driver, efifb has a static buffer of that size,
which is a non-trivial amount of memory.  Not setting the backing
store to save the memory results in an ultra-slow console until the
driver gets fully initialized, because it is doing scrolls by reading
from write combined memory instead of the redrawing all the
characters.

I plan on changing that to a dynamic allocation once I am more
comfortable with the reinitialization that goes on when autoconf
gets around to the console display device, so feel free to punt on
that if you want to wait.

Index: efifb.c
===================================================================
RCS file: /cvs/src/sys/arch/amd64/amd64/efifb.c,v
retrieving revision 1.27
diff -u -p -r1.27 efifb.c
--- efifb.c     24 Jan 2020 05:27:31 -0000      1.27
+++ efifb.c     24 May 2020 23:32:47 -0000
@@ -100,6 +100,7 @@ int  efifb_alloc_screen(void *, const st
 void    efifb_free_screen(void *, void *);
 int     efifb_show_screen(void *, void *, int, void (*cb) (void *, int,
int),
            void *);
+int     efifb_getchar(void *, int, int, struct wsdisplay_charcell *);
 int     efifb_list_font(void *, struct wsdisplay_font *);
 int     efifb_load_font(void *, void *, struct wsdisplay_font *);
 void    efifb_scrollback(void *, void *, int lines);
@@ -114,8 +115,9 @@ const struct cfattach efifb_ca = {
        sizeof(struct efifb_softc), efifb_match, efifb_attach, NULL
 };
 
-#define        EFIFB_WIDTH     100
-#define        EFIFB_HEIGHT    31
+/* support a 12x24 font on a 1920x1200 screen */
+#define        EFIFB_WIDTH     160
+#define        EFIFB_HEIGHT    50
 
 struct wsscreen_descr efifb_std_descr = { "std" };
 
@@ -133,6 +135,7 @@ struct wsdisplay_accessops efifb_accesso
        .alloc_screen = efifb_alloc_screen,
        .free_screen = efifb_free_screen,
        .show_screen = efifb_show_screen,
+       .getchar = efifb_getchar,
        .load_font = efifb_load_font,
        .list_font = efifb_list_font,
        .scrollback = efifb_scrollback,
@@ -371,6 +374,15 @@ efifb_show_screen(void *v, void *cookie,
        struct rasops_info      *ri = &sc->sc_fb->rinfo;
 
        return rasops_show_screen(ri, cookie, waitok, cb, cb_arg);
+}
+
+int
+efifb_getchar(void *v, int row, int col, struct wsdisplay_charcell
*cell)
+{
+       struct efifb_softc      *sc = v;
+       struct rasops_info      *ri = &sc->sc_fb->rinfo;
+
+       return rasops_getchar(ri, row, col, cell);
 }
 
 int


Reply via email to