completed MagicMedia 2D acceleration (so NM2200 and all later cards). Please test and provide feedback!
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8504 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -216,12 +216,12 @@ status_t check_acc_capability(uint32 feature)
|
|||||||
if (si->acc_mode)
|
if (si->acc_mode)
|
||||||
{
|
{
|
||||||
//fixme: temporary, until acc for these cards is completely setup...
|
//fixme: temporary, until acc for these cards is completely setup...
|
||||||
if ((si->ps.card_type >= NM2200) && (feature != B_SCREEN_TO_SCREEN_BLIT))
|
/* if ((si->ps.card_type >= NM2200) && (feature != B_SCREEN_TO_SCREEN_BLIT))
|
||||||
{
|
{
|
||||||
LOG(4, ("Acc: Not exporting hook %s.\n", msg));
|
LOG(4, ("Acc: Not exporting hook %s.\n", msg));
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
LOG(4, ("Acc: Exporting hook %s.\n", msg));
|
LOG(4, ("Acc: Exporting hook %s.\n", msg));
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,12 @@
|
|||||||
Rudolf Cornelissen 3/2004-7/2004.
|
Rudolf Cornelissen 3/2004-7/2004.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
General note about NeoMagic cards:
|
||||||
|
The Neomagic acceleration engines apparantly contain several faults which is the
|
||||||
|
main reason for the differences in setup for different engines.
|
||||||
|
*/
|
||||||
|
|
||||||
#define MODULE_BIT 0x00080000
|
#define MODULE_BIT 0x00080000
|
||||||
|
|
||||||
#include "nm_std.h"
|
#include "nm_std.h"
|
||||||
@@ -19,7 +25,7 @@ invert rectangle
|
|||||||
blit
|
blit
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//fixme: acc setup for NM2070, NM2097 and NM2160 only for now...
|
//fixme: still setup for NM2090 and NM2093 cards...
|
||||||
//fixme: seperate acc routines for different architectures for (marginal) speedup?
|
//fixme: seperate acc routines for different architectures for (marginal) speedup?
|
||||||
status_t nm_acc_wait_idle()
|
status_t nm_acc_wait_idle()
|
||||||
{
|
{
|
||||||
@@ -256,8 +262,9 @@ status_t nm_acc_setup_rectangle(uint32 color)
|
|||||||
// so:
|
// so:
|
||||||
nm_acc_wait_idle();
|
nm_acc_wait_idle();
|
||||||
|
|
||||||
if (si->ps.card_type == NM2070)
|
switch (si->ps.card_type)
|
||||||
{
|
{
|
||||||
|
case NM2070:
|
||||||
/* use ROP GXcopy (b16-19), use linear adressing system, do foreground color (b3) */
|
/* use ROP GXcopy (b16-19), use linear adressing system, do foreground color (b3) */
|
||||||
ACCW(CONTROL, (si->engine.control | 0x000c0008));
|
ACCW(CONTROL, (si->engine.control | 0x000c0008));
|
||||||
/* setup color */
|
/* setup color */
|
||||||
@@ -266,13 +273,20 @@ status_t nm_acc_setup_rectangle(uint32 color)
|
|||||||
else
|
else
|
||||||
/* swap colorbytes */
|
/* swap colorbytes */
|
||||||
ACCW(FGCOLOR, (((color & 0xff00) >> 8) | ((color & 0x00ff) << 8)));
|
ACCW(FGCOLOR, (((color & 0xff00) >> 8) | ((color & 0x00ff) << 8)));
|
||||||
}
|
break;
|
||||||
else
|
case NM2097:
|
||||||
{
|
case NM2160:
|
||||||
/* use ROP GXcopy (b16-19), use XY coord. system (b24-25), do foreground color (b3) */
|
/* use ROP GXcopy (b16-19), use XY coord. system (b24-25), do foreground color (b3) */
|
||||||
ACCW(CONTROL, (si->engine.control | 0x830c0008));
|
ACCW(CONTROL, (si->engine.control | 0x830c0008));
|
||||||
/* setup color */
|
/* setup color */
|
||||||
ACCW(FGCOLOR, color);
|
ACCW(FGCOLOR, color);
|
||||||
|
break;
|
||||||
|
default: /* NM2200 and later */
|
||||||
|
/* use ROP GXcopy (b16-19), use XY coord. system (b24-25), do foreground color (b3) */
|
||||||
|
ACCW(CONTROL, (/*si->engine.control |*/ 0x830c0008));
|
||||||
|
/* setup color */
|
||||||
|
ACCW(FGCOLOR, color);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
@@ -293,15 +307,16 @@ status_t nm_acc_rectangle(uint32 xs,uint32 xe,uint32 ys,uint32 yl)
|
|||||||
nm_acc_wait_idle();
|
nm_acc_wait_idle();
|
||||||
|
|
||||||
/* send command and exexute (warning: order of programming regs is important!) */
|
/* send command and exexute (warning: order of programming regs is important!) */
|
||||||
if (si->ps.card_type == NM2070)
|
switch (si->ps.card_type)
|
||||||
{
|
{
|
||||||
|
case NM2070:
|
||||||
ACCW(2070_XYEXT, (((yl - 1) << 16) | ((xe - xs - 1) & 0x0000ffff)));
|
ACCW(2070_XYEXT, (((yl - 1) << 16) | ((xe - xs - 1) & 0x0000ffff)));
|
||||||
ACCW(2070_DSTSTARTOFF, ((ys * si->fbc.bytes_per_row) + (xs * si->engine.depth)));
|
ACCW(2070_DSTSTARTOFF, ((ys * si->fbc.bytes_per_row) + (xs * si->engine.depth)));
|
||||||
}
|
break;
|
||||||
else
|
default: /* NM2097 and later */
|
||||||
{
|
|
||||||
ACCW(2090_DSTSTARTOFF, ((ys << 16) | (xs & 0x0000ffff)));
|
ACCW(2090_DSTSTARTOFF, ((ys << 16) | (xs & 0x0000ffff)));
|
||||||
ACCW(2090_XYEXT, ((yl << 16) | ((xe - xs) & 0x0000ffff)));
|
ACCW(2090_XYEXT, ((yl << 16) | ((xe - xs) & 0x0000ffff)));
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
@@ -316,19 +331,25 @@ status_t nm_acc_setup_rect_invert()
|
|||||||
// so:
|
// so:
|
||||||
nm_acc_wait_idle();
|
nm_acc_wait_idle();
|
||||||
|
|
||||||
if (si->ps.card_type == NM2070)
|
switch (si->ps.card_type)
|
||||||
{
|
{
|
||||||
|
case NM2070:
|
||||||
/* use ROP GXinvert (b16-19), use linear adressing system. */
|
/* use ROP GXinvert (b16-19), use linear adressing system. */
|
||||||
/* note:
|
/* note:
|
||||||
* although selecting foreground color (b3) should have no influence, NM2070
|
* although selecting foreground color (b3) should have no influence, NM2070
|
||||||
* thinks otherwise if depth is not 8-bit. In 8-bit depth ROP takes precedence
|
* thinks otherwise if depth is not 8-bit. In 8-bit depth ROP takes precedence
|
||||||
* over source-select, but in other spaces it's vice-versa (forcing GXcopy!). */
|
* over source-select, but in other spaces it's vice-versa (forcing GXcopy!). */
|
||||||
ACCW(CONTROL, (si->engine.control | 0x00050000));
|
ACCW(CONTROL, (si->engine.control | 0x00050000));
|
||||||
}
|
break;
|
||||||
else
|
case NM2097:
|
||||||
{
|
case NM2160:
|
||||||
/* use ROP GXinvert (b16-19), use XY coord. system (b24-25), do foreground color (b3) */
|
/* use ROP GXinvert (b16-19), use XY coord. system (b24-25), do foreground color (b3) */
|
||||||
ACCW(CONTROL, (si->engine.control | 0x83050008));
|
ACCW(CONTROL, (si->engine.control | 0x83050008));
|
||||||
|
break;
|
||||||
|
default: /* NM2200 and later */
|
||||||
|
/* use ROP GXinvert (b16-19), use XY coord. system (b24-25), do foreground color (b3) */
|
||||||
|
ACCW(CONTROL, (/*si->engine.control |*/ 0x83050008));
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
/* reset color (just to be 'safe') */
|
/* reset color (just to be 'safe') */
|
||||||
ACCW(FGCOLOR, 0);
|
ACCW(FGCOLOR, 0);
|
||||||
@@ -349,15 +370,16 @@ status_t nm_acc_rectangle_invert(uint32 xs,uint32 xe,uint32 ys,uint32 yl)
|
|||||||
nm_acc_wait_idle();
|
nm_acc_wait_idle();
|
||||||
|
|
||||||
/* send command and exexute (warning: order of programming regs is important!) */
|
/* send command and exexute (warning: order of programming regs is important!) */
|
||||||
if (si->ps.card_type == NM2070)
|
switch (si->ps.card_type)
|
||||||
{
|
{
|
||||||
|
case NM2070:
|
||||||
ACCW(2070_XYEXT, (((yl - 1) << 16) | ((xe - xs - 1) & 0x0000ffff)));
|
ACCW(2070_XYEXT, (((yl - 1) << 16) | ((xe - xs - 1) & 0x0000ffff)));
|
||||||
ACCW(2070_DSTSTARTOFF, ((ys * si->fbc.bytes_per_row) + (xs * si->engine.depth)));
|
ACCW(2070_DSTSTARTOFF, ((ys * si->fbc.bytes_per_row) + (xs * si->engine.depth)));
|
||||||
}
|
break;
|
||||||
else
|
default: /* NM2097 and later */
|
||||||
{
|
|
||||||
ACCW(2090_DSTSTARTOFF, ((ys << 16) | (xs & 0x0000ffff)));
|
ACCW(2090_DSTSTARTOFF, ((ys << 16) | (xs & 0x0000ffff)));
|
||||||
ACCW(2090_XYEXT, ((yl << 16) | ((xe - xs) & 0x0000ffff)));
|
ACCW(2090_XYEXT, ((yl << 16) | ((xe - xs) & 0x0000ffff)));
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ status_t nm_general_powerup()
|
|||||||
{
|
{
|
||||||
status_t status;
|
status_t status;
|
||||||
|
|
||||||
LOG(1,("POWERUP: Neomagic (open)BeOS Accelerant 0.07 running.\n"));
|
LOG(1,("POWERUP: Neomagic (open)BeOS Accelerant 0.08 running.\n"));
|
||||||
|
|
||||||
/* detect card type and power it up */
|
/* detect card type and power it up */
|
||||||
switch(CFGR(DEVID))
|
switch(CFGR(DEVID))
|
||||||
@@ -499,7 +499,7 @@ status_t nm_general_validate_pic_size (display_mode *target, uint32 *bytes_per_r
|
|||||||
*acc_mode = false;
|
*acc_mode = false;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
/* NM2230 and later cards support accelerated 24bit modes */
|
/* NM2230 and later cards do support accelerated 24bit modes */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user