From 19fb0957a258053c18e661a85b84a7ac07c6fe5e Mon Sep 17 00:00:00 2001 From: Rudolf Cornelissen Date: Tue, 24 Jan 2006 11:56:36 +0000 Subject: [PATCH] moved acc function FILL_RECTANGLE into engine directly. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16059 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/accelerants/matrox/Acceleration.c | 19 ---------- .../accelerants/matrox/be_driver_proto.h | 1 - .../accelerants/matrox/engine/mga_acc.c | 35 +++++++++++++++++++ .../accelerants/matrox/engine/mga_proto.h | 6 ++-- 4 files changed, 37 insertions(+), 24 deletions(-) diff --git a/src/add-ons/accelerants/matrox/Acceleration.c b/src/add-ons/accelerants/matrox/Acceleration.c index a44af4941b..30db4bf305 100644 --- a/src/add-ons/accelerants/matrox/Acceleration.c +++ b/src/add-ons/accelerants/matrox/Acceleration.c @@ -12,25 +12,6 @@ #include "acc_std.h" -void FILL_RECTANGLE(engine_token *et, uint32 colorIndex, fill_rect_params *list, uint32 count) { - int i; - - /*draw each rectangle*/ - i=0; - while (count--) - { - gx00_acc_rectangle - ( - list[i].left, - (list[i].right)+1, - list[i].top, - (list[i].bottom-list[i].top)+1, - colorIndex - ); - i++; - } -} - void INVERT_RECTANGLE(engine_token *et, fill_rect_params *list, uint32 count) { int i; diff --git a/src/add-ons/accelerants/matrox/be_driver_proto.h b/src/add-ons/accelerants/matrox/be_driver_proto.h index 65dc462343..e28205a3dc 100644 --- a/src/add-ons/accelerants/matrox/be_driver_proto.h +++ b/src/add-ons/accelerants/matrox/be_driver_proto.h @@ -45,7 +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 FILL_RECTANGLE(engine_token *et, uint32 color, fill_rect_params *list, uint32 count); void INVERT_RECTANGLE(engine_token *et, fill_rect_params *list, uint32 count); void FILL_SPAN(engine_token *et, uint32 color, uint16 *list, uint32 count); diff --git a/src/add-ons/accelerants/matrox/engine/mga_acc.c b/src/add-ons/accelerants/matrox/engine/mga_acc.c index 14c90966c1..1a432101c4 100644 --- a/src/add-ons/accelerants/matrox/engine/mga_acc.c +++ b/src/add-ons/accelerants/matrox/engine/mga_acc.c @@ -366,6 +366,41 @@ void SCREEN_TO_SCREEN_SCALED_FILTERED_BLIT(engine_token *et, scaled_blit_params } } +/* rectangle fill. + * Engine function rectangle_fill: paragraph 4.5.5.2 */ +void FILL_RECTANGLE(engine_token *et, uint32 colorIndex, fill_rect_params *list, uint32 count) +{ +/* + FXBNDRY - left and right coordinates a + YDSTLEN - y start and no of lines a + (or YDST and LEN) + DWGCTL - atype must be RSTR or BLK a + FCOL - foreground colour a +*/ + int i = 0; + + 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, 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 + } + else + { + ACCGO(DWGCTL, 0x400c7844); // atype BLK + } + i++; + } +} + /* rectangle fill. * Engine function rectangle_fill: paragraph 4.5.5.2 */ /*colorIndex,fill_rect_params,count*/ diff --git a/src/add-ons/accelerants/matrox/engine/mga_proto.h b/src/add-ons/accelerants/matrox/engine/mga_proto.h index c3e4957ac5..5fbd84993a 100644 --- a/src/add-ons/accelerants/matrox/engine/mga_proto.h +++ b/src/add-ons/accelerants/matrox/engine/mga_proto.h @@ -105,16 +105,14 @@ status_t g400_crtc2_dpms(bool display, bool h, bool v); /*acceleration functions*/ status_t check_acc_capability(uint32 feature); +status_t gx00_acc_wait_idle(void); status_t gx00_acc_init(void); 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); -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, - uint16 xd,uint16 yd,uint16 wd,uint16 hd); -status_t gx00_acc_wait_idle(void); /*backend scaler functions*/ status_t check_overlay_capability(uint32 feature);