From bc1081b746cc3a224470567990364bf62162b405 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Wed, 13 Feb 2008 19:00:12 -0800 Subject: VESA: move pixel formatting into __vesacon_copy_to_screen() Make pixel formatting an integral part of __vesacon_copy_to_screen(). In order to cut down on the dispatch overhead, make the formatting functions contain the pixel loop, so we only do indirect dispatch twice per pixel row - once for the formatting and once for copying to the screen. --- com32/lib/sys/vesa/drawtxt.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'com32/lib/sys/vesa/drawtxt.c') diff --git a/com32/lib/sys/vesa/drawtxt.c b/com32/lib/sys/vesa/drawtxt.c index 9e222ecc..023c3646 100644 --- a/com32/lib/sys/vesa/drawtxt.c +++ b/com32/lib/sys/vesa/drawtxt.c @@ -29,7 +29,6 @@ #include #include "vesa.h" #include "video.h" -#include "fmtpixel.h" #include "fill.h" /* @@ -84,7 +83,7 @@ static void vesacon_update_characters(int row, int col, int nrows, int ncols) struct vesa_char *rowptr, *rowsptr, *cptr, *csptr; unsigned int bytes_per_pixel = __vesacon_bytes_per_pixel; unsigned long pixel_offset; - uint8_t row_buffer[VIDEO_X_SIZE*4], *rowbufptr; + uint32_t row_buffer[VIDEO_X_SIZE], *rowbufptr; uint8_t *fbrowptr; uint8_t sha; @@ -174,14 +173,11 @@ static void vesacon_update_characters(int row, int col, int nrows, int ncols) color &= 0x3f3f3f; } - rowbufptr = format_pixel(rowbufptr, color, __vesacon_pixel_format); + *rowbufptr++ = color; } /* Copy to frame buffer */ - /* Note that the dword_count is rounded down, not up. That's because - the row_buffer includes a spillover pixel. */ - __vesacon_copy_to_screen(fbrowptr, row_buffer, - (rowbufptr-row_buffer) & ~3); + __vesacon_copy_to_screen(fbrowptr, row_buffer, rowbufptr-row_buffer); bgrowptr += VIDEO_X_SIZE; fbrowptr += __vesa_info.mi.logical_scan; -- cgit