From 14bb8d48d8d8c231f64657761804b0c8407d3aa9 Mon Sep 17 00:00:00 2001 From: shatty Date: Mon, 1 Dec 2003 04:18:57 +0000 Subject: [PATCH] openBeOS_Nvidia_V0.03_src git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5501 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/graphics/nvidia/nv_macros.h | 2 ++ src/add-ons/accelerants/nvidia/GetModeInfo.c | 4 +++- .../accelerants/nvidia/engine/nv_acc.c | 10 ++++----- .../accelerants/nvidia/engine/nv_crtc.c | 22 ++++++++++--------- .../accelerants/nvidia/engine/nv_general.c | 2 +- .../drivers/graphics/nvidia/nv.settings | 16 +++++++------- 6 files changed, 31 insertions(+), 25 deletions(-) diff --git a/headers/private/graphics/nvidia/nv_macros.h b/headers/private/graphics/nvidia/nv_macros.h index 51eaa61810..1ef52b8e26 100644 --- a/headers/private/graphics/nvidia/nv_macros.h +++ b/headers/private/graphics/nvidia/nv_macros.h @@ -123,6 +123,7 @@ #define NV8_INSTAT1 0x006013da #define NV32_NV10FBSTADD32 0x00600800 #define NV32_CONFIG 0x00600804//not yet used (coldstart)... +#define NV32_RASTER 0x00600808 #define NV32_NV10CURADD32 0x0060080c #define NV32_CURCONF 0x00600810 @@ -135,6 +136,7 @@ #define NV8_CRTC2DAT 0x006033d5 #define NV8_2INSTAT1 0x006033da//verify!!! #define NV32_NV10FB2STADD32 0x00602800//verify!!! +#define NV32_RASTER2 0x00602808//verify!!! #define NV32_NV10CUR2ADD32 0x0060280c//verify!!! #define NV32_2CURCONF 0x00602810//verify!!! diff --git a/src/add-ons/accelerants/nvidia/GetModeInfo.c b/src/add-ons/accelerants/nvidia/GetModeInfo.c index 1ea7098fcc..2819c55312 100644 --- a/src/add-ons/accelerants/nvidia/GetModeInfo.c +++ b/src/add-ons/accelerants/nvidia/GetModeInfo.c @@ -130,5 +130,7 @@ status_t GET_PIXEL_CLOCK_LIMITS(display_mode *dm, uint32 *low, uint32 *high) /* Return the semaphore id that will be used to signal a vertical sync occured. */ sem_id ACCELERANT_RETRACE_SEMAPHORE(void) { - return si->vblank; +// return si->vblank; +//temp: + return B_ERROR; } diff --git a/src/add-ons/accelerants/nvidia/engine/nv_acc.c b/src/add-ons/accelerants/nvidia/engine/nv_acc.c index 0168dbfa32..661d6f2aad 100644 --- a/src/add-ons/accelerants/nvidia/engine/nv_acc.c +++ b/src/add-ons/accelerants/nvidia/engine/nv_acc.c @@ -33,11 +33,11 @@ static uint8 depth; status_t nv_acc_wait_idle() { - volatile int i; - while (ACCR(STATUS)&(1<<16)) - { - for (i=0;i<10000;i++); /*spin in place so I do not hammer the bus*/ - }; +// volatile int i; +// while (ACCR(STATUS)&(1<<16)) +// { +// for (i=0;i<10000;i++); /*spin in place so I do not hammer the bus*/ +// }; return B_OK; } diff --git a/src/add-ons/accelerants/nvidia/engine/nv_crtc.c b/src/add-ons/accelerants/nvidia/engine/nv_crtc.c index cceff1090e..35ebd5ae13 100644 --- a/src/add-ons/accelerants/nvidia/engine/nv_crtc.c +++ b/src/add-ons/accelerants/nvidia/engine/nv_crtc.c @@ -415,9 +415,9 @@ status_t nv_crtc_cursor_init() const uint32 curadd = 0; /* set cursor bitmap adress ... */ - if (si->ps.card_arch == NV04A) + if ((si->ps.card_arch == NV04A) || (si->ps.laptop)) { - /* must be used this way on pre-NV10! */ + /* must be used this way on pre-NV10 and on all 'Go' cards! */ /* cursorbitmap must start on 2Kbyte boundary: */ /* set adress bit11-16, and set 'no doublescan' (registerbit 1 = 0) */ @@ -429,9 +429,10 @@ status_t nv_crtc_cursor_init() } else { - /* upto 4Gb RAM adressing: must be used on NV10 and later! */ + /* upto 4Gb RAM adressing: + * can be used on NV10 and later (except for 'Go' cards)! */ /* NOTE: - * This register does not exist on pre-NV10 cards. */ + * This register does not exist on pre-NV10 and 'Go' cards. */ /* cursorbitmap must still start on 2Kbyte boundary: */ NV_REG32(NV32_NV10CURADD32) = (curadd & 0xfffff800); @@ -528,14 +529,15 @@ status_t nv_crtc_cursor_define(uint8* andMask,uint8* xorMask) /*position the cursor*/ status_t nv_crtc_cursor_position(uint16 x ,uint16 y) { - /* make sure we are not in retrace, because the register(s) might get copied - * during our reprogramming them (double buffering feature) */ -//fixme if needed... -/* while (ACCR(STATUS) & 0x08) + /* make sure we are in retrace on pre-NV10 cards to prevent distortions: + * no double buffering feature */ + if (si->ps.card_arch == NV04A) { - snooze(4); + while (!(NV_REG32(NV32_RASTER) & 0x00010000)) + { + snooze(4); + } } -*/ DACW(CURPOS, ((x & 0x0fff) | ((y & 0x0fff) << 16))); diff --git a/src/add-ons/accelerants/nvidia/engine/nv_general.c b/src/add-ons/accelerants/nvidia/engine/nv_general.c index 9263034c60..c58b05d9cb 100644 --- a/src/add-ons/accelerants/nvidia/engine/nv_general.c +++ b/src/add-ons/accelerants/nvidia/engine/nv_general.c @@ -81,7 +81,7 @@ status_t nv_general_powerup() { status_t status; - LOG(1,("POWERUP: nVidia (open)BeOS Accelerant 0.02 running.\n")); + LOG(1,("POWERUP: nVidia (open)BeOS Accelerant 0.03 running.\n")); /* preset no laptop */ si->ps.laptop = false; diff --git a/src/add-ons/kernel/drivers/graphics/nvidia/nv.settings b/src/add-ons/kernel/drivers/graphics/nvidia/nv.settings index 3344a0b535..a06977d0be 100644 --- a/src/add-ons/kernel/drivers/graphics/nvidia/nv.settings +++ b/src/add-ons/kernel/drivers/graphics/nvidia/nv.settings @@ -1,22 +1,22 @@ -# Settings file for the mga driver and accelerant +# Settings file for the nv driver and accelerant # # This file should be moved to the directory # ~/config/settings/kernel/drivers/ # -# mga.driver parameters -# accelerant "mga.accelerant" +# nv.driver parameters +# accelerant "nv.accelerant" -# mga.accelerant parameters -usebios false # if true rely on bios to coldstart the card instead of driver +# nv.accelerant parameters +usebios false # if true rely on bios to coldstart the card: not functional (yet) #memory 2 # in MB, override builtin memory size detection hardcursor true # if true use on-chip cursor capabilities #logmask 0x00000000 # nothing logged, except errors, is default #logmask 0x80000000 # log card physical features #logmask 0x80000000 # log following mask #logmask 0x08000604 # log overlay use in full -logmask 0xffffffff # log everything -dumprom false # dump bios rom in ~/mga.rom -greensync false # if true generate sync on green output signal +#logmask 0xffffffff # log everything +dumprom false # dump bios rom in ~/nv.rom: probably not functional yet +greensync false # not functional, will be removed #--------- that's all. \ No newline at end of file