From ccfb6b37116295c43e0d652f4476c0c8f81d47e5 Mon Sep 17 00:00:00 2001
From: Rudolf Cornelissen
Date: Mon, 19 Apr 2004 13:57:31 +0000
Subject: [PATCH] more logging, removed paneldetection bug
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7242 a95241bf-73f2-0310-859d-f6bbb57e9c96
---
headers/private/graphics/nvidia/nv_macros.h | 2 ++
.../accelerants/nvidia/engine/nv_general.c | 2 +-
.../accelerants/nvidia/engine/nv_info.c | 25 +++++++++++++++----
.../drivers/graphics/nvidia/UPDATE.html | 5 ++--
4 files changed, 26 insertions(+), 8 deletions(-)
diff --git a/headers/private/graphics/nvidia/nv_macros.h b/headers/private/graphics/nvidia/nv_macros.h
index fd2cbe9544..1ac18060ea 100644
--- a/headers/private/graphics/nvidia/nv_macros.h
+++ b/headers/private/graphics/nvidia/nv_macros.h
@@ -574,6 +574,8 @@
#define NVCRTCX_OWNER 0x44
#define NVCRTCX_FP_HTIMING 0x53
#define NVCRTCX_FP_VTIMING 0x54
+#define NVCRTCX_0x59 0x59
+#define NVCRTCX_0x9f 0x9f
/* Nvidia ATTRIBUTE indexed registers */
/* VGA standard registers: */
diff --git a/src/add-ons/accelerants/nvidia/engine/nv_general.c b/src/add-ons/accelerants/nvidia/engine/nv_general.c
index 0a3ba68d5d..bec1876b32 100644
--- a/src/add-ons/accelerants/nvidia/engine/nv_general.c
+++ b/src/add-ons/accelerants/nvidia/engine/nv_general.c
@@ -80,7 +80,7 @@ status_t nv_general_powerup()
{
status_t status;
- LOG(1,("POWERUP: nVidia (open)BeOS Accelerant 0.10-11 running.\n"));
+ LOG(1,("POWERUP: nVidia (open)BeOS Accelerant 0.10-12 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 543ded96f1..ce9a695c36 100644
--- a/src/add-ons/accelerants/nvidia/engine/nv_info.c
+++ b/src/add-ons/accelerants/nvidia/engine/nv_info.c
@@ -268,6 +268,12 @@ static void detect_panels()
/* unlock CRTC1 */
CRTCW(LOCK, 0x57);
CRTCW(VSYNCE ,(CRTCR(VSYNCE) & 0x7f));
+
+ LOG(2,("INFO: Dumping flatpanel related CRTC registers:\n"));
+ LOG(2,("CRTC1: LCD register: $%02x\n", CRTCR(LCD)));
+ LOG(2,("CRTC1: register $59: $%02x\n", CRTCR(0x59)));
+ LOG(2,("CRTC1: register $9f: $%02x\n", CRTCR(0x9f)));
+
/* detect active slave device (if any) */
slaved_for_dev1 = (CRTCR(PIXEL) & 0x80);
if (slaved_for_dev1)
@@ -280,19 +286,26 @@ static void detect_panels()
{
/* check secondary head: */
/* enable access to CRTC2 */
- CRTCW(OWNER, 0x03);
+ CRTC2W(OWNER, 0x03);
/* unlock CRTC2 */
- CRTCW(LOCK, 0x57);
- CRTCW(VSYNCE ,(CRTCR(VSYNCE) & 0x7f));
+ CRTC2W(LOCK, 0x57);
+ CRTC2W(VSYNCE ,(CRTC2R(VSYNCE) & 0x7f));
+
+ LOG(2,("CRTC2: LCD register: $%02x\n", CRTC2R(LCD)));
+ LOG(2,("CRTC2: register $59: $%02x\n", CRTC2R(0x59)));
+ LOG(2,("CRTC2: register $9f: $%02x\n", CRTC2R(0x9f)));
+
/* detect active slave device (if any) */
- slaved_for_dev2 = (CRTCR(PIXEL) & 0x80);
+ slaved_for_dev2 = (CRTC2R(PIXEL) & 0x80);
if (slaved_for_dev2)
{
/* if the panel isn't selected, tvout is.. */
- tvout2 = !(CRTCR(LCD) & 0x01);
+ tvout2 = !(CRTC2R(LCD) & 0x01);
}
}
+ LOG(2,("INFO: End flatpanel related CRTC registers dump.\n"));
+
/* do some presets */
si->ps.panel1_width = 0;
si->ps.panel1_height = 0;
@@ -384,6 +397,8 @@ static void detect_panels()
(si->ps.panel1_width == si->ps.panel2_width) &&
(si->ps.panel1_height == si->ps.panel2_height))
{
+ LOG(2,("INFO: correcting double detection of single panel!\n"));
+
if (DACR(FP_TG_CTRL) & 0x80000000)
{
/* LVDS panel is on CRTC2, so clear false primary detection */
diff --git a/src/add-ons/kernel/drivers/graphics/nvidia/UPDATE.html b/src/add-ons/kernel/drivers/graphics/nvidia/UPDATE.html
index 0c481d3f78..d6c90070bf 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 (0.10-11), (Rudolf)
+head (0.10-12), (Rudolf)
- Implemented laptop internal flatpanel presence and native resolution detection;
- Implemented external DVI flatpanel(s) presence and native resolution detection;
@@ -18,7 +18,8 @@
- Added recognition for GeForce4 MX 4000, GeForceFX 5700LE and GeForceFX 5700VE cards; also modified a few others to be more correct;
- Updated panel detection code once more: pre NV18 DVI panels should be working again now;
- Added flatpanel DPMS support for both heads via powerup/powerdown of LVDS and TMDS transmitters;
-
- Added panel(s) native mode(s) to the modelist exported by the driver. You can now set it (them) by just selecting it from the Screenprefs app, except if you use the native R5 one. Use Dualhead setup instead (for example): the extra mode(s) will be at the bottom of the list.
+
- Added panel(s) native mode(s) to the modelist exported by the driver. You can now set it (them) by just selecting it from the Screenprefs app, except if you use the native R5 one. Use Dualhead setup instead (for example): the extra mode(s) will be at the bottom of the list;
+
- Removed a bug in the panel detection code and added a bit more logging.
NOTE:
dualhead switch mode is not yet operational for flatpanels...