From 2d445fb18c3d0ca4b9673a8a7fda67f57f46e06e Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Thu, 20 Apr 2017 17:22:03 +0000 Subject: [PATCH] Eliminate the ega renderer switch. It did nothing useful except hold a pointer to the main ega drawing method which is misoptimized be in a different function than the main vga planar mode drawing method. Vga initialization handles everything with no extra code except for selecting the different function. --- sys/dev/syscons/scvgarndr.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/sys/dev/syscons/scvgarndr.c b/sys/dev/syscons/scvgarndr.c index 720c64d037ad..98bd80b4a2b7 100644 --- a/sys/dev/syscons/scvgarndr.c +++ b/sys/dev/syscons/scvgarndr.c @@ -111,19 +111,6 @@ RENDERER(ega, 0, txtrndrsw, vga_set); RENDERER(vga, 0, txtrndrsw, vga_set); #ifdef SC_PIXEL_MODE -static sc_rndr_sw_t egarndrsw = { - (vr_init_t *)vga_nop, - vga_pxlclear_planar, - vga_pxlborder_planar, - vga_egadraw, - vga_pxlcursor_shape, - vga_pxlcursor_planar, - vga_pxlblink_planar, - (vr_set_mouse_t *)vga_nop, - vga_pxlmouse_planar, -}; -RENDERER(ega, PIXEL_MODE, egarndrsw, vga_set); - static sc_rndr_sw_t vgarndrsw = { vga_rndrinit, (vr_clear_t *)vga_nop, @@ -135,6 +122,7 @@ static sc_rndr_sw_t vgarndrsw = { (vr_set_mouse_t *)vga_nop, (vr_draw_mouse_t *)vga_nop, }; +RENDERER(ega, PIXEL_MODE, vgarndrsw, vga_set); RENDERER(vga, PIXEL_MODE, vgarndrsw, vga_set); #endif /* SC_PIXEL_MODE */ @@ -536,7 +524,10 @@ vga_rndrinit(scr_stat *scp) if (scp->sc->adp->va_info.vi_mem_model == V_INFO_MM_PLANAR) { scp->rndr->clear = vga_pxlclear_planar; scp->rndr->draw_border = vga_pxlborder_planar; - scp->rndr->draw = vga_vgadraw_planar; + if (scp->sc->adp->va_type == KD_VGA) + scp->rndr->draw = vga_egadraw; + else + scp->rndr->draw = vga_vgadraw_planar; scp->rndr->draw_cursor = vga_pxlcursor_planar; scp->rndr->blink_cursor = vga_pxlblink_planar; scp->rndr->draw_mouse = vga_pxlmouse_planar;