aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/fb/fb.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
* Remove pc98 support completely.Yoshihiro Takahashi2017-01-281-2/+0
| | | | | | | | | I thank all developers and contributors for pc98. Relnotes: yes Notes: svn path=/head/; revision=312910
* 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: use our nitems() macro when param.h is available.Pedro F. Giffuni2016-04-211-1/+1
| | | | | | | | | This should cover all the remaining cases in the kernel. Discussed in: freebsd-current Notes: svn path=/head/; revision=298431
* - There's no need to overwrite the default device method with the defaultMarius Strobl2011-11-221-2/+1
| | | | | | | | | | | | | one. Interestingly, these are actually the default for quite some time (bus_generic_driver_added(9) since r52045 and bus_generic_print_child(9) since r52045) but even recently added device drivers do this unnecessarily. Discussed with: jhb, marcel - While at it, use DEVMETHOD_END. Discussed with: jhb - Also while at it, use __FBSDID. Notes: svn path=/head/; revision=227843
* Fix FBIO_ADPINFO ioctl on amd64.Jung-uk Kim2010-02-231-3/+3
| | | | Notes: svn path=/head/; revision=204235
* Update d_mmap() to accept vm_ooffset_t and vm_memattr_t.Robert Noland2009-12-291-3/+3
| | | | | | | | | | | | | | | | 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
* Replace all calls to minor() with dev2unit().Ed Schouten2008-09-271-1/+1
| | | | | | | | | | | | | | | | | | After I removed all the unit2minor()/minor2unit() calls from the kernel yesterday, I realised calling minor() everywhere is quite confusing. Character devices now only have the ability to store a unit number, not a minor number. Remove the confusion by using dev2unit() everywhere. This commit could also be considered as a bug fix. A lot of drivers call minor(), while they should actually be calling dev2unit(). In -CURRENT this isn't a problem, but it turns out we never had any problem reports related to that issue in the past. I suspect not many people connect more than 256 pieces of the same hardware. Reviewed by: kib Notes: svn path=/head/; revision=183397
* Replace explicit calls to video methods with their respective variantsWojciech A. Koszek2007-12-291-10/+9
| | | | | | | | | | | | | | | | | | 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 from compiling the amd64 LINT.Ruslan Ermilov2005-12-041-3/+3
| | | | Notes: svn path=/head/; revision=153084
* Do a pass over all modules in the kernel and make them return EOPNOTSUPPPoul-Henning Kamp2004-07-151-0/+2
| | | | | | | | | | | for unknown events. A number of modules return EINVAL in this instance, and I have left those alone for now and instead taught MOD_QUIESCE to accept this as "didn't do anything". Notes: svn path=/head/; revision=132199
* Device megapatch 4/6:Poul-Henning Kamp2004-02-211-0/+2
| | | | | | | | | | | Introduce d_version field in struct cdevsw, this must always be initialized to D_VERSION. Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing four D_NOGIANT flags and adding 145 D_NEEDGIANT flags. Notes: svn path=/head/; revision=126080
* Device megapatch 1/6:Poul-Henning Kamp2004-02-211-2/+0
| | | | | | | | | | Free approx 86 major numbers with a mostly automatically generated patch. A number of strategic drivers have been left behind by caution, and a few because they still (ab)use their major number. Notes: svn path=/head/; revision=126076
* Change fb_attach() and fb_detach() to take a integer unit number ratherPoul-Henning Kamp2003-09-261-81/+3
| | | | | | | | | than a dev_t. All of the dev_t's passed were bogusly created with makedev() Notes: svn path=/head/; revision=120465
* Use __FBSDID().David E. O'Brien2003-08-241-2/+3
| | | | | | | Also some minor style cleanups. Notes: svn path=/head/; revision=119418
* Changed ??? to foo in dead code since ??? screws up my editor.Jake Burkholder2003-08-241-1/+1
| | | | Notes: svn path=/head/; revision=119384
* - 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
* Gigacommit to improve device-driver source compatibility betweenPoul-Henning Kamp2003-03-031-13/+8
| | | | | | | | | | | | | | | | branches: Initialize struct cdevsw using C99 sparse initializtion and remove all initializations to default values. This patch is automatically generated and has been tested by compiling LINT with all the fields in struct cdevsw in reverse order on alpha, sparc64 and i386. Approved by: re(scottl) Notes: svn path=/head/; revision=111815
* NODEVFS cleanup:Poul-Henning Kamp2003-02-261-2/+3
| | | | | | | | Don't call cdevsw_{add,remove}() Bracket a more correct subset in "#if experimental" Notes: svn path=/head/; revision=111576
* Cleanup of the d_mmap_t interface.Maxime Henrion2003-02-251-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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-3/+3
| | | | | | | Approved by: trb Notes: svn path=/head/; revision=111119
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.Alfred Perlstein2003-01-211-3/+3
| | | | | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT. Notes: svn path=/head/; revision=109623
* Turn on TGA support.David E. O'Brien2002-04-131-5/+6
| | | | | | | Submitted by: Andrew M. Miklic <AndrwMklc@cs.com> Notes: svn path=/head/; revision=94617
* KSE Milestone 2Julian Elischer2001-09-121-9/+9
| | | | | | | | | | | | | | | | | 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
* Add FBIO_BLANK ioctl support. Return ENODEV for yet-to-be-Kazutaka YOKOTA2001-08-021-0/+9
| | | | | | | supported ioctls for now. Notes: svn path=/head/; revision=81039
* With this commit, I hereby pronounce gensetdefs past its use-by date.Peter Wemm2001-06-131-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace the a.out emulation of 'struct linker_set' with something a little more flexible. <sys/linker_set.h> now provides macros for accessing elements and completely hides the implementation. The linker_set.h macros have been on the back burner in various forms since 1998 and has ideas and code from Mike Smith (SET_FOREACH()), John Polstra (ELF clue) and myself (cleaned up API and the conversion of the rest of the kernel to use it). The macros declare a strongly typed set. They return elements with the type that you declare the set with, rather than a generic void *. For ELF, we use the magic ld symbols (__start_<setname> and __stop_<setname>). Thanks to Richard Henderson <rth@redhat.com> for the trick about how to force ld to provide them for kld's. For a.out, we use the old linker_set struct. NOTE: the item lists are no longer null terminated. This is why the code impact is high in certain areas. The runtime linker has a new method to find the linker set boundaries depending on which backend format is in use. linker sets are still module/kld unfriendly and should never be used for anything that may be modular one day. Reviewed by: eivind Notes: svn path=/head/; revision=78161
* Send the remains (such as I have located) of "block major numbers" toPoul-Henning Kamp2001-03-261-1/+0
| | | | | | | the bit-bucket. Notes: svn path=/head/; revision=74810
* Exterminate the use of PSEUDO_SET() with extreme prejudice.Peter Wemm2001-01-311-10/+22
| | | | Notes: svn path=/head/; revision=71862
* Convert more malloc+bzero to malloc+M_ZERO.David Malone2000-12-081-6/+5
| | | | | | | | Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net> Notes: svn path=/head/; revision=69781
* Unused include: #include "fb.h"Peter Wemm2000-06-101-1/+0
| | | | Notes: svn path=/head/; revision=61471
* Prevent vidcontrol -i from crashing alphasAndrew Gallatin2000-05-211-0/+8
| | | | | | | | Reported by: Christian Weisgerber <naddy@mips.inka.de> Approved by: yokota@FreeBSD.ORG Notes: svn path=/head/; revision=60742
* Fix the ioctl CONS_FINDMODE and its underlying subroutineKazutaka YOKOTA1999-12-071-8/+0
| | | | | | | | | | | | | 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
* Remove five now unused fields from struct cdevsw. They should neverPoul-Henning Kamp1999-09-251-5/+0
| | | | | | | | | | | have been there in the first place. A GENERIC kernel shrinks almost 1k. Add a slightly different safetybelt under nostop for tty drivers. Add some missing FreeBSD tags Notes: svn path=/head/; revision=51658
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50477
* Convert DEVFS hooks in (most) drivers to make_dev().Poul-Henning Kamp1999-08-231-3/+1
| | | | | | | | | | | | | | | | | | | Diskslice/label code not yet handled. Vinum, i4b, alpha, pc98 not dealt with (left to respective Maintainers) Add the correct hook for devfs to kern_conf.c The net result of this excercise is that a lot less files depends on DEVFS, and devtoname() gets more sensible output in many cases. A few drivers had minor additional cleanups performed relating to cdevsw registration. A few drivers don't register a cdevsw{} anymore, but only use make_dev(). Notes: svn path=/head/; revision=50254
* Remove cmaj and bmaj args from DEV_DRIVER_MODULE.Poul-Henning Kamp1999-07-041-3/+2
| | | | Notes: svn path=/head/; revision=48557
* The second phase of syscons reorganization.Kazutaka YOKOTA1999-06-221-40/+433
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Split syscons source code into manageable chunks and reorganize some of complicated functions. - Many static variables are moved to the softc structure. - Added a new key function, PREV. When this key is pressed, the vty immediately before the current vty will become foreground. Analogue to PREV, which is usually assigned to the PrntScrn key. PR: kern/10113 Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de> - Modified the kernel console input function sccngetc() so that it handles function keys properly. - Reorganized the screen update routine. - VT switching code is reorganized. It now should be slightly more robust than before. - Added the DEVICE_RESUME function so that syscons no longer hooks the APM resume event directly. - New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING, SC_NO_HISTORY and SC_NO_SYSMOUSE. Various parts of syscons can be omitted so that the kernel size is reduced. SC_PIXEL_MODE Made the VESA 800x600 mode an option, rather than a standard part of syscons. SC_DISABLE_DDBKEY Disables the `debug' key combination. SC_ALT_MOUSE_IMAGE Inverse the character cell at the mouse cursor position in the text console, rather than drawing an arrow on the screen. Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG) SC_DFLT_FONT makeoptions "SC_DFLT_FONT=_font_name_" Include the named font as the default font of syscons. 16-line, 14-line and 8-line font data will be compiled in. This option replaces the existing STD8X16FONT option, which loads 16-line font data only. - The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c. - The video driver provides a set of ioctl commands to manipulate the frame buffer. - New kernel configuration option: VGA_WIDTH90 Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These modes are mot always supported by the video card. PR: i386/7510 Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx. - The header file machine/console.h is reorganized; its contents is now split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h (another new file). machine/console.h is still maintained for compatibility reasons. - Kernel console selection/installation routines are fixed and slightly rebumped so that it should now be possible to switch between the interanl kernel console (sc or vt) and a remote kernel console (sio) again, as it was in 2.x, 3.0 and 3.1. - Screen savers and splash screen decoders Because of the header file reorganization described above, screen savers and splash screen decoders are slightly modified. After this update, /sys/modules/syscons/saver.h is no longer necessary and is removed. Notes: svn path=/head/; revision=48104
* Simplify cdevsw registration.Poul-Henning Kamp1999-05-311-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The cdevsw_add() function now finds the major number(s) in the struct cdevsw passed to it. cdevsw_add_generic() is no longer needed, cdevsw_add() does the same thing. cdevsw_add() will print an message if the d_maj field looks bogus. Remove nblkdev and nchrdev variables. Most places they were used bogusly. Instead check a dev_t for validity by seeing if devsw() or bdevsw() returns NULL. Move bdevsw() and devsw() functions to kern/kern_conf.c Bump __FreeBSD_version to 400006 This commit removes: 72 bogus makedev() calls 26 bogus SYSINIT functions if_xe.c bogusly accessed cdevsw[], author/maintainer please fix. I4b and vinum not changed. Patches emailed to authors. LINT probably broken until they catch up. Notes: svn path=/head/; revision=47640
* This commit should be a extensive NO-OP:Poul-Henning Kamp1999-05-301-5/+20
| | | | | | | | | | | | | | | | Reformat and initialize correctly all "struct cdevsw". Initialize the d_maj and d_bmaj fields. The d_reset field was not removed, although it is never used. I used a program to do most of this, so all the files now use the same consistent format. Please keep it that way. Vinum and i4b not modified, patches emailed to respective authors. Notes: svn path=/head/; revision=47625
* sysconsKazutaka YOKOTA1999-01-191-3/+4
| | | | | | | | | | | | | | | | | | | | - Bring down the splash screen when a vty is opened for the first time. - Make sure the splash screen/screen saver is stopped before switching vtys. - Read and save initial values in the BIOS data area early. VESA BIOS may change BIOS data values when switching modes. - Fix missing '&' operator. - Move ISA specific part of driver initialization to syscons_isa.c. atkbd - kbdtables.h is now in /sys/dev/kbd. all - Adjust for forthcoming alpha port. Submitted by: dfr Notes: svn path=/head/; revision=42831
* Clean up warnings: get conditional compilation right so that a localKazutaka YOKOTA1999-01-121-6/+11
| | | | | | | | function won't be defined unless it is actually used. Requested by: eivind Notes: svn path=/head/; revision=42564
* Add the new keyboard driver and video card driver. They will beKazutaka YOKOTA1999-01-091-0/+415
used by console drivers. (They are not yet activated yet. Wait for announcement later.) Notes: svn path=/head/; revision=42421