From 8453b73b16c5983d2cacb2c8437b4d1243722e51 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Imre=20Vad=C3=A1sz?= Date: Thu, 26 Nov 2015 22:56:38 +0100 Subject: [PATCH] syscons: Get rid of xpad variable by adjusting loop in sckmsrndr.c --- sys/dev/misc/syscons/sckmsrndr.c | 9 ++++----- sys/dev/misc/syscons/scvidctl.c | 1 - sys/dev/misc/syscons/syscons.c | 1 - sys/dev/misc/syscons/syscons.h | 1 - 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/sys/dev/misc/syscons/sckmsrndr.c b/sys/dev/misc/syscons/sckmsrndr.c index 2492af6bdc..c699db1520 100644 --- a/sys/dev/misc/syscons/sckmsrndr.c +++ b/sys/dev/misc/syscons/sckmsrndr.c @@ -226,8 +226,8 @@ kms_draw(scr_stat *scp, int from, int count, int flip) if (from + count > scp->xsize * scp->ysize) count = scp->xsize * scp->ysize - from; + p = draw_pos; for (i = from; count-- > 0; i++) { - p = draw_pos; char_data = &(scp->font[sc_vtb_getc(&scp->vtb, i) * scp->font_height]); @@ -242,11 +242,10 @@ kms_draw(scr_stat *scp, int from, int count, int flip) blit_blk(scp, char_data, scp->font_width, scp->font_height, p, pixel_size, scp->blk_width, scp->blk_height, line_width, fg, bg, BLIT_SET); - draw_pos += scp->blk_width * pixel_size; + p += scp->blk_width * pixel_size; if ((i % scp->xsize) == scp->xsize - 1) { - draw_pos += - (scp->blk_height - 1) * line_width + - scp->xpad * pixel_size; + draw_pos += scp->blk_height * line_width; + p = draw_pos; } } } diff --git a/sys/dev/misc/syscons/scvidctl.c b/sys/dev/misc/syscons/scvidctl.c index 68f07965ec..9654bd03e5 100644 --- a/sys/dev/misc/syscons/scvidctl.c +++ b/sys/dev/misc/syscons/scvidctl.c @@ -844,7 +844,6 @@ sc_update_render(scr_stat *scp) /* scp->xsize = scp->xpixel / scp->blk_width; total possible */ scp->xsize = desired_cols; scp->ysize = scp->ypixel / scp->blk_height; - scp->xpad = scp->fbi->stride / 4 - scp->xsize * scp->blk_width; kprintf("kms console: scale-to %dx%d cols=%d rows=%d\n", scp->blk_width, scp->blk_height, diff --git a/sys/dev/misc/syscons/syscons.c b/sys/dev/misc/syscons/syscons.c index 25eed6b6c2..7dba68c5e2 100644 --- a/sys/dev/misc/syscons/syscons.c +++ b/sys/dev/misc/syscons/syscons.c @@ -3322,7 +3322,6 @@ init_scp(sc_softc_t *sc, int vty, scr_stat *scp) scp->xsize = scp->xpixel / scp->blk_width; scp->ysize = scp->ypixel / scp->blk_height; - scp->xpad = scp->fbi->stride / 4 - scp->xsize * scp->blk_width; } sc_vtb_init(&scp->vtb, VTB_MEMORY, 0, 0, NULL, FALSE); sc_vtb_init(&scp->scr, VTB_FRAMEBUFFER, 0, 0, NULL, FALSE); diff --git a/sys/dev/misc/syscons/syscons.h b/sys/dev/misc/syscons/syscons.h index 2137e39bd7..59922f56bd 100644 --- a/sys/dev/misc/syscons/syscons.h +++ b/sys/dev/misc/syscons/syscons.h @@ -262,7 +262,6 @@ typedef struct scr_stat { int ysize; /* Y text size */ int xpixel; /* X graphics size */ int ypixel; /* Y graphics size */ - int xpad; /* for xsize * font_width != fbi->stride */ int xoff; /* X offset in pixel mode */ int yoff; /* Y offset in pixel mode */ -- 2.11.4.GIT