fixed DMA acc blit function crashing once you place data near the end of the cardRAM on NV40 and higher (for overlay bitmaps). These cards needs a certain unused space in front of their DMA command buffer to prevent the blit's DMA data source instance from malfunctioning (moved windows then contain rubbish instead of valid data). I would say this is a hardware fault or limitation (costs us 400kB+ of RAM).

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11182 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Rudolf Cornelissen
2005-02-01 15:05:57 +00:00
parent 422c07914d
commit fdd699c7b7
4 changed files with 83 additions and 12 deletions
+39 -5
View File
@@ -1,4 +1,4 @@
/* Written by Rudolf Cornelissen 05/2002-1/2005 */
/* Written by Rudolf Cornelissen 05/2002-2/2005 */
/* Note on 'missing features' in BeOS 5.0.3 and DANO:
* BeOS needs to define more colorspaces! It would be nice if BeOS would support the FourCC 'definitions'
@@ -207,8 +207,25 @@ const overlay_buffer *ALLOCATE_OVERLAY_BUFFER(color_space cs, uint16 width, uint
adress = (((uint32)((uint8*)si->framebuffer)) + si->ps.memory_size);
/* don't touch the DMA acceleration engine command buffer if it exists */
/* note:
* the buffer is 32kB in size. Keep a distance of another 32kB for safety. */
if (si->settings.dma_acc) adress -= (64 * 1024);
* the buffer is 32kB in size. Keep some extra distance for safety (faulty apps). */
if (si->settings.dma_acc)
{
if (si->ps.card_arch < NV40A)
{
/* keeping 32kB distance from the DMA buffer */
adress -= (64 * 1024);
}
else
{
/* 416kB distance is just OK: keeping another 64kB distance for safety;
* confirmed for NV43. */
/* note:
* 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
* at least engine cmd NV_IMAGE_BLIT and NV12_IMAGE_BLIT. */
adress -= (512 * 1024);
}
}
for (cnt = 0; cnt <= offset; cnt++)
{
@@ -296,8 +313,25 @@ const overlay_buffer *ALLOCATE_OVERLAY_BUFFER(color_space cs, uint16 width, uint
adress = (((uint32)((uint8*)si->framebuffer_pci)) + si->ps.memory_size);
/* don't touch the DMA acceleration engine command buffer if it exists */
/* note:
* the buffer is 32kB in size. Keep a distance of another 32kB for safety. */
if (si->settings.dma_acc) adress -= (64 * 1024);
* the buffer is 32kB in size. Keep some extra distance for safety (faulty apps). */
if (si->settings.dma_acc)
{
if (si->ps.card_arch < NV40A)
{
/* keeping 32kB distance from the DMA buffer */
adress -= (64 * 1024);
}
else
{
/* 416kB distance is just OK: keeping another 64kB distance for safety;
* confirmed for NV43. */
/* note:
* 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
* at least engine cmd NV_IMAGE_BLIT and NV12_IMAGE_BLIT. */
adress -= (512 * 1024);
}
}
for (cnt = 0; cnt <= offset; cnt++)
{
@@ -4,7 +4,7 @@
Other authors for NV driver:
Mark Watson,
Rudolf Cornelissen 9/2002-1/2005
Rudolf Cornelissen 9/2002-2/2005
*/
#define MODULE_BIT 0x00400000
@@ -384,8 +384,28 @@ status_t PROPOSE_DISPLAY_MODE(display_mode *target, const display_mode *low, con
mem_reservation = 0;
/* checkout space needed for hardcursor (if any) */
if (si->settings.hardcursor) mem_reservation = 2048;
/* checkout space needed for DMA (if active) */
if (si->settings.dma_acc) mem_reservation += 65536;
/* reserve space for DMA acceleration engine command buffer (if active) */
/* note:
* the buffer is 32kB in size. Keep some extra distance for safety (faulty apps). */
if (si->settings.dma_acc)
{
if (si->ps.card_arch < NV40A)
{
/* keeping 32kB distance from the DMA buffer */
mem_reservation += (64 * 1024);
}
else
{
/* 416kB distance is just OK: keeping another 64kB distance for safety;
* confirmed for NV43. */
/* note:
* 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
* at least engine cmd NV_IMAGE_BLIT and NV12_IMAGE_BLIT. */
mem_reservation += (512 * 1024);
}
}
/* memory requirement for frame buffer */
if ((row_bytes * target->virtual_height) >
(si->ps.memory_size - mem_reservation))
@@ -6,7 +6,7 @@
Other authors:
Mark Watson,
Apsed,
Rudolf Cornelissen 11/2002-1/2005
Rudolf Cornelissen 11/2002-2/2005
*/
#define MODULE_BIT 0x00200000
@@ -332,8 +332,25 @@ status_t SET_DISPLAY_MODE(display_mode *mode_to_set)
si->mem_high = si->ps.memory_size - 1;
/* don't touch the DMA acceleration engine command buffer if it exists */
/* note:
* the buffer is 32kB in size. Keep a distance of another 32kB for safety. */
if (si->settings.dma_acc) si->mem_high -= (64 * 1024);
* the buffer is 32kB in size. Keep some extra distance for safety (faulty apps). */
if (si->settings.dma_acc)
{
if (si->ps.card_arch < NV40A)
{
/* keeping 32kB distance from the DMA buffer */
si->mem_high -= (64 * 1024);
}
else
{
/* 416kB distance is just OK: keeping another 64kB distance for safety;
* confirmed for NV43. */
/* note:
* 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
* at least engine cmd NV_IMAGE_BLIT and NV12_IMAGE_BLIT. */
si->mem_high -= (512 * 1024);
}
}
si->mem_high -= (MAXBUFFERS * 1024 * 1024 * 2); /* see overlay.c file */
LOG(1,("SETMODE: booted since %f mS\n", system_time()/1000.0));
@@ -90,7 +90,7 @@ status_t nv_general_powerup()
{
status_t status;
LOG(1,("POWERUP: Haiku nVidia Accelerant 0.33 running.\n"));
LOG(1,("POWERUP: Haiku nVidia Accelerant 0.34 running.\n"));
/* preset no laptop */
si->ps.laptop = false;