summaryrefslogtreecommitdiffstats
path: root/sys/dev/fb
Commit message (Collapse)AuthorAgeFilesLines
* Use the preload_fetch_addr() and preload_fetch_size() conveniencemarcel2011-02-131-15/+17
| | | | | | functions to obtain the address and size of the bitmap splash image. Sponsored by: Juniper Networks.
* Fix segment:offset calculation of interrupt vector for relocated video BIOSjkim2010-09-131-8/+6
| | | | | | | when the original offset is bigger than size of one page. X86BIOS macros cannot be used here because it is assumed address is only linear in a page. Tested by: netchild
* Disable video ROM shadowing by default as I originally intended. I foundjkim2010-09-021-2/+2
| | | | | a case where video ROM for an IGP is too tightly coupled with system BIOS to get relocated.
* Make sure the interrupt entry point is within the video ROM range. We mustjkim2010-08-311-9/+15
| | | | | | | | not change interrupt vector if it is not pointing the ROM itself. Actually, we just fail shadowing altogether if that is the case because the shadowed copy will be useless for sure and POST may not be relocatable or useful. While I'm here, fix a debugging message under bootverbose, really. r211829 fixed one case but broke another. Mea Culpa.
* Fix a debugging message under bootverbose. This address is not linear.jkim2010-08-251-1/+1
|
* Add an experimental feature to shadow video BIOS. Long ago, this trick wasjkim2010-08-251-10/+57
| | | | | | | | | | supported by many BIOSes to improve performance of VESA BIOS calls for real mode OSes but it is not our intention here. However, this may help some platforms where the video ROMs are inaccessible after suspend, for example. Note it may consume up to 64K bytes of contiguous memory depending on video controller model when it is enabled. This feature can be disabled by setting zero to 'debug.vesa.shadow_rom' loader tunable via loader(8) or loader.conf(5). The default is 1 (enabled), for now.
* Protect shared palette and state buffer with a mutex. Remove defunctjkim2010-08-071-14/+27
| | | | spltty() calls while I am here.
* Initialize a variable before its use.jkim2010-07-131-1/+1
|
* Preallocate buffers for palette and state. Do not save DAC registers asjkim2010-07-131-83/+58
| | | | we reset DAC mode and restore palette data while we are resuming always.
* Plug a possible memory leak.jkim2010-07-061-1/+1
| | | | Submitted by: Yamagi Burmeister (lists at yamagi dot org)
* Fix a possible null pointer dereference. A patch for -STABLE wasjkim2010-07-061-0/+2
| | | | Submitted by: Yamagi Burmeister (lists at yamagi dot org)
* Use M_WAITOK for VESA BIOS initialization consistently.jkim2010-06-231-5/+5
|
* Let x86bios_alloc() pass contigmalloc(9) flags. Use it to set M_WAITOKjkim2010-06-231-9/+7
| | | | | from VESA BIOS initialization. All other malloc(9) uses in the function is blocking any way.
* Remove unused i586 optimized bcopy/bzero/etc implementations that utilizekib2010-06-231-10/+1
| | | | | | | | | FPU registers for copying. Remove the switch table and jumps from bcopy/bzero/... to the actual implementation. As a side-effect, i486-optimized bzero is removed. Reviewed by: bde Tested by: pho (previous version)
* Restore the previous VESA mode after BIOS POST, just in case.jkim2010-05-181-0/+1
|
* Remove unnecessary pointer increment. A wrong pointer may be passed tojkim2010-05-181-4/+4
| | | | | | | | free(9) and it can cause kernel panic when there are multiple graphics controllers in the system. Tested by: Brandon Gooch (jamesbrandongooch at gmail dot com) MFC after: 3 days
* Allocate memory for VBE info block with malloc(9), not as static local.jkim2010-04-071-22/+28
|
* Do not penalize correct or correctable VESA mode tables by calling anotherjkim2010-03-251-7/+14
| | | | | VBE function. Most problems should be corrected by the mode table sanity check and we only need the paranoid in extremely rare cases.
* Teach VGA framebuffer about 8-bit palette format for VESA.jkim2010-03-242-12/+16
|
* Add my copyright here. It seems I have contributed enough code. :-)jkim2010-03-231-0/+1
|
* Be extremely careful when we determine bytes per scan line information.jkim2010-03-231-11/+54
| | | | | | | First, we compare mode table data against minimum value. If the mode table does not make sense, we set the minimum in the mode info. When we actually set the mode, we try VESA BIOS function and compare it against the previous value. If it makes more sense, update the information.
* Fall back to VGA palette functions if VESA function failed and DAC is stilljkim2010-03-231-11/+10
| | | | | in 6-bit mode. Although we have to check non-VGA compatibility bit here, it seems there are too many broken VESA BIOSes out to rely on it.
* Map entire video memory again. This is a partial backout of r203535.jkim2010-03-231-3/+4
| | | | | Although we do not use them all directly, it seems VGA render may access unmapped memory region and cause kernel panic.
* Yet another attempt to make palette loading more safer:jkim2010-02-231-24/+33
| | | | | | | | | - Add a separate palette data for 8-bit DAC mode when SC_PIXEL_MODE is set and fill it up with default gray-scale palette data for text. Now we don't have to set `hint.sc.0.vesa_mode' to get the default palette data. - Add a new adapter flag, V_ADP_DAC8 to track whether the controller is using 8-bit palette format and load correct palette when switching modes. - Set 8-bit DAC mode only for non-VGA compatible graphics mode.
* Re-add accidentally removed pixel format for direct memory model.jkim2010-02-231-2/+42
|
* Fix FBIO_ADPINFO ioctl on amd64.jkim2010-02-231-3/+3
|
* Map and report actual video memory we need.jkim2010-02-061-81/+34
|
* Replace some homegrown functions with better/correct ones.jkim2010-02-051-46/+7
|
* Remove dead code and fix style(9) bugs.jkim2010-02-031-66/+77
|
* Use bytes per scan line from mode table. The previous implementation didjkim2010-02-031-37/+13
| | | | not reflect actual number of bytes when it was not exactly width * bpp * 8.
* Correct virtual address of frame buffer for non-linear mode.jkim2010-02-031-1/+1
| | | | Reported by: Marc UBM Bocklet (ubm dot freebsd at googlemail dot com)
* Use VESA palette load/save functions if VESA BIOS says the current palettejkim2010-01-271-14/+22
| | | | | | | | format is higher than 6-bit instead of relying VGA compatibility flag. This fixes palette problem of NVIDIA GeForce 6600. Reduce code differences between palette load/save functions while we are here. Tested by: danfe
* Update d_mmap() to accept vm_ooffset_t and vm_memattr_t.rnoland2009-12-298-28/+30
| | | | | | | | | | | | | 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...
* - Remove a redundant check for dpms(4).jkim2009-11-121-2/+2
| | | | - Test a cheaper function first.
* - Partially revert hackish r198964 and r199002.jkim2009-11-121-1/+0
| | | | | | | - Add a proxy driver vgapm to help vgapci to save/load VGA state. - Move device_set_desc() to the right place while we are here. Reviewed by: jhb
* Remove duplicate suspend/resume code from vga_pci.c and let vga(4) registerjkim2009-11-061-0/+1
| | | | | | itself to an associated PCI device if it exists. It is little bit hackish but it should fix build without frame buffer driver since r198964. Fix some style(9) nits in vga_isa.c while we are here.
* Save/restore VGA state from vga_pci.c instead of relying on vga_isa.c.jkim2009-11-051-49/+5
| | | | | It was not working because we were saving its state after the device was powered down. Simplify vesa_load_state() as the culprit is fixed now.
* Do not probe video mode if we are not going to use it.jkim2009-11-041-7/+9
|
* Restore color palette format if we reset video mode.jkim2009-11-041-0/+2
|
* Save/restore VGA color palette while suspending and resuming.jkim2009-11-041-0/+1
|
* Fix VESA color palette corruption:jkim2009-11-031-59/+36
| | | | | | | | | | | | - VBE 3.0 says palette format resets to 6-bit mode when video mode changes. We simply set 8-bit mode when we switch modes if the adapter supports it. - VBE 3.0 also says if the mode is not VGA compatible, we must use VBE function to save/restore palette. Otherwise, VGA function may be used. Thus, reinstate the save/load palette functions only for non-VGA compatible modes regardless of its palette format. - Let vesa(4) set VESA modes even if vga(4) claims to support it. - Reset default palette if VESA pixel mode is set initially. - Fix more style nits.
* Remove a redundant byte swapping in the previous commit.jkim2009-10-231-1/+0
|
* - When we restore VESA state, try BIOS POST earlier. VESA restore statejkim2009-10-232-25/+71
| | | | | | | | | | | | | function may not work properly if we don't. Turn off hardware cursor as vesa_set_mode() does. - Add VBE 3.0 specific fields in VESA mode structure and pack it. Note the padding is 190 bytes although VBE 3.0 says 189 bytes. It must be wrong because the size of structure becomes 255 bytes and the specification says it must be 256 bytes in total. In fact, an example code in the spec. does it right, though. While we are at it, fix some i386-isms. - Remove state buffer size limitation. It is no longer necessary since sys/compat/x86bios/x86bios.c r198251. - Move int 0x10 vector test into vesa_bios_post() as we always do it anyway.
* Rewrite x86bios and update its dependent drivers.jkim2009-10-191-304/+490
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Do not map entire real mode memory (1MB). Instead, we map IVT/BDA and ROM area separately. Most notably, ROM area is mapped as device memory (uncacheable) as it should be. User memory is dynamically allocated and free'ed with contigmalloc(9) and contigfree(9). Remove now redundant and potentially dangerous x86bios_alloc.c. If this emulator ever grows to support non-PC hardware, we may implement it with rman(9) later. - Move all host-specific initializations from x86emu_util.c to x86bios.c and remove now unnecessary x86emu_util.c. Currently, non-PC hardware is not supported. We may use bus_space(9) later when the KPI is fixed. - Replace all bzero() calls for emulated registers with more obviously named x86bios_init_regs(). This function also initializes DS and SS properly. - Add x86bios_get_intr(). This function checks if the interrupt vector is available for the platform. It is not necessary for PC-compatible hardware but it may be needed later. ;-) - Do not try turning off monitor if DPMS does not support the state. - Allocate stable memory for VESA OEM strings instead of just holding pointers to them. They may or may not be accessible always. Fix a memory leak of video mode table while I am here. - Add (experimental) BIOS POST call for vesa(4). This function calls VGA BIOS POST code from the current VGA option ROM. Some video controllers cannot save and restore the state properly even if it is claimed to be supported. Usually the symptom is blank display after resuming from suspend state. If the video mode does not match the previous mode after restoring, we try BIOS POST and force the known good initial state. Some magic was taken from NetBSD (and it was taken from vbetool, I believe.) - Add a loader tunable for vgapci(4) to give a hint to dpms(4) and vesa(4) to identify who owns the VESA BIOS. This is very useful for multi-display adapter setup. By default, the POST video controller is automatically probed and the tunable "hw.pci.default_vgapci_unit" is set to corresponding vgapci unit number. You may override it from loader but it is very unlikely to be necessary. Unfortunately only AGP/PCI/PCI-E controllers can be matched because ISA controller does not have necessary device IDs. - Fix a long standing bug in state save/restore function. The state buffer pointer should be ES:BX, not ES:DI according to VBE 3.0. If it ever worked, that's because BX was always zero. :-) - Clean up register initializations more clearer per VBE 3.0. - Fix a lot of style issues with vesa(4).
* Reject some VESA graphics modes if the controller does not have enoughjkim2009-09-251-34/+50
| | | | | | | memory to support them. Some adapters have expansible memory slots but video mode table is static. In this case, unusable modes may be reported. Submitted by: paradox (ddkprog yahoo com) (initial patch)
* Fix LINT build.delphij2009-09-251-1/+1
|
* Some broken VESA BIOSes, e.g., IBM T23, return wrong value fromjkim2009-09-241-4/+5
| | | | | | | vesa_bios_get_line_length() in graphics mode. Always calculate the value from known video info instead. Submitted by: paradox (ddkprog yahoo com)
* - Use FreeBSD function naming convention.jkim2009-09-241-41/+41
| | | | | | | - Change x86biosCall() to more appropriate x86bios_intr().[1] Discussed with: delphij, paradox (ddkprog yahoo com) Submitted by: paradox (ddkprog yahoo com)[1]
* Move sys/dev/x86bios to sys/compat/x86bios.jkim2009-09-231-1/+1
| | | | | | It may not be optimal but it is clearly better than the old place. OK'ed by: delphij, paradox (ddkprog yahoo com)
* Initialize registers to zero before calling the interrupt handlers insidedelphij2009-09-231-0/+19
| | | | | | emulator. This fixes VESA related freeze observed on some systems. Submitted by: paradox <ddkprog yahoo com>
OpenPOWER on IntegriCloud