aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/fb/vga.c
Commit message (Collapse)AuthorAgeFilesLines
* i386: Merge PAE and non-PAE pmaps into same kernel.Konstantin Belousov2019-01-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Effectively all i386 kernels now have two pmaps compiled in: one managing PAE pagetables, and another non-PAE. The implementation is selected at cold time depending on the CPU features. The vm_paddr_t is always 64bit now. As result, nx bit can be used on all capable CPUs. Option PAE only affects the bus_addr_t: it is still 32bit for non-PAE configs, for drivers compatibility. Kernel layout, esp. max kernel address, low memory PDEs and max user address (same as trampoline start) are now same for PAE and for non-PAE regardless of the type of page tables used. Non-PAE kernel (when using PAE pagetables) can handle physical memory up to 24G now, larger memory requires re-tuning the KVA consumers and instead the code caps the maximum at 24G. Unfortunately, a lot of drivers do not use busdma(9) properly so by default even 4G barrier is not easy. There are two tunables added: hw.above4g_allow and hw.above24g_allow, the first one is kept enabled for now to evaluate the status on HEAD, second is only for dev use. i386 now creates three freelists if there is any memory above 4G, to allow proper bounce pages allocation. Also, VM_KMEM_SIZE_SCALE changed from 3 to 1. The PAE_TABLES kernel config option is retired. In collaboarion with: pho Discussed with: emaste Reviewed by: markj MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D18894 Notes: svn path=/head/; revision=343567
* sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-0/+2
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326255
* Attempt to determine the modes in which 8-bit wide characters are actuallyBruce Evans2017-04-201-0/+26
| | | | | | | | | | | | | | | | | | | 9 wide. I only need this to improve the mouse cursor, but it has always been needed to select and/or adjust fonts. This is complicated because there are no standard parameter tables giving this bit of information directly, and the device register bit giving the information can't be trusted even if it is read from the hardware. Use a heuristic to guess if the device register can be trusted. (The device register is normally read from the BIOS mode table, but on my system where the device register is wrong, the mode table doesn't match the hardware and is not used; the device registers are used in this case.) Notes: svn path=/head/; revision=317190
* When we don't use the parameter table in the BIOS, also don't use mostBruce Evans2017-04-191-5/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | of our tweaked modes based on it. In practice, this means limiting the tweaked modes to at most 80x50 based on 80x25, so there are no 90-column, 80x30 or 80x60 modes. This happens when the the initial mode is is not in the parameter table. We always detected this case, but assumed that the (necessarily nonstandard) parameters of the initial mode could be tweaked just as blindly as the probably-standard parameters of initial modes in the table. On 1 laptop system with near-VGA where the initial mode is nonstandard, this is because the hardware apparently doesn't support 9-bit mode, but otherwise has standard timing. The initial mode has 8-bit mode CRTC horizontal parameters similar to those in syscons' 90-column modes and in EGA modes. Tweaking these values for the 90-column modes has little effect except to print the extra 10 columns off the screen. Tweaking from 80x25 to 80x30 requires changing from 400 scan lines to 480. This can probably be made to work, but syscons blindly applies values based on standard timing. This gives blank output. Tweaking from 80x25 to 80x50 doesn't change the CRTC timing and works. Notes: svn path=/head/; revision=317142
* Fix 3 entries in mode tables related to mono and 90-column text modes.Bruce Evans2017-03-261-3/+3
| | | | | | | | | | | Newer VGAs don't support any mono modes, but bugs in the tables created 2 virtual mono modes (#45 90x43 and #112 80x43) that behaved more strangely than crashing. 90-column modes are tweaked 80-column ones and also fail to work on newer VGAs. #45 did crash (hang) on some hardware. Notes: svn path=/head/; revision=315986
* sys/dev: minor spelling fixes.Pedro F. Giffuni2016-05-031-2/+2
| | | | | | | Most affect comments, very few have user-visible effects. Notes: svn path=/head/; revision=298955
* sys: Make use of our rounddown() macro when sys/param.h is available.Pedro F. Giffuni2016-04-301-1/+1
| | | | | | | No functional change. Notes: svn path=/head/; revision=298848
* sys/dev: extend use of the howmany() macro when available.Pedro F. Giffuni2016-04-261-2/+2
| | | | | | | | We have a howmany() macro in the <sys/param.h> header that is convenient to re-use as it makes things easier to read. Notes: svn path=/head/; revision=298646
* sys: use our nitems() macro when param.h is available.Pedro F. Giffuni2016-04-211-7/+7
| | | | | | | | | This should cover all the remaining cases in the kernel. Discussed in: freebsd-current Notes: svn path=/head/; revision=298431
* Remove a useless warning. The mode information is unused for very long timeJung-uk Kim2012-04-041-4/+0
| | | | | | | and this function may be used with VESA mode since r232069. Notes: svn path=/head/; revision=233892
* Convert files to UTF-8Ulrich Spörlein2012-01-151-1/+1
| | | | Notes: svn path=/head/; revision=230132
* Teach VGA framebuffer about 8-bit palette format for VESA.Jung-uk Kim2010-03-241-8/+16
| | | | Notes: svn path=/head/; revision=205604
* Update d_mmap() to accept vm_ooffset_t and vm_memattr_t.Robert Noland2009-12-291-5/+5
| | | | | | | | | | | | | | | | This replaces d_mmap() with the d_mmap2() implementation and also changes the type of offset to vm_ooffset_t. Purge d_mmap2(). All driver modules will need to be rebuilt since D_VERSION is also bumped. Reviewed by: jhb@ MFC after: Not in this lifetime... Notes: svn path=/head/; revision=201223
* Enable BIOS modes on amd64.Xin LI2009-09-141-1/+1
| | | | | | | Submitted by: paradox <ddkprog at yahoo com> Notes: svn path=/head/; revision=197185
* - Teach vesa(4) and dpms(4) about x86emu. [1]Xin LI2009-09-091-1/+1
| | | | | | | | | | | | | - Add vesa kernel options for amd64. - Connect libvgl library and splash kernel modules to amd64 build. - Connect manual page dpms(4) to amd64 build. - Remove old vesa/dpms files. Submitted by: paradox <ddkprog yahoo com> [1], swell k at gmail.com (with some minor tweaks) Notes: svn path=/head/; revision=197025
* Convert amd64 and i386 to share the atrtc device driver.Poul-Henning Kamp2008-04-141-1/+1
| | | | Notes: svn path=/head/; revision=178193
* Replace explicit calls to video methods with their respective variantsWojciech A. Koszek2007-12-291-16/+16
| | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=174985
* Fix -Wundef.Ruslan Ermilov2005-12-041-5/+8
| | | | Notes: svn path=/head/; revision=153072
* Add a font width argument to vi_load_font_t, vi_save_font_t and vi_putm_tMarius Strobl2005-09-281-6/+6
| | | | | | | | | | | | | | | | | | | and do some preparations for handling 12x22 fonts (currently lots of code implies and/or hardcodes a font width of 8 pixels). This will be required on sparc64 which uses a default font size of 12x22 in order to add font loading and saving support as well as to use a syscons(4)-supplied mouse pointer image. This API breakage is committed now so it can be MFC'ed in time for 6.0 and later on upcoming framebuffer drivers destined for use on sparc64 and which are expected to rely on using font loading internally and on a syscons(4)-supplied mouse pointer image can be easily MFC'ed to RELENG_6 rather than requiring a backport. Tested on: i386, sparc64, make universe MFC after: 1 week Notes: svn path=/head/; revision=150686
* check copyin return values when loading palleteSam Leffler2005-03-261-4/+7
| | | | | | | Noticed by: Coverity Prevent analysis tool Notes: svn path=/head/; revision=144146
* Fixed compilation warnings with option VGA_NO_MODE_CHANGE.Ruslan Ermilov2004-12-151-1/+3
| | | | | | | PR: kern/71130 Notes: svn path=/head/; revision=138891
* Converge towards i386. I originally resisted creating <machine/pc/bios.h>Peter Wemm2004-09-241-5/+1
| | | | | | | | | | | | | | | because it was mostly irrelevant - except for the silly BIOS_PADDRTOVADDR etc macros. Along the way of working around this, I missed a few things. * Make syscons properly inherit the bios capslock/shiftlock/etc state like i386 does. Note that we cannot inherit the bios key repeat rate because that requires a bios call (which is impossible for us). * Give syscons the ability to beep on amd64. Oops. While here, make bios.c compile and add it to files.amd64. Notes: svn path=/head/; revision=135690
* Do the dreaded s/dev_t/struct cdev */Poul-Henning Kamp2004-06-161-6/+6
| | | | | | | Bump __FreeBSD_version accordingly. Notes: svn path=/head/; revision=130585
* Remove atdevbase and replace it's remaining uses with direct references toJohn Baldwin2004-06-101-1/+1
| | | | | | | KERNBASE instead. Notes: svn path=/head/; revision=130312
* Correct a potential panic condition that could be caused when getting orJacques Vidrine2004-04-031-2/+4
| | | | | | | | | | setting the VGA palette. Reported by: Christer Öberg <christer.oberg@texonet.com> Reviewed by: bde Notes: svn path=/head/; revision=127792
* Use __FBSDID().David E. O'Brien2003-08-241-1/+3
| | | | | | | Also some minor style cleanups. Notes: svn path=/head/; revision=119418
* Low risk amd64 fix. Use a vm_offset_t for the virtual location of thePeter Wemm2003-05-231-2/+2
| | | | | | | | | | buffer space instead of a u_int32_t. Otherwise the upper 32 bits of the address space get truncated and syscons blows up. Approved by: re (safe, low risk amd64 fixes) Notes: svn path=/head/; revision=115253
* Unbreak alpha and ia64 builds. The previous change made the inclusionMarcel Moolenaar2003-05-021-1/+6
| | | | | | | | | | | | | of <machine/pc/bios.h> specific to i386 and added a conditional define for BIOS_PADDRTOVADDR that depends on ISA_HOLE_START. The latter is undefined on alpha and ia64. Since the former is defined the same on both alpha and ia64, assume the ISA_HOLE_START dependent definition is specific to amd64 and use the identity-mapping in all other cases. This of course is getting uglier every day... Notes: svn path=/head/; revision=114485
* Add AMD64 support to dev/fb. It isn't optimized.Peter Wemm2003-05-011-6/+14
| | | | Notes: svn path=/head/; revision=114383
* - Add vm_paddr_t, a physical address type. This is required for systemsJake Burkholder2003-03-251-1/+1
| | | | | | | | | | | | | | | | | | where physical addresses larger than virtual addresses, such as i386s with PAE. - Use this to represent physical addresses in the MI vm system and in the i386 pmap code. This also changes the paddr parameter to d_mmap_t. - Fix printf formats to handle physical addresses >4G in the i386 memory detection code, and due to kvtop returning vm_paddr_t instead of u_long. Note that this is a name change only; vm_paddr_t is still the same as vm_offset_t on all currently supported platforms. Sponsored by: DARPA, Network Associates Laboratories Discussed with: re, phk (cdevsw change) Notes: svn path=/head/; revision=112569
* Including <sys/stdint.h> is (almost?) universally only to be able to usePoul-Henning Kamp2003-03-181-1/+0
| | | | | | | | %j in printfs, so put a newsted include in <sys/systm.h> where the printf prototype lives and save everybody else the trouble. Notes: svn path=/head/; revision=112367
* Cleanup of the d_mmap_t interface.Maxime Henrion2003-02-251-12/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Get rid of the useless atop() / pmap_phys_address() detour. The device mmap handlers must now give back the physical address without atop()'ing it. - Don't borrow the physical address of the mapping in the returned int. Now we properly pass a vm_offset_t * and expect it to be filled by the mmap handler when the mapping was successful. The mmap handler must now return 0 when successful, any other value is considered as an error. Previously, returning -1 was the only way to fail. This change thus accidentally fixes some devices which were bogusly returning errno constants which would have been considered as addresses by the device pager. - Garbage collect the poorly named pmap_phys_address() now that it's no longer used. - Convert all the d_mmap_t consumers to the new API. I'm still not sure wheter we need a __FreeBSD_version bump for this, since and we didn't guarantee API/ABI stability until 5.1-RELEASE. Discussed with: alc, phk, jake Reviewed by: peter Compile-tested on: LINT (i386), GENERIC (alpha and sparc64) Runtime-tested on: i386 Notes: svn path=/head/; revision=111462
* Back out M_* changes, per decision of the TRB.Warner Losh2003-02-191-2/+2
| | | | | | | Approved by: trb Notes: svn path=/head/; revision=111119
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.Alfred Perlstein2003-01-211-2/+2
| | | | | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT. Notes: svn path=/head/; revision=109623
* Fix printf warnings with %j and uintmax_t.John Baldwin2002-11-081-2/+3
| | | | Notes: svn path=/head/; revision=106662
* Fix rare and probably inconsequential memory leak.Poul-Henning Kamp2002-10-021-1/+3
| | | | | | | Spotted by: FlexeLint Notes: svn path=/head/; revision=104389
* Replace various spelling with FALLTHROUGH which is lint()ablePhilippe Charnier2002-08-251-5/+5
| | | | Notes: svn path=/head/; revision=102412
* GC various bits and pieces of USERCONFIG from all over the place.Poul-Henning Kamp2002-04-091-2/+1
| | | | Notes: svn path=/head/; revision=94275
* Make this compile on ia64.Marcel Moolenaar2001-10-061-1/+4
| | | | Notes: svn path=/head/; revision=84580
* KSE Milestone 2Julian Elischer2001-09-121-6/+6
| | | | | | | | | | | | | | | | | Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha Notes: svn path=/head/; revision=83366
* Fix missing splx().Kazutaka YOKOTA2001-08-101-0/+1
| | | | Notes: svn path=/head/; revision=81455
* s/adress/address/Kris Kennaway2001-07-231-1/+1
| | | | | | | | Inspired by: OpenBSD MFC After: 1 week Notes: svn path=/head/; revision=80203
* Remove unneeded #include <sys/proc.h> lines.Poul-Henning Kamp2000-10-291-1/+0
| | | | Notes: svn path=/head/; revision=67882
* * Completely rewrite the alpha busspace to hide the implementation fromDoug Rabson2000-08-281-0/+1
| | | | | | | | | | | | | | | the drivers. * Remove legacy inx/outx support from chipset and replace with macros which call busspace. * Rework pci config accesses to route through the pcib device instead of calling a MD function directly. With these changes it is possible to cleanly support machines which have more than one independantly numbered PCI busses. As a bonus, the new busspace implementation should be measurably faster than the old one. Notes: svn path=/head/; revision=65176
* Remove #include "vga.h" and #if NVGA > 0 as it's implied by config.Peter Wemm2000-01-291-5/+0
| | | | Notes: svn path=/head/; revision=56832
* Add a workaround to which allows alphas to reserve a port range whichDoug Rabson2000-01-241-1/+1
| | | | | | | | | | | doesn't conflict with the parallel port on my miata (0x3bc..0x3bf). The right solution will be to reserve two port ranges in vga, 0x3b0..0x3ba and 0x3c0..0x3ca. Reviewed by: yokota Notes: svn path=/head/; revision=56522
* Rework the algorithm to detect MDA/CGA/EGA/VGA cards, so thatKazutaka YOKOTA2000-01-101-20/+26
| | | | | | | | the vga driver won't be fooled to believe it has a CGA card when in fact it is a VGA card. Notes: svn path=/head/; revision=55729
* - Fix typo: CGA40 -> CGA80Kazutaka YOKOTA2000-01-101-3/+3
| | | | | | | - Remove erroneous comments. Notes: svn path=/head/; revision=55727
* Fix the ioctl CONS_FINDMODE and its underlying subroutineKazutaka YOKOTA1999-12-071-5/+4
| | | | | | | | | | | | | xxx_query_mode() in the vga and vesa drivers. - xxx_query_mode() returns 0 (success) and a positive error number. - Copy mode information on success. - Remove redundant structure copy. The bug first found in -STABLE by jmg. Notes: svn path=/head/; revision=54258
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50477