fixed VGA BIOS ROM dump to file option, updated docs, updated default settings.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9738 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Rudolf Cornelissen 2004-11-02 13:58:22 +00:00
parent f2ef38a49b
commit 1e4d5a6089
3 changed files with 67 additions and 27 deletions

View File

@ -4,13 +4,15 @@
</head>
<body>
<p><h2>Changes done for each driverversion:</h2></p>
<p><h1>head 0.09 (Rudolf)</h1></p>
<p><h1>head 0.10 (Rudolf)</h1></p>
<ul>
<li>Added full 2D acceleration for all remaining cards that did not have that yet with this driver (still largely untested);
<li>Fixed a long standing problem with MagicMedia (all NM2200 and later) cards with overlay: buffer width is programmed correctly now. Can't believe I didn't see that before!
<li>Updated NM2200 and later cards workspace virtualsize restrictions for accelerated modes: it turns out these cards engines have the same restrictions as most older ones, being 1600x1024 resolution;
<li>Updated overlay scaling restrictions: officially the cards support upto and including 8x upscaling;
<li>Fixed error regarding calculating overlay engine register value for right-clipping video output: on NM2200 and later this was (probably) responsible for the big-time output distortions even without clipping!
<li>Fixed BIOS ROM dump (to file) option;
<li>Fixed GET_TIMING_CONSTRAINTS and GET_ACCELERANT_DEVICE_INFO accelerant hooks to return valid data; updated modeline checking and modification code (used by ProposeDisplayMode) to adhere to one more timing constraint.
</ul>
<p><h1>nm_driver 0.06 (Rudolf)</h1></p>
<ul>
@ -61,7 +63,7 @@ Acceleration engine benchmarked and tested for errors with BeRoMeter V1.2.6.
<p><h1>Still todo:</h1></p>
<ul>
<li>fix for trouble with booting into modes above 800x600 resolution on some cards (please report this behaviour!);
<li>MagicMedia series overlay update: still contains errors???.
<li>setup workarounds for MagicMedia series overlay engine and 2D acceleration engine hardware faults.
</ul>
</p>
</body>

View File

@ -5,7 +5,7 @@
Other authors:
Mark Watson;
Apsed;
Rudolf Cornelissen 5/2002-8/2004.
Rudolf Cornelissen 5/2002-11/2004.
*/
/* standard kernel driver stuff */
@ -129,15 +129,22 @@ static settings current_settings = { // see comments in nm.settings
// for accelerant
0x00000000, // logmask
0, // memory
false, // usebios
false, // hardcursor
true, // usebios
true, // hardcursor
};
static void dumprom (void *rom, size_t size)
static void dumprom (void *rom, uint32 size)
{
int fd = open ("/boot/home/" DRIVER_PREFIX ".rom", O_WRONLY | O_CREAT, 0666);
int fd;
uint32 cnt;
fd = open ("/boot/home/" DRIVER_PREFIX ".rom", O_WRONLY | O_CREAT, 0666);
if (fd < 0) return;
write (fd, rom, size);
/* apparantly max. 32kb may be written at once;
* the ROM size is a multiple of that anyway. */
for (cnt = 0; (cnt < size); cnt += 32768)
write (fd, ((void *)(((uint8 *)rom) + cnt)), 32768);
close (fd);
}
@ -317,8 +324,8 @@ static status_t map_device(device_info *di)
pci_info *pcii = &(di->pcii);
system_info sysinfo;
/*variables for making copy of ROM*/
char * rom_temp;
/* variables for making copy of ROM */
uint8* rom_temp;
area_id rom_area;
int frame_buffer = 0;
@ -408,19 +415,46 @@ static status_t map_device(device_info *di)
di->pcii.vendor_id, di->pcii.device_id,
di->pcii.bus, di->pcii.device, di->pcii.function);
/*place ROM over the fbspace (this is definately safe)*/
tmpUlong = di->pcii.u.h0.base_registers[frame_buffer];
tmpUlong |= 0x00000001;
set_pci(PCI_rom_base, 4, tmpUlong);
/* get ROM memory mapped base adress - this is defined in the PCI standard */
tmpUlong = get_pci(PCI_rom_base, 4);
if (tmpUlong)
{
/* ROM was assigned an adress, so enable ROM decoding - see PCI standard */
tmpUlong |= 0x00000001;
set_pci(PCI_rom_base, 4, tmpUlong);
rom_area = map_physical_memory(
buffer,
(void *)di->pcii.u.h0.base_registers[frame_buffer],
32768,
B_ANY_KERNEL_ADDRESS,
B_READ_AREA,
(void **)&(rom_temp)
);
rom_area = map_physical_memory(
buffer,
(void *)di->pcii.u.h0.rom_base_pci,
di->pcii.u.h0.rom_size,
B_ANY_KERNEL_ADDRESS,
B_READ_AREA,
(void **)&(rom_temp)
);
/* check if we got the BIOS signature (might fail on laptops..) */
if (rom_temp[0]!=0x55 || rom_temp[1]!=0xaa)
{
/* apparantly no ROM is mapped here */
delete_area(rom_area);
rom_area = -1;
/* force using ISA legacy map as fall-back */
tmpUlong = 0x00000000;
}
}
if (!tmpUlong)
{
/* ROM was not assigned an adress, fetch it from ISA legacy memory map! */
rom_area = map_physical_memory(
buffer,
(void *)0x000c0000,
32768,
B_ANY_KERNEL_ADDRESS,
B_READ_AREA,
(void **)&(rom_temp)
);
}
/* if mapping ROM to vmem failed then clean up and pass on error */
if (rom_area < 0) {
@ -437,12 +471,16 @@ static status_t map_device(device_info *di)
return rom_area;
}
/* make a copy of ROM for future reference*/
memcpy (si->rom_mirror, rom_temp, 32768);
/* dump ROM to file if selected in nm.settings
* (ROM should always fit in 32Kb) */
if (current_settings.dumprom) dumprom (rom_temp, 32768);
/* make a copy of ROM for future reference */
memcpy (si->rom_mirror, rom_temp, 32768);
/*disable ROM and delete the area*/
set_pci(PCI_rom_base,4,0);
/* disable ROM decoding - this is defined in the PCI standard, and delete the area */
tmpUlong = get_pci(PCI_rom_base, 4);
tmpUlong &= 0xfffffffe;
set_pci(PCI_rom_base, 4, tmpUlong);
delete_area(rom_area);
/* work out a name for the framebuffer mapping*/

View File

@ -8,7 +8,7 @@
# accelerant "nm.accelerant"
# nm.accelerant parameters
usebios false # if true rely on bios to coldstart the card instead of driver
usebios true # if true rely on bios to coldstart the card instead of driver
#memory 2048 # in Kb, override builtin memory size detection
hardcursor true # if true use on-chip cursor capabilities
#logmask 0x00000000 # nothing logged, except errors, is default