moving acc function hooks from high-level driver files to engine directly: this will improve acc speed by some 15% when finished (in progress). It's too costly to do 'unneeded' calls here. SCREEN_TO_SRCEEN_BLIT done.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16039 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
Other authors:
|
Other authors:
|
||||||
Mark Watson,
|
Mark Watson,
|
||||||
Apsed,
|
Apsed,
|
||||||
Rudolf Cornelissen 2/2003.
|
Rudolf Cornelissen 1/2006.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define MODULE_BIT 0x40000000
|
#define MODULE_BIT 0x40000000
|
||||||
@@ -14,26 +14,6 @@
|
|||||||
|
|
||||||
#include "acc_std.h"
|
#include "acc_std.h"
|
||||||
|
|
||||||
void SCREEN_TO_SCREEN_BLIT(engine_token *et, blit_params *list, uint32 count) {
|
|
||||||
int i;
|
|
||||||
|
|
||||||
/*do each blit*/
|
|
||||||
i=0;
|
|
||||||
while (count--)
|
|
||||||
{
|
|
||||||
gx00_acc_blit
|
|
||||||
(
|
|
||||||
list[i].src_left,
|
|
||||||
list[i].src_top,
|
|
||||||
list[i].dest_left,
|
|
||||||
list[i].dest_top,
|
|
||||||
list[i].width,
|
|
||||||
list[i].height
|
|
||||||
);
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void SCREEN_TO_SCREEN_SCALED_FILTERED_BLIT(engine_token *et, scaled_blit_params *list, uint32 count) {
|
void SCREEN_TO_SCREEN_SCALED_FILTERED_BLIT(engine_token *et, scaled_blit_params *list, uint32 count) {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ void WAIT_ENGINE_IDLE(void);
|
|||||||
status_t GET_SYNC_TOKEN(engine_token *et, sync_token *st);
|
status_t GET_SYNC_TOKEN(engine_token *et, sync_token *st);
|
||||||
status_t SYNC_TO_TOKEN(sync_token *st);
|
status_t SYNC_TO_TOKEN(sync_token *st);
|
||||||
|
|
||||||
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_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 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);
|
void FILL_RECTANGLE(engine_token *et, uint32 color, fill_rect_params *list, uint32 count);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/* MGA Acceleration functions */
|
/* MGA Acceleration functions */
|
||||||
/* Authors:
|
/* Authors:
|
||||||
Mark Watson 2/2000,
|
Mark Watson 2/2000,
|
||||||
Rudolf Cornelissen 10/2002-1/2004.
|
Rudolf Cornelissen 10/2002-1/2006.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define MODULE_BIT 0x00080000
|
#define MODULE_BIT 0x00080000
|
||||||
@@ -201,71 +201,75 @@ status_t gx00_acc_init()
|
|||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
note:
|
||||||
|
moved acceleration 'top-level' routines to be integrated in the engine:
|
||||||
|
it is costly to call the engine for every single function within a loop!
|
||||||
|
(measured with BeRoMeter 1.2.6: upto 15% speed increase on all CPU's.)
|
||||||
|
*/
|
||||||
|
|
||||||
/* screen to screen blit - i.e. move windows around.
|
/* screen to screen blit - i.e. move windows around.
|
||||||
* Engine function bitblit, paragraph 4.5.7.2 */
|
* Engine function bitblit, paragraph 4.5.7.2 */
|
||||||
status_t gx00_acc_blit(uint16 xs,uint16 ys,uint16 xd,uint16 yd,uint16 w,uint16 h)
|
void SCREEN_TO_SCREEN_BLIT(engine_token *et, blit_params *list, uint32 count)
|
||||||
{
|
{
|
||||||
uint32 t_start,t_end,offset;
|
uint32 t_start,t_end,offset;
|
||||||
uint32 b_start,b_end;
|
uint32 b_start,b_end;
|
||||||
|
int i = 0;
|
||||||
|
|
||||||
/*find where the top,bottom and offset are*/
|
/* calc offset 'per line' */
|
||||||
offset = (si->fbc.bytes_per_row / (si->engine.depth >> 3));
|
offset = (si->fbc.bytes_per_row / (si->engine.depth >> 3));
|
||||||
|
|
||||||
t_end = t_start = xs + (offset*ys) + si->engine.src_dst;
|
while (count--)
|
||||||
t_end += w;
|
{
|
||||||
|
/* find where the top and bottom are */
|
||||||
|
t_end = t_start = list[i].src_left + (offset * list[i].src_top) + si->engine.src_dst;
|
||||||
|
t_end += list[i].width;
|
||||||
|
|
||||||
b_end = b_start = xs + (offset*(ys+h)) + si->engine.src_dst;
|
b_end = b_start = list[i].src_left + (offset * (list[i].src_top + list[i].height)) + si->engine.src_dst;
|
||||||
b_end +=w;
|
b_end += list[i].width;
|
||||||
|
|
||||||
/* sgnzero bit _must_ be '0' before accessing SGN! */
|
/* sgnzero bit _must_ be '0' before accessing SGN! */
|
||||||
ACCW(DWGCTL,0x00000000);
|
ACCW(DWGCTL,0x00000000);
|
||||||
|
|
||||||
/*find which quadrant */
|
/*find which quadrant */
|
||||||
switch((yd>ys)|((xd>xs)<<1))
|
switch((list[i].dest_top > list[i].src_top) | ((list[i].dest_left > list[i].src_left) << 1))
|
||||||
{
|
{
|
||||||
case 0: /*L->R,down*/
|
case 0: /*L->R,down*/
|
||||||
ACCW(SGN, 0);
|
ACCW(SGN, 0);
|
||||||
|
|
||||||
ACCW(AR3, t_start);
|
ACCW(AR3, t_start);
|
||||||
ACCW(AR0, t_end);
|
ACCW(AR0, t_end);
|
||||||
ACCW(AR5, offset);
|
ACCW(AR5, offset);
|
||||||
|
ACCW_YDSTLEN(list[i].dest_top, list[i].height + 1);
|
||||||
ACCW_YDSTLEN(yd,h+1);
|
|
||||||
break;
|
break;
|
||||||
case 1: /*L->R,up*/
|
case 1: /*L->R,up*/
|
||||||
ACCW(SGN, 4);
|
ACCW(SGN, 4);
|
||||||
|
|
||||||
ACCW(AR3, b_start);
|
ACCW(AR3, b_start);
|
||||||
ACCW(AR0, b_end);
|
ACCW(AR0, b_end);
|
||||||
ACCW(AR5, -offset);
|
ACCW(AR5, -offset);
|
||||||
|
ACCW_YDSTLEN(list[i].dest_top + list[i].height, list[i].height + 1);
|
||||||
ACCW_YDSTLEN(yd+h,h+1);
|
|
||||||
break;
|
break;
|
||||||
case 2: /*R->L,down*/
|
case 2: /*R->L,down*/
|
||||||
ACCW(SGN, 1);
|
ACCW(SGN, 1);
|
||||||
|
|
||||||
ACCW(AR3, t_end);
|
ACCW(AR3, t_end);
|
||||||
ACCW(AR0, t_start);
|
ACCW(AR0, t_start);
|
||||||
ACCW(AR5, offset);
|
ACCW(AR5, offset);
|
||||||
|
ACCW_YDSTLEN(list[i].dest_top, list[i].height + 1);
|
||||||
ACCW_YDSTLEN(yd,h+1);
|
|
||||||
break;
|
break;
|
||||||
case 3: /*R->L,up*/
|
case 3: /*R->L,up*/
|
||||||
ACCW(SGN, 5);
|
ACCW(SGN, 5);
|
||||||
|
|
||||||
ACCW(AR3, b_end);
|
ACCW(AR3, b_end);
|
||||||
ACCW(AR0, b_start);
|
ACCW(AR0, b_start);
|
||||||
ACCW(AR5, -offset);
|
ACCW(AR5, -offset);
|
||||||
|
ACCW_YDSTLEN(list[i].dest_top + list[i].height, list[i].height + 1);
|
||||||
ACCW_YDSTLEN(yd+h,h+1);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ACCW(FXBNDRY,((xd+w)<<16)|xd);
|
ACCW(FXBNDRY,((list[i].dest_left + list[i].width) << 16) | list[i].dest_left);
|
||||||
|
|
||||||
/*do the blit*/
|
/* start the blit */
|
||||||
ACCGO(DWGCTL,0x040C4018); // atype RSTR
|
ACCGO(DWGCTL,0x040C4018); // atype RSTR
|
||||||
|
i++;
|
||||||
return B_OK;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* screen to screen tranparent blit - not sure what uses this.
|
/* screen to screen tranparent blit - not sure what uses this.
|
||||||
|
|||||||
@@ -106,9 +106,9 @@ status_t g400_crtc2_dpms(bool display, bool h, bool v);
|
|||||||
/*acceleration functions*/
|
/*acceleration functions*/
|
||||||
status_t check_acc_capability(uint32 feature);
|
status_t check_acc_capability(uint32 feature);
|
||||||
status_t gx00_acc_init(void);
|
status_t gx00_acc_init(void);
|
||||||
|
void SCREEN_TO_SCREEN_BLIT(engine_token *et, blit_params *list, uint32 count);
|
||||||
status_t gx00_acc_rectangle(uint32 xs,uint32 xe,uint32 ys,uint32 yl,uint32 col);
|
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);
|
status_t gx00_acc_rectangle_invert(uint32 xs,uint32 xe,uint32 ys,uint32 yl,uint32 col);
|
||||||
status_t gx00_acc_blit(uint16,uint16,uint16, uint16,uint16,uint16 );
|
|
||||||
status_t gx00_acc_transparent_blit(uint16,uint16,uint16, uint16,uint16,uint16, uint32);
|
status_t gx00_acc_transparent_blit(uint16,uint16,uint16, uint16,uint16,uint16, uint32);
|
||||||
status_t gx00_acc_video_blit(uint16 xs,uint16 ys,uint16 ws, uint16 hs,
|
status_t gx00_acc_video_blit(uint16 xs,uint16 ys,uint16 ws, uint16 hs,
|
||||||
uint16 xd,uint16 yd,uint16 wd,uint16 hd);
|
uint16 xd,uint16 yd,uint16 wd,uint16 hd);
|
||||||
|
|||||||
Reference in New Issue
Block a user