FreeBSD Bugzilla – Attachment 7341 Details for
Bug 15996
patch adds hw.syscons.sc_mouse_char sysctl variable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 5.48 KB, created by
kbyanc
on 2000-01-08 18:10:01 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
kbyanc
Created:
2000-01-08 18:10:01 UTC
Size:
5.48 KB
patch
obsolete
>--- sys/dev/syscons/syscons.c.orig Fri Jan 7 21:31:44 2000 >+++ sys/dev/syscons/syscons.c Sat Jan 8 11:56:05 2000 >@@ -48,6 +48,7 @@ > #include <sys/conf.h> > #include <sys/proc.h> > #include <sys/signalvar.h> >+#include <sys/sysctl.h> > #include <sys/tty.h> > #include <sys/kernel.h> > #include <sys/malloc.h> >@@ -239,6 +240,7 @@ > #define SC_CONSOLE 255 > vm_offset_t Crtat; > static const int nsccons = MAXCONS+2; >+static int sc_mouse_char = SC_MOUSE_CHAR; > > #define WRAPHIST(scp, pointer, offset)\ > ((scp)->history + ((((pointer) - (scp)->history) + (scp)->history_size \ >@@ -337,6 +339,39 @@ > static void remove_cutmarking(scr_stat *scp); > static void do_bell(scr_stat *scp, int pitch, int duration); > static timeout_t blink_screen; >+static void reload_current_font(scr_stat *scp); >+ >+static int >+sysctl_sc_mouse_char SYSCTL_HANDLER_ARGS >+{ >+ int error; >+ >+ error = sysctl_handle_int(oidp, &sc_mouse_char, 0, req); >+ if (!error && req->newptr) { >+ /* Limit range to ensure mouse pointer characters exist in font */ >+ if(sc_mouse_char < 0) sc_mouse_char = 0; >+ if(sc_mouse_char > 256 - 4) sc_mouse_char = 256 - 4; >+ >+ /* >+ * The base character for drawing the mouse pointer has changed. >+ * Clear the pointer, restore the original font, and then redraw >+ * the pointer mangling characters at the new location. >+ */ >+ remove_mouse_image(cur_console); >+ >+ /* Reload fonts to demangle character defs used by mouse cursor. */ >+ reload_current_font(cur_console); >+ >+ if (cur_console->status & MOUSE_VISIBLE) >+ draw_mouse_image(cur_console); >+ } >+ return (error); >+} >+ >+SYSCTL_NODE(_hw, OID_AUTO, syscons, CTLFLAG_RW, 0, "Syscons driver mgmt"); >+SYSCTL_PROC(_hw_syscons, OID_AUTO, sc_mouse_char, CTLTYPE_INT|CTLFLAG_RW, >+ 0, 0, sysctl_sc_mouse_char, "I", >+ "First character of four character range used to draw mouse cursor"); > > #define CDEV_MAJOR 12 > >@@ -4096,27 +4131,7 @@ > Crtat = scp->adp->va_window; > > if (!(scp->status & GRAPHICS_MODE)) { >- /* load appropriate font */ >- if (!(scp->status & PIXEL_MODE) && ISFONTAVAIL(scp->adp->va_flags)) { >- if (scp->font_size < 14) { >- if (fonts_loaded & FONT_8) >- copy_font(scp, LOAD, 8, font_8); >- } else if (scp->font_size >= 16) { >- if (fonts_loaded & FONT_16) >- copy_font(scp, LOAD, 16, font_16); >- } else { >- if (fonts_loaded & FONT_14) >- copy_font(scp, LOAD, 14, font_14); >- } >- /* >- * FONT KLUDGE: >- * This is an interim kludge to display correct font. >- * Always use the font page #0 on the video plane 2. >- * Somehow we cannot show the font in other font pages on >- * some video cards... XXX >- */ >- (*vidsw[scp->ad]->show_font)(scp->adp, 0); >- } >+ reload_current_font(scp); > mark_all(scp); > } > >@@ -4217,13 +4232,13 @@ > } > > if (scp->status & MOUSE_VISIBLE) { >- if ((scp->cursor_saveunder & 0xff) == SC_MOUSE_CHAR) >+ if ((scp->cursor_saveunder & 0xff) == sc_mouse_char) > bcopy(&scp->mouse_cursor[0], cursor, scp->font_size); >- else if ((scp->cursor_saveunder & 0xff) == SC_MOUSE_CHAR + 1) >+ else if ((scp->cursor_saveunder & 0xff) == sc_mouse_char + 1) > bcopy(&scp->mouse_cursor[32], cursor, scp->font_size); >- else if ((scp->cursor_saveunder & 0xff) == SC_MOUSE_CHAR + 2) >+ else if ((scp->cursor_saveunder & 0xff) == sc_mouse_char + 2) > bcopy(&scp->mouse_cursor[64], cursor, scp->font_size); >- else if ((scp->cursor_saveunder & 0xff) == SC_MOUSE_CHAR + 3) >+ else if ((scp->cursor_saveunder & 0xff) == sc_mouse_char + 3) > bcopy(&scp->mouse_cursor[96], cursor, scp->font_size); > else > bcopy(font_buffer+((scp->cursor_saveunder & 0xff)*scp->font_size), >@@ -4551,16 +4566,16 @@ > #endif > font_loading_in_progress = TRUE; > (*vidsw[scp->ad]->load_font)(scp->adp, 0, 32, scp->mouse_cursor, >- SC_MOUSE_CHAR, 4); >+ sc_mouse_char, 4); > font_loading_in_progress = FALSE; > >- writew(crt_pos, (*(scp->mouse_pos) & 0xff00) | SC_MOUSE_CHAR); >+ writew(crt_pos, (*(scp->mouse_pos) & 0xff00) | sc_mouse_char); > writew(crt_pos+2*scp->xsize, >- (*(scp->mouse_pos + scp->xsize) & 0xff00) | (SC_MOUSE_CHAR + 2)); >+ (*(scp->mouse_pos + scp->xsize) & 0xff00) | (sc_mouse_char + 2)); > if (scp->mouse_xpos < (scp->xsize-1)*8) { >- writew(crt_pos + 2, (*(scp->mouse_pos + 1) & 0xff00) | (SC_MOUSE_CHAR + 1)); >+ writew(crt_pos + 2, (*(scp->mouse_pos + 1) & 0xff00) | (sc_mouse_char + 1)); > writew(crt_pos+2*scp->xsize + 2, >- (*(scp->mouse_pos + scp->xsize + 1) & 0xff00) | (SC_MOUSE_CHAR + 3)); >+ (*(scp->mouse_pos + scp->xsize + 1) & 0xff00) | (sc_mouse_char + 3)); > } > mark_for_update(scp, scp->mouse_pos - scp->scr_buf); > mark_for_update(scp, scp->mouse_pos + scp->xsize + 1 - scp->scr_buf); >@@ -4671,6 +4686,31 @@ > scp->xsize * scp->ysize); > blink_in_progress--; > timeout(blink_screen, scp, hz / 10); >+ } >+} >+ >+static void >+reload_current_font(scr_stat *scp) >+{ >+ if (!(scp->status & PIXEL_MODE) && ISFONTAVAIL(scp->adp->va_flags)) { >+ if (scp->font_size < 14) { >+ if (fonts_loaded & FONT_8) >+ copy_font(scp, LOAD, 8, font_8); >+ } else if (scp->font_size >= 16) { >+ if (fonts_loaded & FONT_16) >+ copy_font(scp, LOAD, 16, font_16); >+ } else { >+ if (fonts_loaded & FONT_14) >+ copy_font(scp, LOAD, 14, font_14); >+ } >+ /* >+ * FONT KLUDGE: >+ * This is an interim kludge to display correct font. >+ * Always use the font page #0 on the video plane 2. >+ * Somehow we cannot show the font in other font pages on >+ * some video cards... XXX >+ */ >+ (*vidsw[scp->ad]->show_font)(scp->adp, 0); > } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 15996
: 7341