diff options
author | wkoszek <wkoszek@FreeBSD.org> | 2007-12-29 23:26:59 +0000 |
---|---|---|
committer | wkoszek <wkoszek@FreeBSD.org> | 2007-12-29 23:26:59 +0000 |
commit | bb029b61d9d00673b61ff3bd4589761e3ddbd060 (patch) | |
tree | 2208d9a465b1ecf2354401f83d3b431d9003169a /sys/dev/syscons | |
parent | 8a0ce839351386ec837779aa9f63b575cf8d096a (diff) | |
download | FreeBSD-src-bb029b61d9d00673b61ff3bd4589761e3ddbd060.zip FreeBSD-src-bb029b61d9d00673b61ff3bd4589761e3ddbd060.tar.gz |
Replace explicit calls to video methods with their respective variants
implemented with macros. This patch improves code readability. Reasoning
behind vidd_* is a sort of "video discipline".
List of macros is supposed to be complete--all methods of video_switch
ought to have their respective macros from now on.
Functionally, this code should be no-op. My intention is to leave current
behaviour of touched code as is.
No objections: rwatson
Silence on: freebsd-current@
Approved by: cognet
Diffstat (limited to 'sys/dev/syscons')
-rw-r--r-- | sys/dev/syscons/blank/blank_saver.c | 6 | ||||
-rw-r--r-- | sys/dev/syscons/daemon/daemon_saver.c | 2 | ||||
-rw-r--r-- | sys/dev/syscons/dragon/dragon_saver.c | 8 | ||||
-rw-r--r-- | sys/dev/syscons/fade/fade_saver.c | 16 | ||||
-rw-r--r-- | sys/dev/syscons/fire/fire_saver.c | 14 | ||||
-rw-r--r-- | sys/dev/syscons/green/green_saver.c | 7 | ||||
-rw-r--r-- | sys/dev/syscons/logo/logo_saver.c | 18 | ||||
-rw-r--r-- | sys/dev/syscons/rain/rain_saver.c | 16 | ||||
-rw-r--r-- | sys/dev/syscons/scgfbrndr.c | 57 | ||||
-rw-r--r-- | sys/dev/syscons/scvgarndr.c | 25 | ||||
-rw-r--r-- | sys/dev/syscons/scvidctl.c | 14 | ||||
-rw-r--r-- | sys/dev/syscons/snake/snake_saver.c | 2 | ||||
-rw-r--r-- | sys/dev/syscons/star/star_saver.c | 2 | ||||
-rw-r--r-- | sys/dev/syscons/syscons.c | 32 | ||||
-rw-r--r-- | sys/dev/syscons/warp/warp_saver.c | 16 |
15 files changed, 108 insertions, 127 deletions
diff --git a/sys/dev/syscons/blank/blank_saver.c b/sys/dev/syscons/blank/blank_saver.c index 960acca..ad1ef74 100644 --- a/sys/dev/syscons/blank/blank_saver.c +++ b/sys/dev/syscons/blank/blank_saver.c @@ -42,16 +42,14 @@ static int blank_saver(video_adapter_t *adp, int blank) { - (*vidsw[adp->va_index]->blank_display)(adp, - (blank) ? V_DISPLAY_BLANK - : V_DISPLAY_ON); + vidd_blank_display(adp, (blank) ? V_DISPLAY_BLANK : V_DISPLAY_ON); return 0; } static int blank_init(video_adapter_t *adp) { - if ((*vidsw[adp->va_index]->blank_display)(adp, V_DISPLAY_ON) == 0) + if (vidd_blank_display(adp, V_DISPLAY_ON) == 0) return 0; return ENODEV; } diff --git a/sys/dev/syscons/daemon/daemon_saver.c b/sys/dev/syscons/daemon/daemon_saver.c index 92d807f..b15e04c 100644 --- a/sys/dev/syscons/daemon/daemon_saver.c +++ b/sys/dev/syscons/daemon/daemon_saver.c @@ -225,7 +225,7 @@ daemon_saver(video_adapter_t *adp, int blank) /* clear the screen and set the border color */ sc_vtb_clear(&scp->scr, sc->scr_map[0x20], ATTR(FG_LIGHTGREY | BG_BLACK)); - (*vidsw[adp->va_index]->set_hw_cursor)(adp, -1, -1); + vidd_set_hw_cursor(adp, -1, -1); sc_set_border(scp, 0); xlen = ylen = tlen = 0; } diff --git a/sys/dev/syscons/dragon/dragon_saver.c b/sys/dev/syscons/dragon/dragon_saver.c index f8fa51b..6294daa 100644 --- a/sys/dev/syscons/dragon/dragon_saver.c +++ b/sys/dev/syscons/dragon/dragon_saver.c @@ -135,13 +135,13 @@ dragon_update(video_adapter_t *adp) int tmp; if (curve > CURVE) { - (*vidsw[adp->va_index]->clear)(adp); + vidd_clear(adp); /* set palette of each curves */ for (tmp = 0; tmp < 3*CURVE; ++tmp) { dragon_pal[3+tmp] = (u_char)random(); } - load_palette(adp, dragon_pal); + vidd_load_palette(adp, dragon_pal); mul = ((random() & 7) + 1) * (SCRW / 320); org_x = random() % SCRW; org_y = random() % SCRH; @@ -207,7 +207,7 @@ dragon_saver(video_adapter_t *adp, int blank) /* switch to graphics mode */ if (blanked <= 0) { pl = splhigh(); - set_video_mode(adp, VIDEO_MODE); + vidd_set_mode(adp, VIDEO_MODE); vid = (u_char *)adp->va_window; curve = CURVE + 1; ++blanked; @@ -229,7 +229,7 @@ dragon_init(video_adapter_t *adp) video_info_t info; /* check that the console is capable of running in 320x200x256 */ - if (get_mode_info(adp, VIDEO_MODE, &info)) { + if (vidd_get_info(adp, VIDEO_MODE, &info)) { log(LOG_NOTICE, "%s: the console does not support " VIDEO_MODE_NAME "\n", SAVER_NAME); diff --git a/sys/dev/syscons/fade/fade_saver.c b/sys/dev/syscons/fade/fade_saver.c index d7793b6..27d732c 100644 --- a/sys/dev/syscons/fade/fade_saver.c +++ b/sys/dev/syscons/fade/fade_saver.c @@ -51,7 +51,7 @@ fade_saver(video_adapter_t *adp, int blank) if (blank) { if (ISPALAVAIL(adp->va_flags)) { if (count <= 0) - save_palette(adp, palette); + vidd_save_palette(adp, palette); if (count < 256) { pal[0] = pal[1] = pal[2] = 0; for (i = 3; i < 256*3; i++) { @@ -60,20 +60,18 @@ fade_saver(video_adapter_t *adp, int blank) else pal[i] = 60; } - load_palette(adp, pal); + vidd_load_palette(adp, pal); count++; } } else { - (*vidsw[adp->va_index]->blank_display)(adp, - V_DISPLAY_BLANK); + vidd_blank_display(adp, V_DISPLAY_BLANK); } } else { if (ISPALAVAIL(adp->va_flags)) { - load_palette(adp, palette); + vidd_load_palette(adp, palette); count = 0; } else { - (*vidsw[adp->va_index]->blank_display)(adp, - V_DISPLAY_ON); + vidd_blank_display(adp, V_DISPLAY_ON); } } return 0; @@ -82,8 +80,8 @@ fade_saver(video_adapter_t *adp, int blank) static int fade_init(video_adapter_t *adp) { - if (!ISPALAVAIL(adp->va_flags) - && (*vidsw[adp->va_index]->blank_display)(adp, V_DISPLAY_ON) != 0) + if (!ISPALAVAIL(adp->va_flags) && + vidd_blank_display(adp, V_DISPLAY_ON) != 0) return ENODEV; return 0; } diff --git a/sys/dev/syscons/fire/fire_saver.c b/sys/dev/syscons/fire/fire_saver.c index de60a20..4c995ef 100644 --- a/sys/dev/syscons/fire/fire_saver.c +++ b/sys/dev/syscons/fire/fire_saver.c @@ -55,7 +55,7 @@ #define SET_ORIGIN(adp, o) do { \ int oo = o; \ if (oo != last_origin) \ - set_origin(adp, last_origin = oo); \ + vidd_set_win_org(adp, last_origin = oo); \ } while (0) static u_char *buf; @@ -118,14 +118,14 @@ fire_saver(video_adapter_t *adp, int blank) /* switch to graphics mode */ if (blanked <= 0) { pl = splhigh(); - set_video_mode(adp, scrmode); - load_palette(adp, fire_pal); + vidd_set_mode(adp, scrmode); + vidd_load_palette(adp, fire_pal); blanked++; vid = (u_char *)adp->va_window; banksize = adp->va_window_size; bpsl = adp->va_line_width; splx(pl); - (*vidsw[adp->va_index]->clear)(adp); + vidd_clear(adp); } fire_update(adp); } else { @@ -141,11 +141,11 @@ fire_init(video_adapter_t *adp) video_info_t info; int i, red, green, blue; - if (!get_mode_info(adp, M_VGA_CG320, &info)) { + if (!vidd_get_info(adp, M_VGA_CG320, &info)) { scrmode = M_VGA_CG320; - } else if (!get_mode_info(adp, M_PC98_PEGC640x480, &info)) { + } else if (!vidd_get_info(adp, M_PC98_PEGC640x480, &info)) { scrmode = M_PC98_PEGC640x480; - } else if (!get_mode_info(adp, M_PC98_PEGC640x400, &info)) { + } else if (!vidd_get_info(adp, M_PC98_PEGC640x400, &info)) { scrmode = M_PC98_PEGC640x400; } else { log(LOG_NOTICE, diff --git a/sys/dev/syscons/green/green_saver.c b/sys/dev/syscons/green/green_saver.c index d6cfe80..b03cc72 100644 --- a/sys/dev/syscons/green/green_saver.c +++ b/sys/dev/syscons/green/green_saver.c @@ -42,16 +42,15 @@ static int green_saver(video_adapter_t *adp, int blank) { - (*vidsw[adp->va_index]->blank_display)(adp, - (blank) ? V_DISPLAY_STAND_BY - : V_DISPLAY_ON); + vidd_blank_display(adp, + (blank) ? V_DISPLAY_STAND_BY : V_DISPLAY_ON); return 0; } static int green_init(video_adapter_t *adp) { - if ((*vidsw[adp->va_index]->blank_display)(adp, V_DISPLAY_ON) == 0) + if (vidd_blank_display(adp, V_DISPLAY_ON) == 0) return 0; return ENODEV; } diff --git a/sys/dev/syscons/logo/logo_saver.c b/sys/dev/syscons/logo/logo_saver.c index 20f2bdc..c77edfb 100644 --- a/sys/dev/syscons/logo/logo_saver.c +++ b/sys/dev/syscons/logo/logo_saver.c @@ -45,7 +45,7 @@ #define SET_ORIGIN(adp, o) do { \ int oo = o; \ if (oo != last_origin) \ - set_origin(adp, last_origin = oo); \ + vidd_set_win_org(adp, last_origin = oo); \ } while (0) extern unsigned int logo_w; @@ -114,15 +114,15 @@ logo_saver(video_adapter_t *adp, int blank) /* switch to graphics mode */ if (blanked <= 0) { pl = splhigh(); - set_video_mode(adp, scrmode); - load_palette(adp, logo_pal); - set_border(adp, 0); + vidd_set_mode(adp, scrmode); + vidd_load_palette(adp, logo_pal); + vidd_set_border(adp, 0); blanked++; vid = (u_char *)adp->va_window; banksize = adp->va_window_size; bpsl = adp->va_line_width; splx(pl); - (*vidsw[adp->va_index]->clear)(adp); + vidd_clear(adp); } logo_update(adp); } else { @@ -136,13 +136,13 @@ logo_init(video_adapter_t *adp) { video_info_t info; - if (!get_mode_info(adp, M_VESA_CG800x600, &info)) { + if (!vidd_get_info(adp, M_VESA_CG800x600, &info)) { scrmode = M_VESA_CG800x600; - } else if (!get_mode_info(adp, M_VGA_CG320, &info)) { + } else if (!vidd_get_info(adp, M_VGA_CG320, &info)) { scrmode = M_VGA_CG320; - } else if (!get_mode_info(adp, M_PC98_PEGC640x480, &info)) { + } else if (!vidd_get_info(adp, M_PC98_PEGC640x480, &info)) { scrmode = M_PC98_PEGC640x480; - } else if (!get_mode_info(adp, M_PC98_PEGC640x400, &info)) { + } else if (!vidd_get_info(adp, M_PC98_PEGC640x400, &info)) { scrmode = M_PC98_PEGC640x400; } else { log(LOG_NOTICE, diff --git a/sys/dev/syscons/rain/rain_saver.c b/sys/dev/syscons/rain/rain_saver.c index 3cdf980..3953137 100644 --- a/sys/dev/syscons/rain/rain_saver.c +++ b/sys/dev/syscons/rain/rain_saver.c @@ -54,7 +54,7 @@ #define SET_ORIGIN(adp, o) do { \ int oo = o; \ if (oo != last_origin) \ - set_origin(adp, last_origin = oo); \ + vidd_set_win_org(adp, last_origin = oo); \ } while (0) static u_char *vid; @@ -71,7 +71,7 @@ rain_update(video_adapter_t *adp) for (i = MAX; i > 1; i--) rain_pal[BLUE(i)] = rain_pal[BLUE(i - 1)]; rain_pal[BLUE(1)] = t; - load_palette(adp, rain_pal); + vidd_load_palette(adp, rain_pal); } static int @@ -85,9 +85,9 @@ rain_saver(video_adapter_t *adp, int blank) /* switch to graphics mode */ if (blanked <= 0) { pl = splhigh(); - set_video_mode(adp, scrmode); - load_palette(adp, rain_pal); - set_border(adp, 0); + vidd_set_mode(adp, scrmode); + vidd_load_palette(adp, rain_pal); + vidd_set_border(adp, 0); blanked++; vid = (u_char *)adp->va_window; banksize = adp->va_window_size; @@ -141,11 +141,11 @@ rain_init(video_adapter_t *adp) video_info_t info; int i; - if (!get_mode_info(adp, M_VGA_CG320, &info)) { + if (!vidd_get_info(adp, M_VGA_CG320, &info)) { scrmode = M_VGA_CG320; - } else if (!get_mode_info(adp, M_PC98_PEGC640x480, &info)) { + } else if (!vidd_get_info(adp, M_PC98_PEGC640x480, &info)) { scrmode = M_PC98_PEGC640x480; - } else if (!get_mode_info(adp, M_PC98_PEGC640x400, &info)) { + } else if (!vidd_get_info(adp, M_PC98_PEGC640x400, &info)) { scrmode = M_PC98_PEGC640x400; } else { log(LOG_NOTICE, diff --git a/sys/dev/syscons/scgfbrndr.c b/sys/dev/syscons/scgfbrndr.c index bca5ad6..20679b7 100644 --- a/sys/dev/syscons/scgfbrndr.c +++ b/sys/dev/syscons/scgfbrndr.c @@ -148,13 +148,13 @@ gfb_nop(scr_stat *scp) static void gfb_clear(scr_stat *scp, int c, int attr) { - (*vidsw[scp->sc->adapter]->clear)(scp->sc->adp); + vidd_clear(scp->sc->adp); } static void gfb_border(scr_stat *scp, int color) { - (*vidsw[scp->sc->adapter]->set_border)(scp->sc->adp, color); + vidd_set_border(scp->sc->adp, color); } static void @@ -187,13 +187,13 @@ gfb_draw(scr_stat *scp, int from, int count, int flip) n = (count / adp->va_info.vi_width) + 1; /* Scroll to make room for new text rows... */ - (*vidsw[scp->sc->adapter]->copy)(adp, n, 0, n); + vidd_copy(adp, n, 0, n); #if 0 - (*vidsw[scp->sc->adapter]->clear)(adp, n); + vidd_clear(adp, n); #endif /* Display new text rows... */ - (*vidsw[scp->sc->adapter]->puts)(adp, from, + vidd_puts(adp, from, (u_int16_t *)sc_vtb_pointer(&scp->vtb, from), count); } @@ -212,11 +212,11 @@ gfb_draw(scr_stat *scp, int from, int count, int flip) for (i = count; i-- > 0; ++from) { c = sc_vtb_getc(&scp->vtb, from); a = sc_vtb_geta(&scp->vtb, from) >> 8; - (*vidsw[scp->sc->adapter]->putc)(adp, from, c, + vidd_putc(adp, from, c, (a >> 4) | ((a & 0xf) << 4)); } else { - (*vidsw[scp->sc->adapter]->puts)(adp, from, + vidd_puts(adp, from, (u_int16_t *)sc_vtb_pointer(&scp->vtb, from), count); } @@ -233,8 +233,8 @@ gfb_cursor_shape(scr_stat *scp, int base, int height, int blink) scp->cursor_base = base; scp->cursor_height = height; #endif - (*vidsw[scp->sc->adapter]->set_hw_cursor_shape)(scp->sc->adp, - base, height, scp->font_size, blink); + vidd_set_hw_cursor_shape(scp->sc->adp, base, height, scp->font_size, + blink); } static int pxlblinkrate = 0; @@ -254,33 +254,29 @@ gfb_cursor(scr_stat *scp, int at, int blink, int on, int flip) scp->status |= VR_CURSOR_BLINK; if (on) { scp->status |= VR_CURSOR_ON; - (*vidsw[adp->va_index]->set_hw_cursor)(adp, - at%scp->xsize, - at/scp->xsize); + vidd_set_hw_cursor(adp, at%scp->xsize, at/scp->xsize); } else { if (scp->status & VR_CURSOR_ON) - (*vidsw[adp->va_index]->set_hw_cursor)(adp, -1, - -1); + vidd_set_hw_cursor(adp, -1, -1); scp->status &= ~VR_CURSOR_ON; } } else { scp->status &= ~VR_CURSOR_BLINK; if(on) { scp->status |= VR_CURSOR_ON; - (*vidsw[scp->sc->adapter]->putc)(scp->sc->adp, - scp->cursor_oldpos, + vidd_putc(scp->sc->adp, scp->cursor_oldpos, sc_vtb_getc(&scp->vtb, scp->cursor_oldpos), sc_vtb_geta(&scp->vtb, scp->cursor_oldpos) >> 8); a = sc_vtb_geta(&scp->vtb, at) >> 8; c = sc_vtb_getc(&scp->vtb, at); - (*vidsw[scp->sc->adapter]->putc)(scp->sc->adp, at, - c, (a >> 4) | ((a & 0xf) << 4)); + vidd_putc(scp->sc->adp, at, c, + (a >> 4) | ((a & 0xf) << 4)); scp->cursor_saveunder_attr = a; scp->cursor_saveunder_char = c; } else { if (scp->status & VR_CURSOR_ON) - (*vidsw[scp->sc->adapter]->putc)(scp->sc->adp, - at, scp->cursor_saveunder_char, + vidd_putc(scp->sc->adp, at, + scp->cursor_saveunder_char, scp->cursor_saveunder_attr); scp->status &= ~VR_CURSOR_ON; } @@ -300,22 +296,19 @@ gfb_cursor(scr_stat *scp, int at, int blink, int on, int flip) if (on) { if (!blink) { scp->status |= VR_CURSOR_ON; - (*vidsw[adp->va_index]->set_hw_cursor)(adp, - at%scp->xsize, at/scp->xsize); + vidd_set_hw_cursor(adp, at%scp->xsize, at/scp->xsize); } else if (++pxlblinkrate & 4) { pxlblinkrate = 0; scp->status ^= VR_CURSOR_ON; if(scp->status & VR_CURSOR_ON) - (*vidsw[adp->va_index]->set_hw_cursor)(adp, - at%scp->xsize, at/scp->xsize); + vidd_set_hw_cursor(adp, at%scp->xsize, + at/scp->xsize); else - (*vidsw[adp->va_index]->set_hw_cursor)(adp, -1, - -1); + vidd_set_hw_cursor(adp, -1, -1); } } else { if (scp->status & VR_CURSOR_ON) - (*vidsw[adp->va_index]->set_hw_cursor)(adp, - at%scp->xsize, at/scp->xsize); + vidd_set_hw_cursor(adp, at%scp->xsize, at/scp->xsize); scp->status &= ~VR_CURSOR_ON; } if (blink) @@ -344,16 +337,16 @@ static void gfb_mouse(scr_stat *scp, int x, int y, int on) { #ifdef __sparc64__ - (*vidsw[scp->sc->adapter]->putm)(scp->sc->adp, x, y, - mouse_pointer, on ? 0xffffffff : 0x0, 22, 12); + vidd_putm(scp->sc->adp, x, y, mouse_pointer, + on ? 0xffffffff : 0x0, 22, 12); #else int i, pos; if (on) { /* Display the mouse pointer image... */ - (*vidsw[scp->sc->adapter]->putm)(scp->sc->adp, x, y, - mouse_pointer, 0xffffffff, 16, 8); + vidd_putm(scp->sc->adp, x, y, mouse_pointer, + 0xffffffff, 16, 8); } else { /* diff --git a/sys/dev/syscons/scvgarndr.c b/sys/dev/syscons/scvgarndr.c index 5b056d3..1ab41d2 100644 --- a/sys/dev/syscons/scvgarndr.c +++ b/sys/dev/syscons/scvgarndr.c @@ -234,7 +234,7 @@ vga_txtclear(scr_stat *scp, int c, int attr) static void vga_txtborder(scr_stat *scp, int color) { - (*vidsw[scp->sc->adapter]->set_border)(scp->sc->adp, color); + vidd_set_border(scp->sc->adp, color); } static void @@ -270,9 +270,8 @@ vga_txtcursor_shape(scr_stat *scp, int base, int height, int blink) scp->curs_attr.base = base; scp->curs_attr.height = height; #endif - (*vidsw[scp->sc->adapter]->set_hw_cursor_shape)(scp->sc->adp, - base, height, - scp->font_size, blink); + vidd_set_hw_cursor_shape(scp->sc->adp, base, height, + scp->font_size, blink); } static void @@ -312,8 +311,7 @@ draw_txtcharcursor(scr_stat *scp, int at, u_short c, u_short a, int flip) font[i] ^= 0xff; } /* XXX */ - (*vidsw[sc->adapter]->load_font)(sc->adp, 0, h, 8, font, - sc->cursor_char, 1); + vidd_load_font(sc->adp, 0, h, 8, font, sc->cursor_char, 1); sc_vtb_putc(&scp->scr, at, sc->cursor_char, a); } else #endif /* SC_NO_FONT_LOADING */ @@ -348,13 +346,11 @@ vga_txtcursor(scr_stat *scp, int at, int blink, int on, int flip) scp->status |= VR_CURSOR_BLINK; if (on) { scp->status |= VR_CURSOR_ON; - (*vidsw[adp->va_index]->set_hw_cursor)(adp, - at%scp->xsize, - at/scp->xsize); + vidd_set_hw_cursor(adp, at%scp->xsize, + at/scp->xsize); } else { if (scp->status & VR_CURSOR_ON) - (*vidsw[adp->va_index]->set_hw_cursor)(adp, - -1, -1); + vidd_set_hw_cursor(adp, -1, -1); scp->status &= ~VR_CURSOR_ON; } } else { @@ -438,8 +434,7 @@ draw_txtmouse(scr_stat *scp, int x, int y) while (!(inb(crtc_addr + 6) & 0x08)) /* idle */ ; #endif c = scp->sc->mouse_char; - (*vidsw[scp->sc->adapter]->load_font)(scp->sc->adp, 0, 32, 8, font_buf, - c, 4); + vidd_load_font(scp->sc->adp, 0, 32, 8, font_buf, c, 4); sc_vtb_putc(&scp->scr, pos, c, sc_vtb_geta(&scp->scr, pos)); /* FIXME: may be out of range! */ @@ -627,7 +622,7 @@ vga_pxlborder_planar(scr_stat *scp, int color) int y; int i; - (*vidsw[scp->sc->adapter]->set_border)(scp->sc->adp, color); + vidd_set_border(scp->sc->adp, color); outw(GDCIDX, 0x0005); /* read mode 0, write mode 0 */ outw(GDCIDX, 0x0003); /* data rotate/function select */ @@ -1250,7 +1245,7 @@ vga_pxlmouse_planar(scr_stat *scp, int x, int y, int on) static void vga_grborder(scr_stat *scp, int color) { - (*vidsw[scp->sc->adapter]->set_border)(scp->sc->adp, color); + vidd_set_border(scp->sc->adp, color); } #endif diff --git a/sys/dev/syscons/scvidctl.c b/sys/dev/syscons/scvidctl.c index 65a56c6..5e1d910 100644 --- a/sys/dev/syscons/scvidctl.c +++ b/sys/dev/syscons/scvidctl.c @@ -142,7 +142,7 @@ sc_set_text_mode(scr_stat *scp, struct tty *tp, int mode, int xsize, int ysize, int error; int s; - if ((*vidsw[scp->sc->adapter]->get_info)(scp->sc->adp, mode, &info)) + if (vidd_get_info(scp->sc->adp, mode, &info)) return ENODEV; /* adjust argument values */ @@ -261,7 +261,7 @@ sc_set_graphics_mode(scr_stat *scp, struct tty *tp, int mode) int error; int s; - if ((*vidsw[scp->sc->adapter]->get_info)(scp->sc->adp, mode, &info)) + if (vidd_get_info(scp->sc->adp, mode, &info)) return ENODEV; /* stop screen saver, etc */ @@ -332,7 +332,7 @@ sc_set_pixel_mode(scr_stat *scp, struct tty *tp, int xsize, int ysize, int error; int s; - if ((*vidsw[scp->sc->adapter]->get_info)(scp->sc->adp, scp->mode, &info)) + if (vidd_get_info(scp->sc->adp, scp->mode, &info)) return ENODEV; /* this shouldn't happen */ /* adjust argument values */ @@ -472,7 +472,7 @@ sc_set_pixel_mode(scr_stat *scp, struct tty *tp, int xsize, int ysize, #define fb_ioctl(a, c, d) \ (((a) == NULL) ? ENODEV : \ - (*vidsw[(a)->va_index]->ioctl)((a), (c), (caddr_t)(d))) + vidd_ioctl((a), (c), (caddr_t)(d))) int sc_vid_ioctl(struct tty *tp, u_long cmd, caddr_t data, int flag, struct thread *td) @@ -723,12 +723,12 @@ sc_vid_ioctl(struct tty *tp, u_long cmd, caddr_t data, int flag, struct thread * #endif #ifndef SC_NO_PALETTE_LOADING - load_palette(adp, scp->sc->palette); + vidd_load_palette(adp, scp->sc->palette); #endif #ifndef PC98 /* move hardware cursor out of the way */ - (*vidsw[adp->va_index]->set_hw_cursor)(adp, -1, -1); + vidd_set_hw_cursor(adp, -1, -1); #endif /* FALLTHROUGH */ @@ -780,7 +780,7 @@ sc_vid_ioctl(struct tty *tp, u_long cmd, caddr_t data, int flag, struct thread * if (scp == scp->sc->cur_scp) { set_mode(scp); #ifndef SC_NO_PALETTE_LOADING - load_palette(adp, scp->sc->palette); + vidd_load_palette(adp, scp->sc->palette); #endif } sc_clear_screen(scp); diff --git a/sys/dev/syscons/snake/snake_saver.c b/sys/dev/syscons/snake/snake_saver.c index 6a7b7da..bbdcda3 100644 --- a/sys/dev/syscons/snake/snake_saver.c +++ b/sys/dev/syscons/snake/snake_saver.c @@ -71,7 +71,7 @@ snake_saver(video_adapter_t *adp, int blank) if (blanked <= 0) { sc_vtb_clear(&scp->scr, sc->scr_map[0x20], (FG_LIGHTGREY | BG_BLACK) << 8); - (*vidsw[adp->va_index]->set_hw_cursor)(adp, -1, -1); + vidd_set_hw_cursor(adp, -1, -1); sc_set_border(scp, 0); dirx = (scp->xpos ? 1 : -1); diry = (scp->ypos ? diff --git a/sys/dev/syscons/star/star_saver.c b/sys/dev/syscons/star/star_saver.c index 3963e08..d4b58cd 100644 --- a/sys/dev/syscons/star/star_saver.c +++ b/sys/dev/syscons/star/star_saver.c @@ -85,7 +85,7 @@ star_saver(video_adapter_t *adp, int blank) /* clear the screen and set the border color */ sc_vtb_clear(&scp->scr, sc->scr_map[0x20], (FG_LIGHTGREY | BG_BLACK) << 8); - (*vidsw[adp->va_index]->set_hw_cursor)(adp, -1, -1); + vidd_set_hw_cursor(adp, -1, -1); sc_set_border(scp, 0); blanked = TRUE; for(i=0; i<NUM_STARS; i++) { diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c index cc273e6..152e51f 100644 --- a/sys/dev/syscons/syscons.c +++ b/sys/dev/syscons/syscons.c @@ -369,7 +369,7 @@ sc_attach_unit(int unit, int flags) #ifdef SC_PIXEL_MODE if ((sc->config & SC_VESA800X600) - && ((*vidsw[sc->adapter]->get_info)(sc->adp, M_VESA_800x600, &info) == 0)) { + && (vidd_get_info(sc->adp, M_VESA_800x600, &info) == 0)) { #ifdef DEV_SPLASH if (sc->flags & SC_SPLASH_SCRN) splash_term(sc->adp); @@ -2053,7 +2053,7 @@ set_scrn_saver_mode(scr_stat *scp, int mode, u_char *pal, int border) scp->status |= GRAPHICS_MODE; #ifndef SC_NO_PALETTE_LOADING if (pal != NULL) - load_palette(scp->sc->adp, pal); + vidd_load_palette(scp->sc->adp, pal); #endif sc_set_border(scp, border); return 0; @@ -2091,7 +2091,7 @@ restore_scrn_saver_mode(scr_stat *scp, int changemode) } if (set_mode(scp) == 0) { #ifndef SC_NO_PALETTE_LOADING - load_palette(scp->sc->adp, scp->sc->palette); + vidd_load_palette(scp->sc->adp, scp->sc->palette); #endif --scrn_blanked; splx(s); @@ -2495,7 +2495,7 @@ exchange_scr(sc_softc_t *sc) sc_set_cursor_image(scp); #ifndef SC_NO_PALETTE_LOADING if (ISGRAPHSC(sc->old_scp)) - load_palette(sc->adp, sc->palette); + vidd_load_palette(sc->adp, sc->palette); #endif sc_set_border(scp, scp->border); @@ -2740,8 +2740,8 @@ scinit(int unit, int flags) #endif /* extract the hardware cursor location and hide the cursor for now */ - (*vidsw[sc->adapter]->read_hw_cursor)(sc->adp, &col, &row); - (*vidsw[sc->adapter]->set_hw_cursor)(sc->adp, -1, -1); + vidd_read_hw_cursor(sc->adp, &col, &row); + vidd_set_hw_cursor(sc->adp, -1, -1); /* set up the first console */ sc->first_vty = unit*MAXCONS; @@ -2843,7 +2843,7 @@ scinit(int unit, int flags) #endif /* !SC_NO_FONT_LOADING */ #ifndef SC_NO_PALETTE_LOADING - save_palette(sc->adp, sc->palette); + vidd_save_palette(sc->adp, sc->palette); #endif #ifdef DEV_SPLASH @@ -2889,7 +2889,7 @@ scterm(int unit, int flags) #if 0 /* XXX */ /* move the hardware cursor to the upper-left corner */ - (*vidsw[sc->adapter]->set_hw_cursor)(sc->adp, 0, 0); + vidd_set_hw_cursor(sc->adp, 0, 0); #endif /* release the keyboard and the video card */ @@ -3023,7 +3023,7 @@ init_scp(sc_softc_t *sc, int vty, scr_stat *scp) scp->sc = sc; scp->status = 0; scp->mode = sc->initial_mode; - (*vidsw[sc->adapter]->get_info)(sc->adp, scp->mode, &info); + vidd_get_info(sc->adp, scp->mode, &info); if (info.vi_flags & V_INFO_GRAPHICS) { scp->status |= GRAPHICS_MODE; scp->xpixel = info.vi_width; @@ -3437,7 +3437,7 @@ scmmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot) scp = sc_get_stat(dev); if (scp != scp->sc->cur_scp) return -1; - return (*vidsw[scp->sc->adapter]->mmap)(scp->sc->adp, offset, paddr, nprot); + return vidd_mmap(scp->sc->adp, offset, paddr, nprot); } static int @@ -3497,7 +3497,7 @@ set_mode(scr_stat *scp) video_info_t info; /* reject unsupported mode */ - if ((*vidsw[scp->sc->adapter]->get_info)(scp->sc->adp, scp->mode, &info)) + if (vidd_get_info(scp->sc->adp, scp->mode, &info)) return 1; /* if this vty is not currently showing, do nothing */ @@ -3505,7 +3505,7 @@ set_mode(scr_stat *scp) return 0; /* setup video hardware for the given mode */ - (*vidsw[scp->sc->adapter]->set_mode)(scp->sc->adp, scp->mode); + vidd_set_mode(scp->sc->adp, scp->mode); scp->rndr->init(scp); #ifndef __sparc64__ sc_vtb_init(&scp->scr, VTB_FRAMEBUFFER, scp->xsize, scp->ysize, @@ -3562,8 +3562,7 @@ sc_load_font(scr_stat *scp, int page, int size, int width, u_char *buf, sc = scp->sc; sc->font_loading_in_progress = TRUE; - (*vidsw[sc->adapter]->load_font)(sc->adp, page, size, width, buf, base, - count); + vidd_load_font(sc->adp, page, size, width, buf, base, count); sc->font_loading_in_progress = FALSE; } @@ -3575,15 +3574,14 @@ sc_save_font(scr_stat *scp, int page, int size, int width, u_char *buf, sc = scp->sc; sc->font_loading_in_progress = TRUE; - (*vidsw[sc->adapter]->save_font)(sc->adp, page, size, width, buf, base, - count); + vidd_save_font(sc->adp, page, size, width, buf, base, count); sc->font_loading_in_progress = FALSE; } void sc_show_font(scr_stat *scp, int page) { - (*vidsw[scp->sc->adapter]->show_font)(scp->sc->adp, page); + vidd_show_font(scp->sc->adp, page); } #endif /* !SC_NO_FONT_LOADING */ diff --git a/sys/dev/syscons/warp/warp_saver.c b/sys/dev/syscons/warp/warp_saver.c index aba2439..85a7d29 100644 --- a/sys/dev/syscons/warp/warp_saver.c +++ b/sys/dev/syscons/warp/warp_saver.c @@ -47,7 +47,7 @@ #define SET_ORIGIN(adp, o) do { \ int oo = o; \ if (oo != last_origin) \ - set_origin(adp, last_origin = oo); \ + vidd_set_win_org(adp, last_origin = oo); \ } while (0) static u_char *vid; @@ -103,15 +103,15 @@ warp_saver(video_adapter_t *adp, int blank) /* switch to graphics mode */ if (blanked <= 0) { pl = splhigh(); - set_video_mode(adp, scrmode); - load_palette(adp, warp_pal); - set_border(adp, 0); + vidd_set_mode(adp, scrmode); + vidd_load_palette(adp, warp_pal); + vidd_set_border(adp, 0); blanked++; vid = (u_char *)adp->va_window; banksize = adp->va_window_size; bpsl = adp->va_line_width; splx(pl); - (*vidsw[adp->va_index]->clear)(adp); + vidd_clear(adp); } /* update display */ warp_update(adp); @@ -127,11 +127,11 @@ warp_init(video_adapter_t *adp) video_info_t info; int i; - if (!get_mode_info(adp, M_VGA_CG320, &info)) { + if (!vidd_get_info(adp, M_VGA_CG320, &info)) { scrmode = M_VGA_CG320; - } else if (!get_mode_info(adp, M_PC98_PEGC640x480, &info)) { + } else if (!vidd_get_info(adp, M_PC98_PEGC640x480, &info)) { scrmode = M_PC98_PEGC640x480; - } else if (!get_mode_info(adp, M_PC98_PEGC640x400, &info)) { + } else if (!vidd_get_info(adp, M_PC98_PEGC640x400, &info)) { scrmode = M_PC98_PEGC640x400; } else { log(LOG_NOTICE, |