Commit Graph

100 Commits

Author SHA1 Message Date
dyoung 1ac75f0733 Always deviter_release(). 2008-03-16 19:57:39 +00:00
dyoung 705696f034 In vga_is_console(), use deviter_first/_next() and device_t accessors.
Ok cube@.
2008-03-14 23:17:55 +00:00
cube d293cfca1a Split device_t and softc for all attachments of vga(4). 2008-03-14 22:12:08 +00:00
jmcneill 4c1d81b2b5 Merge jmcneill-pm branch. 2007-12-09 20:27:42 +00:00
ad a2a3828545 machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h 2007-10-19 11:59:34 +00:00
mjf 05619021ad Implement bounds checking in some places in display driver code to avoid
the possibility of a local user panic.
2007-07-28 20:28:56 +00:00
dsl 1b3b0fe4f7 include sys/cdefs.h before opt_xxx.h 2007-07-19 22:18:54 +00:00
ad 88ab7da936 Merge some of the less invasive changes from the vmlocking branch:
- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
2007-07-09 20:51:58 +00:00
christos 53524e44ef Kill caddr_t; there will be some MI fallout, but it will be fixed shortly. 2007-03-04 05:59:00 +00:00
christos 168cd830d2 __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
christos 4d595fd7b1 - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
2006-10-12 01:30:41 +00:00
christos d5978e20f4 - use c99 initializers
- add missing initializer
2006-09-13 01:01:20 +00:00
jmcneill d7fd667c03 Provide a method for other display drivers to ask vga to free resources
it had claimed while acting as the initial console device. This allows
(for example) vga to be the initial console, and an accelerated
framebuffer driver to take over later.
2006-08-13 20:24:51 +00:00
jmmv aec18036fd Remove the getwschar and putwschar accessops from wsdisplay drivers as
requested by uwe@.  These were wrong because they were receiving an
emulcookie yet they were accessops (thus having to receive an accesscookie).
Instead, just handle the WSDISPLAYIO_{GET,PUT}WSCHAR ioctls from the
driver's ioctl accessop.

As this reduces the amount of code needed to handle these operations to
two small functions in each driver, remove the WSDISPLAY_CHARFUNCS kernel
option.

Reviewed by, at least, uwe@ and macallan@.  No objections in tech-kern@.
2006-04-15 17:48:23 +00:00
jmmv 7a51d4dddc Add an extra cookie to the ioctl and mmap wsdisplay accessops that points
to the screen on which they are being called.  The driver cannot guess
this by itself but it is needed to implement, at least, the getwschar and
putwschar functions in the correct place.  There are no functional changes
yet.

Tested on i386 (vga, vga_raster, machfb, vesafb), macppc and sparc64.
Suggested and reviewed by macallan@.
2006-04-12 19:38:22 +00:00
drochner cd401662a8 Move the ga_getborder()/vga_setborder() calls from accessops to the
ioctl handler.
Also fix error reporting for the vga_getborder() call.
2006-04-05 15:19:54 +00:00
jmcneill b74d978f79 Prevent vga from attaching if vesafb is the console. Accessing VGA
registers after switching to a VESA linear framebuffer mode is not
guaranteed to work. This should fix the majority of the problems people
have been experiencing with vesafb.

XXX: Still doesn't fix the assertion in wscons with options DIAGNOSTIC.
2006-02-19 15:16:53 +00:00
christos 95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
dbj 37e4b2f6aa decrement nscreens in vga_free_screen
this cleans up a crash on failed allocation, although
vga_free_screen may still be leaking resources
2005-10-21 14:44:08 +00:00
perry f31bd063e9 nuke trailing whitespace 2005-02-27 00:26:58 +00:00
mycroft c369e5b81c Fix two annoying display glitches with "fast scrolling" and
WSDISPLAY_SCROLLSUPPORT.
2004-08-13 04:03:38 +00:00
christos 959186b32c disable the quirk on the console so that it can scroll. 2004-08-08 19:21:27 +00:00
jmmv cda2a3bba1 Fix initialitzation of border color at boot time through the
WSDISPLAY_BORDER_COLOR option, broken by a last-minute change.
Pointed out by xtraeme@.

Also back out the previous change by dogcow@, which was an attempt
to fix kernel builds that didn't define WSDISPLAY_CUSTOM_BORDER;
shouldn't be needed now.  (Problem also introduced by the same
last-minute change; sorry).
2004-07-30 10:47:20 +00:00
dogcow 4ebba2e5cb let kernels that don't have WSDISPLAY_CUSTOM_BORDER compile again. 2004-07-30 07:40:26 +00:00
jmmv 2a08d54a9a Implement border color customization in wscons(4), only available for vga(4)
at the moment.

This includes the addition of two new wsdisplay ioctls, WSDISPLAY_{G,S}BORDER,
one to get the actual color and one to set it, respectively.  Possible colors
match those defined by ANSI (and listed in wsdisplayvar.h).

It also adds two accessops to the underlying graphics device, getborder and
setborder, which mach their ioctl counterparts.

Two kernel options are added: WSDISPLAY_CUSTOM_BORDER, which enables the
ioctls described above (to customize the border color from userland after
boot), and WSDISPLAY_BORDER_COLOR, which sets the color at boot time.
The former is enabled by default on the GENERIC kernel, but not on INSTALL
(among others).  The later is always commented out, leaving the usual black
border as a default.

wsconsctl is modified to allow accessing this value easily.  For example,
'wsconsctl -d -w border=blue'.
2004-07-29 22:29:35 +00:00
jmmv 92f81ea7d3 Implement support to dynamically change wscons console and kernel colors.
Two new ioctls are added to the wsdisplay device, named WSDISPLAY_GMSGATTRS
and WSDISPLAY_SMSGATTRS, used to retrieve the actual values and set them,
respectively (the name, if you are wondering, comes from "message attributes").

A new emulop is added to the underlying display driver (only vga, for now)
which sets the new attribute for the whole screen, without having to clear
it.  This is optional, which means that this also works with other drivers
that don't have this new operation.

Five new kernel options have been added, although only documented in
i386 kernels (for now):
- WSDISPLAY_CUSTOM_OUTPUT, which enables the ioctls described above to
  change the colors dynamically from userland.  This is enabled by default
  in the GENERIC kernel (as well as others) but disabled on all INSTALL*
  kernels (as this feature is useless there).
- WS_DEFAULT_COLATTR, WS_DEFAULT_MONOATTR, WS_DEFAULT_BG and WS_DEFAULT_FG,
  which specify the default colors for the console at boot time.  These have
  the same meaning as the (already existing) WS_KERNEL_* variables.

wsconsctl is modified to add msg.default.{attrs,bg,fg} and
msg.kernel.{attrs,bg,fg} to the display part, so that colors can be changed
after boot.

Tested on NetBSD/i386 with vga (and vga in mono mode), and on NetBSD/mac68k.
No objections in tech-kern@.
2004-07-28 12:34:02 +00:00
christos fd8537e01d fix another scrolling use that leaked. 2004-05-29 02:04:56 +00:00
christos 1143925e65 move scroll function definition last. 2004-05-28 22:38:28 +00:00
christos 7208404c41 PR/19925: David Ferlier: Add scrolling support to wscons. 2004-05-28 21:42:29 +00:00
fvdl d5aece61d6 Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
2003-06-29 22:28:00 +00:00
darrenr 960df3c8d1 Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records.  The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
2003-06-28 14:20:43 +00:00
jdolecek 998befbc32 make 'name' and 'data' of struct wsdisplay_font const, mark data arrays
in font sources const
2003-02-09 10:29:35 +00:00
tsutsui ef47e3f676 Changes to allow machines which don't use text mode at the boot time
to use generic VGA driver(s):
- Allow VGA drivers to use wsfont instead of builtin font.
- Add vga_reset() function, which will be called from MD consinit(),
  to put VGA into text mode. This function is enabled by options VGA_RESET.
2003-01-31 21:57:23 +00:00
tsutsui 89b4d6221e - Replace some magic numbers with proper macro.
- Use vga_6845_{read,write}() defined in pcdisplayvar.h and
  remove vga_crtc_{read,write}() macros in vgareg.h.
2003-01-27 15:16:10 +00:00
tsutsui a8c7515f5f KNF and space/TAB cleanup. 2003-01-27 14:46:10 +00:00
simonb d081ef5767 Remove unreachable break after return. 2003-01-20 07:28:26 +00:00
junyoung 0f061c7c7a Move vga_common_probe() to vga_common.c. vga_common.c contains common
stuff between existing char-cell VGA driver and raster VGA driver to
come shortly.
2002-10-15 17:30:43 +00:00
drochner 2693ad5a05 save quirks in softc, obey VGA_QUIRK_NOFASTSCROLL 2002-07-08 19:45:28 +00:00
junyoung f73c9efaab No need to include opt_vga.h here, since it is included in vgavar.h. 2002-07-07 07:37:50 +00:00
junyoung da843e013f There's no function like vga_common_setup. 2002-07-07 07:34:54 +00:00
junyoung 472e54071a Rename vc_ccol and vc_crow in struct pcdisplayscreen to cursorcol
and cursorrow, respectively, to be consistent with other members
in the structure.
2002-07-07 06:36:32 +00:00
junyoung 3d826105dc alloc_attr -> allocattr
Approved by Matthias Drochner.
2002-07-04 14:37:10 +00:00
drochner 3680345a91 simplify console initialization a bit, avoid wasting
memory in attach(), and add some commemts
2002-07-01 16:56:09 +00:00
christos 63a19c881d more cleanups from Julio Merino. 2002-07-01 13:17:48 +00:00
drochner 9b3975fd12 clean up font handling:
-treat the builtin font like any other font at runtime
-for that, copy it to malloc()'d memory during attach()
-in early console initialization, if we have to consider a broken card
 (VGA_CONSOLE_ATI_BROKEN_FONTSEL), copy the builtin font to another
 location in font ram; the attach() code will do the rest
put the "quirk" code into effect again
2002-06-28 22:24:11 +00:00
junyoung a52db40372 Do the necessaries when the builtin font gets saved in slot 1. 2002-06-28 03:38:13 +00:00
junyoung 754342aeb8 - Work around a hardware bug that loaded fonts don't work, which is
found on many (all?) of PCI-based ATI graphics cards. It is fully optional
  and can be enabled by adding `options VGA_CONSOLE_ATI_BROKEN_FONTSEL'
  to config file.
- Temporarily remove `quirk' mechanism. Similar code already exists
  in pci_quirks.c.
2002-06-27 06:26:51 +00:00
christos 71dcc987cd PR/17402: Add wsmoused support by providing get/set char and events. 2002-06-26 23:05:33 +00:00
drochner 6aa49848cf 2 fixes:
-Don't assume fonts to start with character 0, load at the
 right offset. Now we can use eg wsfont/bold8x16.h which
 starts with chr(1).
-Don't touch the hardware if a font is set for a screen which is
 not active.
2002-06-26 16:33:18 +00:00
drochner f9d6718ab9 allow to overwrite the builtin VGA font if necessary,
make the number of available font slots variable,
set up a "quirk" mechanism to tell the generic vga code about crippled
VGA adapters which ignore the "fontsel" TS register,
initiate the quirk table with an ATI chip which happened to be on a board
I tested with.
Afaik quite a number of ATI chips suffers from the "loaded fonts don't
work" problem - these should be added.
Bad side effect of my change: The builtin font will be kicked out
always if a VGA_CONSOLE_SCREENTYPE is specified which needs a loaded
font. In early console initialization, we don't know much about the
graphics card, so we have to assume the worst (ie ATI:-).
2002-06-25 21:07:42 +00:00