code sync against nvidia/matrox drivers: added capability to run without INT assigned, proposemode fixes for dualhead/tvout related custom flags, GET_ACCELERANT_DEV_INFO returns much more detailed info, INIT_ and CLONE_ACCELERANT now enforce correct use. Bumped version to 0.12. Docs updated.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16033 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Rudolf Cornelissen
2006-01-21 22:14:35 +00:00
parent 489527469f
commit cdcb46775f
3 changed files with 49 additions and 33 deletions
@@ -35,7 +35,6 @@ You use this software at your own risk! Although I don't expect it to damage you
</ul>
<strong>Known limitations:</strong>
<ul>
<li>If the driver does not load make sure you enabled 'assign IRQ to VGA card' in your system BIOS;
<li>NeoMagic cards do not support overlay downscaling. You won't be able to select for instance 50% scaled output, nor will you be able to resize the video output window below 100% by dragging.
<br>
(In Windows downscaling works: this is done by scaling down the overlay input bitmaps in the application software: so this is a 'trick' solution not done by the driver!)
@@ -121,6 +120,6 @@ Dumprom is another 'tool' for bug-tracking purposes.
<hr>
<br>
<a href="mailto:[email protected]">Rudolf Cornelissen.</a>
<p>(Page last updated on November 18, 2004)</p>
<p>(Page last updated on January 21, 2006)</p>
</body>
</html>
@@ -4,6 +4,18 @@
</head>
<body>
<p><h2>Changes done for each driverversion:</h2></p>
<p><h1>head (svn 0.12, Rudolf)</h1></p>
<ul>
<li>Added capability to driver to run without an INT assigned. Driver will now automatically disable the 'Sync_to_Retrace' function if no INT was assigned instead of not loading/running at all;<br>
<strong>Note please:</strong>
<ul>
<li>The retrace semaphore is always disabled yet due to lack of specs for interrupt handling.
</ul>
<li>Several ProposeMode updates and fixes making the Neomagic driver better compatible with Dualhead Setup 0.04 (although this driver doesn't support dualhead and TVout yet);
<li>The overlay engine code now respects the B_OVERLAY_COLOR_KEY flag instead of forcing keying ON;
<li>Hook GET_ACCELERANT_DEVICE_INFO now returns much more detailed info about the card in use;
<li>Hooks INIT_ACCELERANT and CLONE_ACCELERANT now enforce their correct use; returning error B_NOT_ALLOWED in case of errors.
</ul>
<p><h1>nm_driver 0.11 (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);
@@ -5,7 +5,7 @@
Other authors:
Mark Watson;
Apsed;
Rudolf Cornelissen 5/2002-11/2004.
Rudolf Cornelissen 5/2002-1/2006.
*/
/* standard kernel driver stuff */
@@ -673,7 +673,6 @@ static status_t open_hook (const char* name, uint32 flags, void** cookie) {
thread_id thid;
thread_info thinfo;
status_t result = B_OK;
vuint32 *regs, *regs2;
char shared_name[B_OS_NAME_LENGTH];
/* find the device name in the list of devices */
@@ -711,17 +710,25 @@ static status_t open_hook (const char* name, uint32 flags, void** cookie) {
si->device_id = di->pcii.device_id;
si->revision = di->pcii.revision;
/* ensure that the accelerant's INIT_ACCELERANT function can be executed */
si->accelerant_in_use = false;
/* map the device */
result = map_device(di);
if (result < 0) goto free_shared;
/* we will be returning OK status for sure now */
result = B_OK;
/* disable and clear any pending interrupts */
disable_vbi(di->regs, di->regs2);
/* preset we can't use INT related functions */
si->ps.int_assigned = false;
/* create a semaphore for vertical blank management */
si->vblank = create_sem(0, di->name);
if (si->vblank < 0) {
result = si->vblank;
goto unmap;
}
if (si->vblank < 0) goto mark_as_open;
/* change the owner of the semaphores to the opener's team */
/* this is required because apps can't aquire kernel semaphores */
@@ -729,30 +736,31 @@ static status_t open_hook (const char* name, uint32 flags, void** cookie) {
get_thread_info(thid, &thinfo);
set_sem_owner(si->vblank, thinfo.team);
/* assign local regs pointer for SAMPLExx() macros */
regs = di->regs;
regs2 = di->regs2;
/* disable and clear any pending interrupts */
disable_vbi(regs, regs2);
/* If there is a valid interrupt line assigned then set up interrupts */
if ((di->pcii.u.h0.interrupt_pin == 0x00) ||
(di->pcii.u.h0.interrupt_line == 0xff) || /* no IRQ assigned */
(di->pcii.u.h0.interrupt_line <= 0x02)) /* system IRQ assigned */
{
/* we are aborting! */
/* Note: the R4 graphics driver kit lacks this statement!! */
result = B_ERROR;
/* interrupt does not exist so exit without installing our handler */
goto delete_the_sem;
/* delete the semaphore as it won't be used */
delete_sem(si->vblank);
si->vblank = -1;
}
else
{
/* otherwise install our interrupt handler */
result = install_io_interrupt_handler(di->pcii.u.h0.interrupt_line, nm_interrupt, (void *)di, 0);
/* bail if we couldn't install the handler */
if (result != B_OK) goto delete_the_sem;
if (result != B_OK)
{
/* delete the semaphore as it won't be used */
delete_sem(si->vblank);
si->vblank = -1;
}
else
{
/* inform accelerant(s) we can use INT related functions */
si->ps.int_assigned = true;
}
}
mark_as_open:
@@ -765,12 +773,6 @@ mark_as_open:
goto done;
delete_the_sem:
delete_sem(si->vblank);
unmap:
unmap_device(di);
free_shared:
/* clean up our shared area */
delete_area(di->shared_area);
@@ -835,13 +837,16 @@ free_hook (void* dev) {
/* disable and clear any pending interrupts */
disable_vbi(regs, regs2);
/* remove interrupt handler */
remove_io_interrupt_handler(di->pcii.u.h0.interrupt_line, nm_interrupt, di);
/* delete the semaphores, ignoring any errors ('cause the owning team may have died on us) */
delete_sem(si->vblank);
si->vblank = -1;
if (si->ps.int_assigned)
{
/* remove interrupt handler */
remove_io_interrupt_handler(di->pcii.u.h0.interrupt_line, nm_interrupt, di);
/* delete the semaphores, ignoring any errors ('cause the owning team may have died on us) */
delete_sem(si->vblank);
si->vblank = -1;
}
/* free regs and framebuffer areas */
unmap_device(di);