linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Antonino A. Daplas" <adaplas@hotpop.com>
To: linux-fbdev-devel@lists.sourceforge.net,
	Andrew Walrond <andrew@walrond.org>
Subject: Re: Rivafb won't work with DVI connector
Date: Tue, 23 Nov 2004 22:28:59 +0800	[thread overview]
Message-ID: <200411232229.00311.adaplas@hotpop.com> (raw)
In-Reply-To: <200411231232.57420.andrew@walrond.org>

[-- Attachment #1: Type: text/plain, Size: 1236 bytes --]

On Tuesday 23 November 2004 20:32, Andrew Walrond wrote:
> On Tuesday 23 Nov 2004 01:50, Antonino A. Daplas wrote:
> > On Tuesday 23 November 2004 07:47, Andrew Walrond wrote:
> > > Note the erroneous panel detection; this is a 1600x1200 tft lcd. The
> > > panel is detected as 1024x768 in every following case.
> >
> > The panel size is programmed by the BIOS, not sure what what we can do
> > about that.  So even if your display supports 1600x1200, you're still
> > limited to 1024x768.
>
> What, the video-card BIOS? Shouldn't it get the correct info from the EDID?

If the display has an analog input, then yes.  It's different when the input
is digital. 

(Also, the EDID block may differ depending on the input type, this I'm not
sure).


> Ok, with your incremental patch, DSUB connection and no kernel params, the
> kernel boots into a corruption free 1600x1200 (200xwhatever) console with
> two nice penguins, after detecting EDIDs on BUS2 and BUS3.
> Unfortunately, it then  Oops's like this: (copied by hand)
>
>  Oops : PREEMPT SMP
>
>  tty_open+342  chrdev_open+457
>  dentry_open+315 filp_open+62
>  get_unused_fd+244 sys_open+76
>  init+652   child_rip+8
>  init+0    child_rip+0
>

Okay, try the attached patch.

Tony


[-- Attachment #2: nvidiafb2-inc2.diff --]
[-- Type: text/x-diff, Size: 3653 bytes --]

diff -Nru a/drivers/video/nvidia/nv_setup.c b/drivers/video/nvidia/nv_setup.c
--- a/drivers/video/nvidia/nv_setup.c	2004-11-23 06:01:00 +08:00
+++ b/drivers/video/nvidia/nv_setup.c	2004-11-23 22:19:56 +08:00
@@ -289,7 +289,8 @@
 	u16 implementation = par->Chipset & 0x0ff0;
 	u8 *edidA, *edidB;
 	struct fb_monspecs monitorA, monitorB;
-	int mobile = 0, validA = 0, validB = 0;
+	struct fb_monspecs *monA = NULL, *monB = NULL;
+	int mobile = 0;
 	int tvA = 0;
 	int tvB = 0;
 	int FlatPanel = -1;   /* really means the CRTC is slaved */
@@ -397,13 +398,13 @@
 		nvidia_probe_i2c_connector(par, 1, &edidA);
 		if(edidA && !fb_parse_edid(edidA, &var)) {
 			printk("nvidiafb: EDID found from BUS1\n");
-			fb_edid_to_monspecs(edidA, &monitorA);
-			FlatPanel = (monitorA.input == FB_DISP_DDI) ? 1 : 0;
+			monA = &monitorA;
+			fb_edid_to_monspecs(edidA, monA);
+			FlatPanel = (monA->input == FB_DISP_DDI) ? 1 : 0;
 			
 			/* NV4 doesn't support FlatPanels */
 			if((par->Chipset & 0x0fff) <= 0x0020)
 				FlatPanel = 0;
-			validA = 1;
 		} else {
 			VGA_WR08(par->PCIO, 0x03D4, 0x28);
 			if(VGA_RD08(par->PCIO, 0x03D5) & 0x80) {
@@ -484,15 +485,15 @@
 		nvidia_probe_i2c_connector(par, 1, &edidA);
 		if (edidA && !fb_parse_edid(edidA, &var)) {
 			printk("nvidiafb: EDID found from BUS1\n");
-			fb_edid_to_monspecs(edidA, &monitorA);
-			validA = 1;
+			monA = &monitorA;
+			fb_edid_to_monspecs(edidA, monA);
 		}
 
 		nvidia_probe_i2c_connector(par, 2, &edidB);
 		if (edidB && !fb_parse_edid(edidB, &var)) {
 			printk("nvidiafb: EDID found from BUS2\n");
-			fb_edid_to_monspecs(edidB, &monitorB);
-			validB = 1;
+			monB = &monitorB;
+			fb_edid_to_monspecs(edidB, monB);
 		}
 
 		if(slaved_on_A && !tvA) {
@@ -529,10 +530,10 @@
 			Television = 1;
 			printk("nvidiafb: CRTC 1 is currently programmed for "
 			       "TV\n");
-		} else if (validA) {
-			FlatPanel = (monitorA.input == FB_DISP_DDI) ? 1 : 0;
-		} else if (validB) {
-			FlatPanel = (monitorB.input == FB_DISP_DDI) ? 1 : 0;
+		} else if (monA) {
+			FlatPanel = (monA->input == FB_DISP_DDI) ? 1 : 0;
+		} else if (monB) {
+			FlatPanel = (monB->input == FB_DISP_DDI) ? 1 : 0;
 		}
 		
 		if(par->FlatPanel == -1) {
@@ -572,25 +573,30 @@
 			       "specified\n", par->CRTCnumber);
 		}
 		
-		if (validA) {
-			if (((monitorA.input == FB_DISP_DDI) &&
+		if (monA) {
+			if (((monA->input == FB_DISP_DDI) &&
 			     par->FlatPanel) ||
-			    ((monitorA.input != FB_DISP_DDI) &&
-			     !par->FlatPanel)) { 
-				if(validB)
-					fb_destroy_modedb(monitorB.modedb);
-			} else 
-				fb_destroy_modedb(monitorA.modedb);
+			    ((monA->input != FB_DISP_DDI) &&
+			     !par->FlatPanel)) {
+				if (monB) {
+					fb_destroy_modedb(monB->modedb);
+					monB = NULL;
+				}
+			} else {
+				fb_destroy_modedb(monA->modedb);
+				monA = NULL;
+			}
 		}
 		
-		if (validB) {
-			if (((monitorB.input == FB_DISP_DDI) &&
+		if (monB) {
+			if (((monB->input == FB_DISP_DDI) &&
 			     !par->FlatPanel) ||
-			    ((!monitorB.input != FB_DISP_DDI) &&
-			     par->FlatPanel)) 
-				fb_destroy_modedb(monitorB.modedb);
-			else
-				monitorA = monitorB;
+			    ((monB->input != FB_DISP_DDI) &&
+			     par->FlatPanel)) {
+				fb_destroy_modedb(monB->modedb);
+				monB = NULL;
+			} else 
+				monA = monB;
 		}
 
 		if(implementation == 0x0110)
@@ -615,10 +621,12 @@
 		printk("Panel size is %i x %i\n", par->fpWidth, par->fpHeight);
 	}
 	
-	if (validA || validB)
-		info->monspecs = monitorA;
+	if (monA)
+		info->monspecs = *monA;
+
 	kfree(edidA);
 	kfree(edidB);
+	
 	if(!par->FlatPanel || (info->var.bits_per_pixel != 24) ||
 	   !par->twoHeads)
 		par->FPDither = 0;

  reply	other threads:[~2004-11-23 14:30 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-19 11:37 Rivafb won't work with DVI connector Andrew Walrond
2004-11-19 22:08 ` Antonino A. Daplas
2004-11-20 15:52   ` Andrew Walrond
2004-11-22  0:11     ` Antonino A. Daplas
2004-11-22  9:23       ` Andrew Walrond
2004-11-22  9:43         ` Andrew Walrond
2004-11-22 22:13           ` Antonino A. Daplas
2004-11-22 23:47             ` Andrew Walrond
2004-11-22 23:54               ` Andrew Walrond
2004-11-23  1:50               ` Antonino A. Daplas
2004-11-23 12:32                 ` Andrew Walrond
2004-11-23 14:28                   ` Antonino A. Daplas [this message]
2004-11-23 15:09                     ` Andrew Walrond
2004-11-23 15:18                       ` Antonino A. Daplas
2004-11-23 16:08                         ` Andrew Walrond
2004-11-23 17:07                           ` Antonino A. Daplas
2004-11-23 18:01                             ` Andrew Walrond
2004-11-23 18:26                               ` Antonino A. Daplas
2004-11-23 19:00                                 ` Andrew Walrond
2004-11-23 19:07                                   ` Andrew Walrond
2004-11-23 19:23                                 ` Andrew Walrond
2004-11-23 19:59                                   ` Geert Uytterhoeven
2004-11-23 20:53                                     ` Andrew Walrond
2004-11-23 22:44                                       ` Antonino A. Daplas
2004-11-23 23:59                                         ` Andrew Walrond
2004-11-24 22:38                                         ` Andrew Walrond
2004-11-23 20:21                                   ` Chad Daelhousen
2004-11-24 23:01                                 ` Andrew Walrond
  -- strict thread matches above, loose matches on Subject: below --
2004-11-25  0:07 Antonino A. Daplas
2004-11-25 15:27 ` Andrew Walrond
2004-11-25 21:16   ` Antonino A. Daplas
2004-11-26 14:09   ` Antonino A. Daplas
2004-11-27 12:40     ` Andrew Walrond
2004-11-27 18:29       ` Michel Dänzer
2004-11-27 22:35         ` Andrew Walrond
2004-11-27 22:43       ` Antonino A. Daplas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200411232229.00311.adaplas@hotpop.com \
    --to=adaplas@hotpop.com \
    --cc=andrew@walrond.org \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).