From ce3fc95ee40dd00ccb44ef330a747e94086f6c5b Mon Sep 17 00:00:00 2001 From: Rudolf Cornelissen Date: Thu, 20 Oct 2005 09:00:38 +0000 Subject: [PATCH] added capability to driver to run without an INT assigned. Driver now autodisables 'Sync_to_Retrace' functionality if it finds no INT assigned, instead of not loading/running the driver at all. This should enable some users outthere to finally run the nVidia driver on their systems. Bumped version to 0.56. Note: While driver has been tested with INT assigned, it has not yet been tested without it. (got to find a system which has the option or fixed disabled BIOS setting). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14438 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/accelerants/nvidia/GetModeInfo.c | 7 +++++-- .../accelerants/nvidia/SetDisplayMode.c | 18 +++++++++++------- .../accelerants/nvidia/engine/nv_general.c | 10 ++++++++-- .../accelerants/nvidia/engine/nv_info.c | 2 +- 4 files changed, 25 insertions(+), 12 deletions(-) diff --git a/src/add-ons/accelerants/nvidia/GetModeInfo.c b/src/add-ons/accelerants/nvidia/GetModeInfo.c index ea1dd2561a..5a454d0c05 100644 --- a/src/add-ons/accelerants/nvidia/GetModeInfo.c +++ b/src/add-ons/accelerants/nvidia/GetModeInfo.c @@ -4,7 +4,7 @@ Other authors: Mark Watson - Rudolf Cornelissen 9/2002-5/2003 + Rudolf Cornelissen 9/2002-10/2005 */ #define MODULE_BIT 0x02000000 @@ -156,5 +156,8 @@ 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; + if (si->ps.int_assigned) + return si->vblank; + else + return B_ERROR; } diff --git a/src/add-ons/accelerants/nvidia/SetDisplayMode.c b/src/add-ons/accelerants/nvidia/SetDisplayMode.c index 50ba1b0984..0487fb640b 100644 --- a/src/add-ons/accelerants/nvidia/SetDisplayMode.c +++ b/src/add-ons/accelerants/nvidia/SetDisplayMode.c @@ -17,15 +17,19 @@ Enable/Disable interrupts. Just a wrapper around the ioctl() to the kernel driver. */ -static void interrupt_enable(bool flag) { - status_t result; +static void interrupt_enable(bool flag) +{ + status_t result = B_OK; nv_set_bool_state sbs; - /* set the magic number so the driver knows we're for real */ - sbs.magic = NV_PRIVATE_DATA_MAGIC; - sbs.do_it = flag; - /* contact driver and get a pointer to the registers and shared data */ - result = ioctl(fd, NV_RUN_INTERRUPTS, &sbs, sizeof(sbs)); + if (si->ps.int_assigned) + { + /* set the magic number so the driver knows we're for real */ + sbs.magic = NV_PRIVATE_DATA_MAGIC; + sbs.do_it = flag; + /* contact driver and get a pointer to the registers and shared data */ + result = ioctl(fd, NV_RUN_INTERRUPTS, &sbs, sizeof(sbs)); + } } /* First validate the mode, then call lots of bit banging stuff to set the mode(s)! */ diff --git a/src/add-ons/accelerants/nvidia/engine/nv_general.c b/src/add-ons/accelerants/nvidia/engine/nv_general.c index c41cebd63d..5375d145cd 100644 --- a/src/add-ons/accelerants/nvidia/engine/nv_general.c +++ b/src/add-ons/accelerants/nvidia/engine/nv_general.c @@ -1,7 +1,7 @@ /* Authors: Mark Watson 12/1999, Apsed, - Rudolf Cornelissen 10/2002-9/2005 + Rudolf Cornelissen 10/2002-10/2005 */ #define MODULE_BIT 0x00008000 @@ -91,7 +91,13 @@ status_t nv_general_powerup() { status_t status; - LOG(1,("POWERUP: Haiku nVidia Accelerant 0.55 running.\n")); + /* log VBLANK INT usability status */ + if (si->ps.int_assigned) + LOG(4,("POWERUP: Usable INT assigned to HW; Vblank semaphore enabled\n")); + else + LOG(4,("POWERUP: No (usable) INT assigned to HW; Vblank semaphore disabled\n")); + + LOG(1,("POWERUP: Haiku nVidia Accelerant 0.56 running.\n")); /* preset no laptop */ si->ps.laptop = false; diff --git a/src/add-ons/accelerants/nvidia/engine/nv_info.c b/src/add-ons/accelerants/nvidia/engine/nv_info.c index 4202b117e6..6bbb7c4706 100644 --- a/src/add-ons/accelerants/nvidia/engine/nv_info.c +++ b/src/add-ons/accelerants/nvidia/engine/nv_info.c @@ -1,7 +1,7 @@ /* Read initialisation information from card */ /* some bits are hacks, where PINS is not known */ /* Author: - Rudolf Cornelissen 7/2003-9/2005 + Rudolf Cornelissen 7/2003-10/2005 */ #define MODULE_BIT 0x00002000