From 51e7cfd2bb212ee5b0031187eebed1e5021b1a2b Mon Sep 17 00:00:00 2001
From: Rudolf Cornelissen
Date: Wed, 23 Sep 2009 19:17:35 +0000
Subject: [PATCH] modified head selection code for most NV40 architecture cards
since their BIOSes behave differently. This should fix black or disabled
screens if the secondary connector has a VGA screen while the first one is
disconnected. verified on NV43, NV44, G71 and G72 over here. Bumped version
to 1.05.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33255 a95241bf-73f2-0310-859d-f6bbb57e9c96
---
.../accelerants/nvidia/engine/nv_general.c | 2 +-
.../accelerants/nvidia/engine/nv_info.c | 56 +++++++++++--------
.../drivers/graphics/nvidia/UPDATE.html | 5 +-
3 files changed, 38 insertions(+), 25 deletions(-)
diff --git a/src/add-ons/accelerants/nvidia/engine/nv_general.c b/src/add-ons/accelerants/nvidia/engine/nv_general.c
index 039b467e80..97f8312f06 100644
--- a/src/add-ons/accelerants/nvidia/engine/nv_general.c
+++ b/src/add-ons/accelerants/nvidia/engine/nv_general.c
@@ -92,7 +92,7 @@ status_t nv_general_powerup()
{
status_t status;
- LOG(1,("POWERUP: Haiku nVidia Accelerant 1.04 running.\n"));
+ LOG(1,("POWERUP: Haiku nVidia Accelerant 1.05 running.\n"));
/* log VBLANK INT usability status */
if (si->ps.int_assigned)
diff --git a/src/add-ons/accelerants/nvidia/engine/nv_info.c b/src/add-ons/accelerants/nvidia/engine/nv_info.c
index 1431a46bd4..6db3ad0bf7 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-8/2009
+ Rudolf Cornelissen 7/2003-9/2009
*/
#define MODULE_BIT 0x00002000
@@ -2768,10 +2768,33 @@ static void setup_output_matrix()
si->ps.crtc2_prim = true;
break;
case 0x20: /* nothing on head 1, analog panel or CRT on head 2 */
- LOG(2,("INFO: head 1 has nothing connected;\n"));
- LOG(2,("INFO: head 2 has an analog panel or CRT:\n"));
- LOG(2,("INFO: defaulting to head 2 for primary use.\n"));
- si->ps.crtc2_prim = true;
+ if (si->ps.card_arch < NV40A) {
+ LOG(2,("INFO: head 1 has nothing connected;\n"));
+ LOG(2,("INFO: head 2 has an analog panel or CRT:\n"));
+ LOG(2,("INFO: defaulting to head 2 for primary use.\n"));
+ si->ps.crtc2_prim = true;
+ } else {
+ switch (si->ps.card_type) {
+ case NV40: /* Geforce 6800 AGP was confirmed OK 'in the old days' */
+ case NV41: /* Geforce 6800 type as well - needs to be confirmed (guessing) */
+ case NV45: /* Geforce 6800 PCIe - needs to be confirmed (guessing) */
+ LOG(2,("INFO: head 1 has nothing connected;\n"));
+ LOG(2,("INFO: head 2 has an analog panel or CRT:\n"));
+ LOG(2,("INFO: defaulting to head 2 for primary use.\n"));
+ si->ps.crtc2_prim = true;
+ break;
+ default:
+ /* newer NV40 architecture cards contains (an) additional switch(es)
+ * to connect a CRTC/DAC combination to a connector. The BIOSes of
+ * these cards connect head1 to connectors 1 and 2 simultaneously if
+ * only one VGA screen is found being on connector 2. Which is the
+ * case here.
+ * Confirmed on NV43, NV44, G71 and G72. */
+ LOG(2,("INFO: Both card outputs are connected to head 1;\n"));
+ LOG(2,("INFO: defaulting to head 1 for primary use.\n"));
+ break;
+ }
+ }
break;
case 0x30: /* nothing on head 1, both types on head 2 */
LOG(2,("INFO: head 1 has nothing connected;\n"));
@@ -2809,23 +2832,12 @@ static void setup_output_matrix()
LOG(2,("INFO: defaulting to head 1 for primary use.\n"));
break;
case 0x32: /* more than two monitors connected to just two outputs: illegal! */
- //general fixme:
- //NV40 architecture contains (an) additional switch(es) to
- //connect a CRTC/DAC combination to a connector. We can't work as
- //usual (yet) because this interferes via BIOS card pre-programming.
- //
- //Also: it looks as if each pixelclock PLL can select different CRTC's
- //as well now via a new register: one PLL can be driving both CRTC's
- //and there's nothing we can do about that (yet). (DVI/dualhead trouble)
- if (si->ps.card_arch < NV40A)
- {
- LOG(2,("INFO: illegal monitor setup ($%02x):\n", si->ps.monitors));
- /* head 2 takes precedence because it has a digital panel while
- * head 1 has not. */
- LOG(2,("INFO: defaulting to head 2 for primary use.\n"));
- si->ps.crtc2_prim = true;
- break;
- }
+ LOG(2,("INFO: illegal monitor setup ($%02x):\n", si->ps.monitors));
+ /* head 2 takes precedence because it has a digital panel while
+ * head 1 has not. */
+ LOG(2,("INFO: defaulting to head 2 for primary use.\n"));
+ si->ps.crtc2_prim = true;
+ break;
default: /* more than two monitors connected to just two outputs: illegal! */
LOG(2,("INFO: illegal monitor setup ($%02x):\n", si->ps.monitors));
LOG(2,("INFO: defaulting to head 1 for primary use.\n"));
diff --git a/src/add-ons/kernel/drivers/graphics/nvidia/UPDATE.html b/src/add-ons/kernel/drivers/graphics/nvidia/UPDATE.html
index f3e24b3d6f..13a827090c 100644
--- a/src/add-ons/kernel/drivers/graphics/nvidia/UPDATE.html
+++ b/src/add-ons/kernel/drivers/graphics/nvidia/UPDATE.html
@@ -4,7 +4,7 @@
Changes done for each driverversion:
-head (SVN 1.04, Rudolf)
+head (SVN 1.05, Rudolf)
- Fixed driver assuming enabling AGP mode succeeded on some occasions if it did not block it itself. Blocking AGP mode completely via the AGP busmanager (option 'block_agp') resulted in a crashing acceleration engine because it was setup for AGP transfers instead of using PCI transfers. Error was solved with help from user kraton.
- Fixed shared_info struct problem occuring when 3D 'accelerant' is used (tested Alpha 4.1): the TVencoder type definition list apparantly gets some memory assigned these days when done inside the definition of shared_info. Moved encoder list outside the shared_info definition.
@@ -29,7 +29,8 @@
- Finally(!) fixed PLL selection trouble on NV40 architecture (Geforce 6xxx and 7xxx) cards. Now dualhead should (almost) always work OK, and now low-res bootscreens should nolonger result in 'frequency out of range' messages on DVI connected screens;
- Fixed shivering display on some systems (confirmed a Geforce 5200 laptop): Pixelclocks should never be setup for spread spectrum on analog connections;
- Added full HDTV mode (1920x1080p) to exported modelist: Haiku's Screen preflet allows you to set this mode now if your screen supports it;
-
- Improved modeline scaling for digitally connected screens: this fixes missing SYNC pulses on some setups. The screen nolonger shows shifted pictures (this happened mostly on 640x480 resolution).
+
- Improved modeline scaling for digitally connected screens: this fixes missing SYNC pulses on some setups. The screen nolonger shows shifted pictures (this happened mostly on 640x480 resolution);
+
- Modified head selection code on NV40 architecture cards except for NV40, NV41 and NV45. The cards affected have differently behaving BIOSes. This should fix black or disabled screens if the secondary connector was used for VGA while the first one was not connected.
nv_driver 0.80 (Rudolf)