From 716c61f30134daf617b7f4b0a2f660ec1e7a19c0 Mon Sep 17 00:00:00 2001 From: Rudolf Cornelissen Date: Fri, 27 Jan 2006 20:56:36 +0000 Subject: [PATCH] updated all framebuffer accesses to use volatile pointers. This potentially fixes even more coldstarting problems. Thanks Marcus Overhagen for pointing this out again - sorry for forgetting :-/ git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16111 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../accelerants/nvidia/engine/nv_info.c | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/src/add-ons/accelerants/nvidia/engine/nv_info.c b/src/add-ons/accelerants/nvidia/engine/nv_info.c index 2df853913f..70468500f2 100644 --- a/src/add-ons/accelerants/nvidia/engine/nv_info.c +++ b/src/add-ons/accelerants/nvidia/engine/nv_info.c @@ -890,10 +890,10 @@ static void setup_ram_config(uint8* rom, uint16 ram_tab) /* write testpattern to first 128 bits of graphics memory... */ data = 0x4e563541; for (cnt = 0; cnt < 4; cnt++) - ((uint32 *)si->framebuffer)[cnt] = data; + ((volatile uint32 *)si->framebuffer)[cnt] = data; /* ... if second 64 bits does not contain the testpattern we are apparantly * set to 128bits width while we should be set to 64bits width, so correct. */ - if (((uint32 *)si->framebuffer)[3] != data) + if (((volatile uint32 *)si->framebuffer)[3] != data) { LOG(8,("INFO: ---RAM width tested: width is 64bits, correcting settings.\n")); NV_REG32(NV32_NV4STRAPINFO) &= ~0x00000004; @@ -910,14 +910,14 @@ static void setup_ram_config(uint8* rom, uint16 ram_tab) if (!ram_cfg) { /* write testpattern to just above the 16Mb boundary */ - ((uint32 *)si->framebuffer)[(16 * 1024 * 1024) >> 2] = data; + ((volatile uint32 *)si->framebuffer)[(16 * 1024 * 1024) >> 2] = data; /* check if pattern reads back */ - if (((uint32 *)si->framebuffer)[(16 * 1024 * 1024) >> 2] == data) + if (((volatile uint32 *)si->framebuffer)[(16 * 1024 * 1024) >> 2] == data) { /* write second testpattern to base adress */ data = 0x4135564e; - ((uint32 *)si->framebuffer)[0] = data; - if (((uint32 *)si->framebuffer)[0] == data) + ((volatile uint32 *)si->framebuffer)[0] = data; + if (((volatile uint32 *)si->framebuffer)[0] == data) { LOG(8,("INFO: ---RAM size tested: size was set OK (32Mb).\n")); return; @@ -936,9 +936,9 @@ static void setup_ram_config(uint8* rom, uint16 ram_tab) /* increment testpattern */ data++; /* write testpattern to just above the 8Mb boundary */ - ((uint32 *)si->framebuffer)[(8 * 1024 * 1024) >> 2] = data; + ((volatile uint32 *)si->framebuffer)[(8 * 1024 * 1024) >> 2] = data; /* check if pattern reads back */ - if (((uint32 *)si->framebuffer)[(8 * 1024 * 1024) >> 2] == data) + if (((volatile uint32 *)si->framebuffer)[(8 * 1024 * 1024) >> 2] == data) { LOG(8,("INFO: ---RAM size tested: size was set OK (16Mb).\n")); return; @@ -957,9 +957,9 @@ static void setup_ram_config(uint8* rom, uint16 ram_tab) /* increment testpattern (again) */ data++; /* write testpattern to just above the 4Mb boundary */ - ((uint32 *)si->framebuffer)[(4 * 1024 * 1024) >> 2] = data; + ((volatile uint32 *)si->framebuffer)[(4 * 1024 * 1024) >> 2] = data; /* check if pattern reads back */ - if (((uint32 *)si->framebuffer)[(4 * 1024 * 1024) >> 2] == data) + if (((volatile uint32 *)si->framebuffer)[(4 * 1024 * 1024) >> 2] == data) { /* we have 8Mb, make sure this is set. */ ram_cfg = 0x00000002; @@ -1874,22 +1874,22 @@ static void setup_ram_config_nv10_up(uint8* rom) while ((cnt < 4) && (stat != B_OK)) { /* reset RAM bits at offset 224-255 bits four times */ - ((uint32 *)si->framebuffer)[0x07] = 0x00000000; + ((volatile uint32 *)si->framebuffer)[0x07] = 0x00000000; snooze(10); - ((uint32 *)si->framebuffer)[0x07] = 0x00000000; + ((volatile uint32 *)si->framebuffer)[0x07] = 0x00000000; snooze(10); - ((uint32 *)si->framebuffer)[0x07] = 0x00000000; + ((volatile uint32 *)si->framebuffer)[0x07] = 0x00000000; snooze(10); - ((uint32 *)si->framebuffer)[0x07] = 0x00000000; + ((volatile uint32 *)si->framebuffer)[0x07] = 0x00000000; snooze(10); /* write testpattern */ - ((uint32 *)si->framebuffer)[0x07] = 0x4e563131; + ((volatile uint32 *)si->framebuffer)[0x07] = 0x4e563131; snooze(10); /* reset RAM bits at offset 480-511 bits */ - ((uint32 *)si->framebuffer)[0x0f] = 0x00000000; + ((volatile uint32 *)si->framebuffer)[0x0f] = 0x00000000; snooze(10); /* check testpattern to have survived */ - if (((uint32 *)si->framebuffer)[0x07] == 0x4e563131) stat = B_OK; + if (((volatile uint32 *)si->framebuffer)[0x07] == 0x4e563131) stat = B_OK; cnt++; } @@ -1924,10 +1924,10 @@ static void setup_ram_config_nv10_up(uint8* rom) /* subtract 1MB */ data -= 0x00100000; /* write testpattern at generated RAM adress */ - ((uint32 *)si->framebuffer)[(data >> 2)] = 0x4e564441; + ((volatile uint32 *)si->framebuffer)[(data >> 2)] = 0x4e564441; snooze(10); /* reset first RAM adress */ - ((uint32 *)si->framebuffer)[0x00] = 0x00000000; + ((volatile uint32 *)si->framebuffer)[0x00] = 0x00000000; snooze(10); /* dummyread first RAM adress four times */ dummy = ((volatile uint32 *)si->framebuffer)[0x00]; @@ -1935,7 +1935,7 @@ static void setup_ram_config_nv10_up(uint8* rom) dummy = ((volatile uint32 *)si->framebuffer)[0x00]; dummy = ((volatile uint32 *)si->framebuffer)[0x00]; /* check testpattern to have survived */ - if (((uint32 *)si->framebuffer)[(data >> 2)] == 0x4e564441) stat = B_OK; + if (((volatile uint32 *)si->framebuffer)[(data >> 2)] == 0x4e564441) stat = B_OK; cnt++; } @@ -1974,10 +1974,10 @@ static void setup_ram_config_nv28(uint8* rom) /* set bit 11: 'pulse' something into a new setting? */ NV_REG32(NV32_PFB_CONFIG_0) |= 0x00000800; /* write testpattern to RAM adress 127Mb */ - ((uint32 *)si->framebuffer)[0x01fc0000] = 0x4e564441; + ((volatile uint32 *)si->framebuffer)[0x01fc0000] = 0x4e564441; snooze(10); /* reset first RAM adress */ - ((uint32 *)si->framebuffer)[0x00000000] = 0x00000000; + ((volatile uint32 *)si->framebuffer)[0x00000000] = 0x00000000; snooze(10); /* dummyread first RAM adress four times */ dummy = ((volatile uint32 *)si->framebuffer)[0x00000000]; @@ -1989,7 +1989,7 @@ static void setup_ram_config_nv28(uint8* rom) dummy = ((volatile uint32 *)si->framebuffer)[0x00000000]; LOG(8,("dummy4 = $%08x\n", dummy)); /* check testpattern to have survived */ - if (((uint32 *)si->framebuffer)[0x01fc0000] == 0x4e564441) stat = B_OK; + if (((volatile uint32 *)si->framebuffer)[0x01fc0000] == 0x4e564441) stat = B_OK; cnt++; }