completed acc engine funtion move for acc speedup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16060 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
19fb0957a2
commit
aadc40b8e2
|
@ -12,40 +12,4 @@
|
|||
|
||||
#include "acc_std.h"
|
||||
|
||||
void INVERT_RECTANGLE(engine_token *et, fill_rect_params *list, uint32 count) {
|
||||
int i;
|
||||
|
||||
/*draw each rectangle*/
|
||||
i=0;
|
||||
while (count--)
|
||||
{
|
||||
gx00_acc_rectangle_invert
|
||||
(
|
||||
list[i].left,
|
||||
(list[i].right)+1,
|
||||
list[i].top,
|
||||
(list[i].bottom-list[i].top)+1,
|
||||
0
|
||||
);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
void FILL_SPAN(engine_token *et, uint32 colorIndex, uint16 *list, uint32 count) {
|
||||
int i;
|
||||
|
||||
/*draw each span*/
|
||||
i=0;
|
||||
while (count--)
|
||||
{
|
||||
gx00_acc_rectangle
|
||||
(
|
||||
list[i+1],
|
||||
list[i+2]+1,
|
||||
list[i],
|
||||
1,
|
||||
colorIndex
|
||||
);
|
||||
i+=3;
|
||||
}
|
||||
}
|
||||
/* file nolonger needed */
|
||||
|
|
|
@ -45,9 +45,6 @@ void WAIT_ENGINE_IDLE(void);
|
|||
status_t GET_SYNC_TOKEN(engine_token *et, sync_token *st);
|
||||
status_t SYNC_TO_TOKEN(sync_token *st);
|
||||
|
||||
void INVERT_RECTANGLE(engine_token *et, fill_rect_params *list, uint32 count);
|
||||
void FILL_SPAN(engine_token *et, uint32 color, uint16 *list, uint32 count);
|
||||
|
||||
/* video_overlay */
|
||||
uint32 OVERLAY_COUNT(const display_mode *dm);
|
||||
const uint32 *OVERLAY_SUPPORTED_SPACES(const display_mode *dm);
|
||||
|
|
|
@ -389,7 +389,7 @@ void FILL_RECTANGLE(engine_token *et, uint32 colorIndex, fill_rect_params *list,
|
|||
//acc fixme: checkout blockmode constraints for G100+ (mil: nc?): also add blockmode
|
||||
// for other functions, and use fastblt on MIL1/2 if possible...
|
||||
//or is CMAP8 contraint a non-blockmode contraint? (linearisation problem maybe?)
|
||||
if (si->dm.space==B_CMAP8 || si->ps.sdram)
|
||||
if ((si->dm.space == B_CMAP8) || si->ps.sdram)
|
||||
{
|
||||
ACCGO(DWGCTL, 0x400c7814); // atype RSTR
|
||||
}
|
||||
|
@ -401,10 +401,10 @@ void FILL_RECTANGLE(engine_token *et, uint32 colorIndex, fill_rect_params *list,
|
|||
}
|
||||
}
|
||||
|
||||
/* rectangle fill.
|
||||
/* horizontal span fill.
|
||||
* Engine function rectangle_fill: paragraph 4.5.5.2 */
|
||||
/*colorIndex,fill_rect_params,count*/
|
||||
status_t gx00_acc_rectangle(uint32 xs,uint32 xe,uint32 ys,uint32 yl,uint32 col)
|
||||
//(uint32 xs,uint32 xe,uint32 ys,uint32 yl,uint32 col)
|
||||
void FILL_SPAN(engine_token *et, uint32 colorIndex, uint16 *list, uint32 count)
|
||||
{
|
||||
/*
|
||||
FXBNDRY - left and right coordinates a
|
||||
|
@ -413,33 +413,34 @@ status_t gx00_acc_rectangle(uint32 xs,uint32 xe,uint32 ys,uint32 yl,uint32 col)
|
|||
DWGCTL - atype must be RSTR or BLK a
|
||||
FCOL - foreground colour a
|
||||
*/
|
||||
int i = 0;
|
||||
|
||||
ACCW(FXBNDRY,(xe<<16)|xs); /*set x start and end*/
|
||||
ACCW_YDSTLEN(ys,yl); /*set y start and length*/
|
||||
ACCW(FCOL,col); /*set colour*/
|
||||
while (count--)
|
||||
{
|
||||
ACCW(FXBNDRY, ((list[i + 2] + 1) << 16)| list[i + 1]);
|
||||
ACCW_YDSTLEN(list[i], 1);
|
||||
ACCW(FCOL, colorIndex);
|
||||
|
||||
/* start the fill */
|
||||
//acc fixme: checkout blockmode constraints for G100+ (mil: nc?): also add blockmode
|
||||
// for other functions, and use fastblt on MIL1/2 if possible...
|
||||
//or is CMAP8 contraint a non-blockmode contraint? (linearisation problem maybe?)
|
||||
if (si->dm.space==B_CMAP8 || si->ps.sdram)
|
||||
{
|
||||
ACCGO(DWGCTL,0x400C7814); // atype RSTR
|
||||
if ((si->dm.space == B_CMAP8) || si->ps.sdram)
|
||||
{
|
||||
ACCGO(DWGCTL, 0x400c7814); // atype RSTR
|
||||
}
|
||||
else
|
||||
{
|
||||
ACCGO(DWGCTL, 0x400c7844); // atype BLK
|
||||
}
|
||||
i += 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
ACCGO(DWGCTL,0x400C7844); // atype BLK
|
||||
}
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
/* rectangle invert.
|
||||
* Engine function rectangle_fill: paragraph 4.5.5.2 */
|
||||
/*colorIndex,fill_rect_params,count*/
|
||||
status_t gx00_acc_rectangle_invert(uint32 xs,uint32 xe,uint32 ys,uint32 yl,uint32 col)
|
||||
void INVERT_RECTANGLE(engine_token *et, fill_rect_params *list, uint32 count)
|
||||
{
|
||||
// int i;
|
||||
// uint32 * dma;
|
||||
// uint32 pci;
|
||||
/*
|
||||
FXBNDRY - left and right coordinates a
|
||||
YDSTLEN - y start and no of lines a
|
||||
|
@ -447,42 +448,48 @@ status_t gx00_acc_rectangle_invert(uint32 xs,uint32 xe,uint32 ys,uint32 yl,uint3
|
|||
DWGCTL - atype must be RSTR or BLK a
|
||||
FCOL - foreground colour a
|
||||
*/
|
||||
int i = 0;
|
||||
// uint32 * dma;
|
||||
// uint32 pci;
|
||||
|
||||
ACCW(FXBNDRY,(xe<<16)|xs); /*set x start and end*/
|
||||
ACCW_YDSTLEN(ys,yl); /*set y start and length*/
|
||||
ACCW(FCOL,col); /*set colour*/
|
||||
|
||||
/*draw it! top nibble is c is clipping enabled*/
|
||||
ACCGO(DWGCTL,0x40057814); // atype RSTR
|
||||
while (count--)
|
||||
{
|
||||
ACCW(FXBNDRY, (((list[i].right) + 1) << 16) | list[i].left);
|
||||
ACCW_YDSTLEN(list[i].top, ((list[i].bottom - list[i].top) + 1));
|
||||
ACCW(FCOL, 0); /* color */
|
||||
|
||||
/*pseudo_dma version!*/
|
||||
//MGAACC_DWGCTL =0x1C00,
|
||||
//MGAACC_FCOL =0x1C24,
|
||||
//MGAACC_FXBNDRY =0x1C84,
|
||||
//MGAACC_YDSTLEN =0x1C88,
|
||||
/* start the invert (top nibble is c is clipping enabled) */
|
||||
ACCGO(DWGCTL, 0x40057814); // atype RSTR
|
||||
|
||||
/* pseudo_dma version! */
|
||||
// MGAACC_DWGCTL =0x1c00,
|
||||
// MGAACC_FCOL =0x1c24,
|
||||
// MGAACC_FXBNDRY =0x1c84,
|
||||
// MGAACC_YDSTLEN =0x1c88,
|
||||
//
|
||||
//40,09,21,22 (ordered as registers)
|
||||
// 40,09,21,22 (ordered as registers)
|
||||
|
||||
// dma = (uint32 *)si->pseudo_dma;
|
||||
// *dma++=0x40092221;
|
||||
// *dma++=(xe<<16)|xs;
|
||||
// *dma++=(ys<<16)|yl;
|
||||
// *dma++=col;
|
||||
// *dma++=0x40057814;
|
||||
// dma = (uint32 *)si->pseudo_dma;
|
||||
// *dma++= 0x40092221;
|
||||
// *dma++= (((list[i].right) + 1) << 16) | list[i].left;
|
||||
// *dma++= (list[i].top << 16) | ((list[i].bottom - list[i].top) + 1);
|
||||
// *dma++= 0; /* color */
|
||||
// *dma++= 0x40057814;
|
||||
|
||||
/*real dma version!*/
|
||||
// dma = (vuint32 *)si->dma_buffer;
|
||||
// *dma++=0x40092221;/*indices*/
|
||||
// *dma++=(xe<<16)|xs;
|
||||
// *dma++=(ys<<16)|yl;
|
||||
// *dma++=col;
|
||||
// *dma++=0x40057814;
|
||||
/* real dma version! */
|
||||
// dma = (vuint32 *)si->dma_buffer;
|
||||
// *dma++= 0x40092221; /* indices */
|
||||
// *dma++= (((list[i].right) + 1) << 16) | list[i].left;
|
||||
// *dma++= (list[i].top << 16) | ((list[i].bottom - list[i].top) + 1);
|
||||
// *dma++= 0; /* color */
|
||||
// *dma++= 0x40057814;
|
||||
|
||||
// pci = si->dma_buffer_pci;
|
||||
// ACCW(PRIMADDRESS,(pci));
|
||||
// ACCW(PRIMEND,(20+pci));
|
||||
// pci = si->dma_buffer_pci;
|
||||
// ACCW(PRIMADDRESS, (pci));
|
||||
// ACCW(PRIMEND, (20 + pci));
|
||||
|
||||
// delay(100);
|
||||
// delay(100);
|
||||
|
||||
return B_OK;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -111,8 +111,8 @@ void SCREEN_TO_SCREEN_BLIT(engine_token *et, blit_params *list, uint32 count);
|
|||
void SCREEN_TO_SCREEN_TRANSPARENT_BLIT(engine_token *et, uint32 transparent_colour, blit_params *list, uint32 count);
|
||||
void SCREEN_TO_SCREEN_SCALED_FILTERED_BLIT(engine_token *et, scaled_blit_params *list, uint32 count);
|
||||
void FILL_RECTANGLE(engine_token *et, uint32 color, fill_rect_params *list, uint32 count);
|
||||
status_t gx00_acc_rectangle(uint32 xs,uint32 xe,uint32 ys,uint32 yl,uint32 col);
|
||||
status_t gx00_acc_rectangle_invert(uint32 xs,uint32 xe,uint32 ys,uint32 yl,uint32 col);
|
||||
void FILL_SPAN(engine_token *et, uint32 color, uint16 *list, uint32 count);
|
||||
void INVERT_RECTANGLE(engine_token *et, fill_rect_params *list, uint32 count);
|
||||
|
||||
/*backend scaler functions*/
|
||||
status_t check_overlay_capability(uint32 feature);
|
||||
|
|
Loading…
Reference in New Issue