added/modified shared_info to (better) support upto 32 3D accelants. Needs to be improved/expanded later though. Bumped version to 0.53.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13210 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Rudolf Cornelissen 2005-06-19 15:10:49 +00:00
parent 9658f6abba
commit 21545d001f
4 changed files with 28 additions and 25 deletions

View File

@ -163,8 +163,8 @@ status_t INIT_ACCELERANT(int the_fd) {
si->engine.last_idle = si->engine.count = 0; si->engine.last_idle = si->engine.count = 0;
/* no 3D clones are currently loaded */ /* no 3D clones are currently loaded */
si->engine.threeD.clones = 0; si->engine.threeD.clones = 0;
/* tell all 3D add-ons that they should reload their rendering states */ /* tell 3D add-ons that they should reload their rendering states and surfaces */
si->engine.threeD.reload_state_3D = 0xffffffff; si->engine.threeD.reload = 0xffffffff;
INIT_BEN(si->engine.lock); INIT_BEN(si->engine.lock);
INIT_BEN(si->overlay.lock); INIT_BEN(si->overlay.lock);
@ -195,9 +195,9 @@ status_t INIT_ACCELERANT(int the_fd) {
/* make sure a possible 3D add-on will block rendering and re-initialize itself. /* make sure a possible 3D add-on will block rendering and re-initialize itself.
* note: update in _this_ order only */ * note: update in _this_ order only */
/* SET_DISPLAY_MODE will reset this flag when it's done. */ /* SET_DISPLAY_MODE will reset this flag when it's done. */
si->mode_changing = true; si->engine.threeD.mode_changing = true;
/* the 3D add-on will reset this flag when it's done. */ /* every 3D add-on will reset this bit-flag when it's done. */
si->mode_changed = true; si->engine.threeD.newmode = 0xffffffff;
/* a winner! */ /* a winner! */
result = B_OK; result = B_OK;

View File

@ -6,7 +6,7 @@
Other authors: Other authors:
Mark Watson, Mark Watson,
Apsed, Apsed,
Rudolf Cornelissen 11/2002-5/2005 Rudolf Cornelissen 11/2002-6/2005
*/ */
#define MODULE_BIT 0x00200000 #define MODULE_BIT 0x00200000
@ -80,9 +80,12 @@ status_t SET_DISPLAY_MODE(display_mode *mode_to_set)
/* make sure a possible 3D add-on will block rendering and re-initialize itself. /* make sure a possible 3D add-on will block rendering and re-initialize itself.
* note: update in _this_ order only */ * note: update in _this_ order only */
/* SET_DISPLAY_MODE will reset this flag when it's done. */ /* SET_DISPLAY_MODE will reset this flag when it's done. */
si->mode_changing = true; si->engine.threeD.mode_changing = true;
/* the 3D add-on will reset this flag when it's done. */ /* every 3D add-on will reset this bit-flag when it's done. */
si->mode_changed = true; si->engine.threeD.newmode = 0xffffffff;
/* every 3D clone needs to reclaim a slot.
* note: this also cleans up reserved channels for killed 3D clones.. */
si->engine.threeD.clones = 0x00000000;
/* disable interrupts using the kernel driver */ /* disable interrupts using the kernel driver */
interrupt_enable(false); interrupt_enable(false);
@ -332,13 +335,13 @@ status_t SET_DISPLAY_MODE(display_mode *mode_to_set)
/* note freemem range */ /* note freemem range */
/* first free adress follows hardcursor and workspace */ /* first free adress follows hardcursor and workspace */
si->mem_low = si->fbc.bytes_per_row * si->dm.virtual_height; si->engine.threeD.mem_low = si->fbc.bytes_per_row * si->dm.virtual_height;
if (si->settings.hardcursor) si->mem_low += 2048; if (si->settings.hardcursor) si->engine.threeD.mem_low += 2048;
/* last free adress is end-of-ram minus max space needed for overlay bitmaps */ /* last free adress is end-of-ram minus max space needed for overlay bitmaps */
//fixme possible: //fixme possible:
//if overlay buffers are allocated subtract buffersize from mem_high; //if overlay buffers are allocated subtract buffersize from mem_high;
//only allocate overlay buffers if 3D is not in use. (block overlay during 3D) //only allocate overlay buffers if 3D is not in use. (block overlay during 3D)
si->mem_high = si->ps.memory_size - 1; si->engine.threeD.mem_high = si->ps.memory_size - 1;
/* don't touch the DMA acceleration engine command buffer if it exists */ /* don't touch the DMA acceleration engine command buffer if it exists */
/* note: /* note:
* the buffer is 32kB in size. Keep some extra distance for safety (faulty apps). */ * the buffer is 32kB in size. Keep some extra distance for safety (faulty apps). */
@ -347,7 +350,7 @@ status_t SET_DISPLAY_MODE(display_mode *mode_to_set)
if (si->ps.card_arch < NV40A) if (si->ps.card_arch < NV40A)
{ {
/* keeping 32kB distance from the DMA buffer */ /* keeping 32kB distance from the DMA buffer */
si->mem_high -= (64 * 1024); si->engine.threeD.mem_high -= (64 * 1024);
} }
else else
{ {
@ -357,10 +360,10 @@ status_t SET_DISPLAY_MODE(display_mode *mode_to_set)
* if you get too close to the DMA command buffer on NV40 and NV43 at * if you get too close to the DMA command buffer on NV40 and NV43 at
* least (both confirmed), the source DMA instance will mess-up for * least (both confirmed), the source DMA instance will mess-up for
* at least engine cmd NV_IMAGE_BLIT and NV12_IMAGE_BLIT. */ * at least engine cmd NV_IMAGE_BLIT and NV12_IMAGE_BLIT. */
si->mem_high -= (512 * 1024); si->engine.threeD.mem_high -= (512 * 1024);
} }
} }
si->mem_high -= (MAXBUFFERS * 1024 * 1024 * 2); /* see overlay.c file */ si->engine.threeD.mem_high -= (MAXBUFFERS * 1024 * 1024 * 2); /* see overlay.c file */
LOG(1,("SETMODE: booted since %f mS\n", system_time()/1000.0)); LOG(1,("SETMODE: booted since %f mS\n", system_time()/1000.0));
@ -368,7 +371,7 @@ status_t SET_DISPLAY_MODE(display_mode *mode_to_set)
interrupt_enable(true); interrupt_enable(true);
/* make sure a possible 3D add-on will re-initialize itself by signalling ready */ /* make sure a possible 3D add-on will re-initialize itself by signalling ready */
si->mode_changing = false; si->engine.threeD.mode_changing = false;
/* optimize memory-access if needed */ /* optimize memory-access if needed */
// head1_mem_priority(colour_depth1); // head1_mem_priority(colour_depth1);

View File

@ -1623,8 +1623,8 @@ void SCREEN_TO_SCREEN_BLIT_DMA(engine_token *et, blit_params *list, uint32 count
nv_start_dma(); nv_start_dma();
} }
/* tell all 3D add-ons that they should reload their rendering states */ /* tell 3D add-ons that they should reload their rendering states and surfaces */
si->engine.threeD.reload_state_3D = 0xffffffff; si->engine.threeD.reload = 0xffffffff;
} }
/* rectangle fill - i.e. workspace and window background color */ /* rectangle fill - i.e. workspace and window background color */
@ -1675,8 +1675,8 @@ void FILL_RECTANGLE_DMA(engine_token *et, uint32 colorIndex, fill_rect_params *l
nv_start_dma(); nv_start_dma();
} }
/* tell all 3D add-ons that they should reload their rendering states */ /* tell 3D add-ons that they should reload their rendering states and surfaces */
si->engine.threeD.reload_state_3D = 0xffffffff; si->engine.threeD.reload = 0xffffffff;
} }
/* span fill - i.e. (selected) menuitem background color (Dano) */ /* span fill - i.e. (selected) menuitem background color (Dano) */
@ -1726,8 +1726,8 @@ void FILL_SPAN_DMA(engine_token *et, uint32 colorIndex, uint16 *list, uint32 cou
nv_start_dma(); nv_start_dma();
} }
/* tell all 3D add-ons that they should reload their rendering states */ /* tell 3D add-ons that they should reload their rendering states and surfaces */
si->engine.threeD.reload_state_3D = 0xffffffff; si->engine.threeD.reload = 0xffffffff;
} }
/* rectangle invert - i.e. text cursor and text selection */ /* rectangle invert - i.e. text cursor and text selection */
@ -1778,6 +1778,6 @@ void INVERT_RECTANGLE_DMA(engine_token *et, fill_rect_params *list, uint32 count
nv_start_dma(); nv_start_dma();
} }
/* tell all 3D add-ons that they should reload their rendering states */ /* tell 3D add-ons that they should reload their rendering states and surfaces */
si->engine.threeD.reload_state_3D = 0xffffffff; si->engine.threeD.reload = 0xffffffff;
} }

View File

@ -90,7 +90,7 @@ status_t nv_general_powerup()
{ {
status_t status; status_t status;
LOG(1,("POWERUP: Haiku nVidia Accelerant 0.52 running.\n")); LOG(1,("POWERUP: Haiku nVidia Accelerant 0.53 running.\n"));
/* preset no laptop */ /* preset no laptop */
si->ps.laptop = false; si->ps.laptop = false;