rem: * (confirmed on NV11 and NV43 with less than 64 words forced freespace.)
add: * (confirmed on NV11 and NV43 with less than 128 words forced freespace.)
context: static status_t nv_acc_fifofree_dma(uint16 cmd_size){	uint32 dmaget;	/* we'd better check for timeouts on the DMA engine as it's theoretically	 * breakable by malfunctioning software */	uint16 cnt = 0;	/* check if the DMA buffer has enough room for the command.	 * note:	 * engine.dma.free is 'cached' */	while ((si->engine.dma.free < cmd_size) && (cnt < 10000) && (err < 3))	{		/* see where the engine is currently fetching from the buffer */		/* note:		 * read this only once in the code as accessing registers is relatively slow */		dmaget = ((NV_REG32(NVACC_FIFO + NV_GENERAL_DMAGET +			si->engine.fifo.handle[(si->engine.fifo.ch_ptr[NV_ROP5_SOLID])])) >> 2);		/* update timeout counter: on NV11 on a Pentium4 2.8Ghz max reached count		 * using BeRoMeter 1.2.6 was about 600; so counting 10000 before generating		 * a timeout should definately do it. Snooze()-ing cannot be done without a		 * serious speed penalty, even if done for only 1 microSecond. */		cnt++;		/* where's the engine fetching viewed from us issuing? */		if (si->engine.dma.put >= dmaget)		{			/* engine is fetching 'behind us', the last piece of the buffer is free */			/* note the 'updated' free space we have in the DMA buffer */			si->engine.dma.free = si->engine.dma.max - si->engine.dma.current;			/* if it's enough after all we exit this routine immediately. Else: */			if (si->engine.dma.free < cmd_size)			{				/* not enough room left, so instruct DMA engine to reset the buffer				 * when it's reaching the end of it */				si->engine.dma.cmdbuffer[si->engine.dma.current++] = 0x20000000;				/* reset our buffer pointer, so new commands will be placed at the				 * beginning of the buffer. */				si->engine.dma.current = 0;				/* tell the engine to fetch the remaining command(s) in the DMA buffer				 * that where not executed before. */				nv_start_dma();				/* NOW the engine is fetching 'in front of us', so the first piece				 * of the buffer is free */				/* note the updated current free space we have in the DMA buffer */				si->engine.dma.free = dmaget - si->engine.dma.current;				/* mind this pittfall:				 * Leave some room between where the engine is fetching and where we				 * put new commands. Otherwise the engine will crash on heavy loads.				 * A crash can be forced best in 640x480 resolution with BeRoMeter 1.2.6.				 * (confirmed on NV11 and NV43 with less than 64 words forced freespace.)				 * Note:				 * The engine is DMA triggered for fetching chunks every 128 bytes,				 * maybe this is the reason for this behaviour.				 * Note also:				 * it looks like the space that needs to be kept free is coupled				 * with the size of the DMA buffer. */				if (si->engine.dma.free < 64)					si->engine.dma.free = 0;				else					si->engine.dma.free -= 64;			}		}		else		{			/* engine is fetching 'in front of us', so the first piece of the buffer			 * is free */			/* note the updated current free space we have in the DMA buffer */			si->engine.dma.free = dmaget - si->engine.dma.current;			/* mind this pittfall:			 * Leave some room between where the engine is fetching and where we			 * put new commands. Otherwise the engine will crash on heavy loads.			 * A crash can be forced best in 640x480 resolution with BeRoMeter 1.2.6.			 * (confirmed on NV11 and NV43 with less than 64 words forced freespace.)			 * Note:			 * The engine is DMA triggered for fetching chunks every 128 bytes,			 * maybe this is the reason for this behaviour.			 * Note also:			 * it looks like the space that needs to be kept free is coupled			 * with the size of the DMA buffer. */			if (si->engine.dma.free < 64)				si->engine.dma.free = 0;			else				si->engine.dma.free -= 64;		}	}	/* log timeout if we had one */	if (cnt == 10000)	{		if (err < 3) err++;		LOG(4,("ACC_DMA: fifofree; DMA timeout #%d, engine trouble!\n", err));	}	/* we must make the acceleration routines abort or the driver will hang! */	if (err >= 3) return B_ERROR;	return B_OK;}