2007-02-15 16:31:03

by Zwane Mwaikambo

[permalink] [raw]
Subject: [PATCH] Don't probe for DDC on VBE1.2

VBE1.2 doesn't support function 15h (DDC) resulting in a 'hang' whilst
uncompressing kernel with some video cards. Make sure we check VBE version
before fiddling around with DDC.

http://bugzilla.kernel.org/show_bug.cgi?id=1458

Opened: 2003-10-30 09:12 Last update: 2007-02-13 22:03

:(

Much thanks to Tobias Hain for help in testing and investigating the bug.
Tested on;

i386, Chips & Technologies 65548 VESA VBE 1.2
CONFIG_VIDEO_SELECT=Y
CONFIG_FIRMWARE_EDID=Y

Untested on x86_64.

Signed-off-by: Zwane Mwaikambo <[email protected]>

Index: linux-2.6.20-rc6-mm1/arch/i386/boot/video.S
===================================================================
RCS file: /home/cvsroot/linux-2.6.20-rc6-mm1/arch/i386/boot/video.S,v
retrieving revision 1.1.1.1
diff -u -p -B -r1.1.1.1 video.S
--- linux-2.6.20-rc6-mm1/arch/i386/boot/video.S 30 Jan 2007 05:28:31 -0000 1.1.1.1
+++ linux-2.6.20-rc6-mm1/arch/i386/boot/video.S 15 Feb 2007 16:27:32 -0000
@@ -1945,6 +1945,20 @@ store_edid:
rep
stosl

+ pushw %es
+ pushw %ds
+ popw %es
+ leaw modelist+1024, %di
+ movw $0x4f00, %ax
+ int $0x10
+ popw %es
+
+ cmpw $0x004f, %ax
+ jne no_edid
+
+ cmpw $0x0102, 4(%di) # only do EDID on > 1.2
+ je no_edid
+
pushw %es # save ES
xorw %di, %di # Report Capability
pushw %di
Index: linux-2.6.20-rc6-mm1/arch/x86_64/boot/video.S
===================================================================
RCS file: /home/cvsroot/linux-2.6.20-rc6-mm1/arch/x86_64/boot/video.S,v
retrieving revision 1.1.1.1
diff -u -p -B -r1.1.1.1 video.S
--- linux-2.6.20-rc6-mm1/arch/x86_64/boot/video.S 30 Jan 2007 05:28:36 -0000 1.1.1.1
+++ linux-2.6.20-rc6-mm1/arch/x86_64/boot/video.S 15 Feb 2007 16:27:32 -0000
@@ -1945,6 +1945,20 @@ store_edid:
rep
stosl

+ pushw %es
+ pushw %ds
+ popw %es
+ leaw modelist+1024, %di
+ movw $0x4f00, %ax
+ int $0x10
+ popw %es
+
+ cmpw $0x004f, %ax
+ jne no_edid
+
+ cmpw $0x0102, 4(%di) # only do EDID on > 1.2
+ je no_edid
+
pushw %es # save ES
xorw %di, %di # Report Capability
pushw %di


2007-02-15 20:45:53

by Randy Dunlap

[permalink] [raw]
Subject: Re: [PATCH] Don't probe for DDC on VBE1.2

On Thu, 15 Feb 2007 08:29:49 -0800 (PST) Zwane Mwaikambo wrote:

> VBE1.2 doesn't support function 15h (DDC) resulting in a 'hang' whilst
> uncompressing kernel with some video cards. Make sure we check VBE version
> before fiddling around with DDC.
>
> http://bugzilla.kernel.org/show_bug.cgi?id=1458
>
> Opened: 2003-10-30 09:12 Last update: 2007-02-13 22:03
>
> :(

true.

Just one question: why use 'je' instead of 'jle' (jge ?) : check for
current version <= 0x0102, whatever that is in gas; I'm still used
to intel syntax.

> Much thanks to Tobias Hain for help in testing and investigating the bug.
> Tested on;
>
> i386, Chips & Technologies 65548 VESA VBE 1.2
> CONFIG_VIDEO_SELECT=Y
> CONFIG_FIRMWARE_EDID=Y
>
> Untested on x86_64.
>
> Signed-off-by: Zwane Mwaikambo <[email protected]>
>
> Index: linux-2.6.20-rc6-mm1/arch/i386/boot/video.S
> ===================================================================
> RCS file: /home/cvsroot/linux-2.6.20-rc6-mm1/arch/i386/boot/video.S,v
> retrieving revision 1.1.1.1
> diff -u -p -B -r1.1.1.1 video.S
> --- linux-2.6.20-rc6-mm1/arch/i386/boot/video.S 30 Jan 2007 05:28:31 -0000 1.1.1.1
> +++ linux-2.6.20-rc6-mm1/arch/i386/boot/video.S 15 Feb 2007 16:27:32 -0000
> @@ -1945,6 +1945,20 @@ store_edid:
> rep
> stosl
>
> + pushw %es
> + pushw %ds
> + popw %es
> + leaw modelist+1024, %di
> + movw $0x4f00, %ax
> + int $0x10
> + popw %es
> +
> + cmpw $0x004f, %ax
> + jne no_edid
> +
> + cmpw $0x0102, 4(%di) # only do EDID on > 1.2
> + je no_edid
> +
> pushw %es # save ES
> xorw %di, %di # Report Capability
> pushw %di
> Index: linux-2.6.20-rc6-mm1/arch/x86_64/boot/video.S
> ===================================================================
> RCS file: /home/cvsroot/linux-2.6.20-rc6-mm1/arch/x86_64/boot/video.S,v
> retrieving revision 1.1.1.1
> diff -u -p -B -r1.1.1.1 video.S
> --- linux-2.6.20-rc6-mm1/arch/x86_64/boot/video.S 30 Jan 2007 05:28:36 -0000 1.1.1.1
> +++ linux-2.6.20-rc6-mm1/arch/x86_64/boot/video.S 15 Feb 2007 16:27:32 -0000
> @@ -1945,6 +1945,20 @@ store_edid:
> rep
> stosl
>
> + pushw %es
> + pushw %ds
> + popw %es
> + leaw modelist+1024, %di
> + movw $0x4f00, %ax
> + int $0x10
> + popw %es
> +
> + cmpw $0x004f, %ax
> + jne no_edid
> +
> + cmpw $0x0102, 4(%di) # only do EDID on > 1.2
> + je no_edid
> +
> pushw %es # save ES
> xorw %di, %di # Report Capability
> pushw %di
> -

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

2007-02-15 22:37:06

by Zwane Mwaikambo

[permalink] [raw]
Subject: Re: [PATCH] Don't probe for DDC on VBE1.2

On Thu, 15 Feb 2007, Randy Dunlap wrote:

> On Thu, 15 Feb 2007 08:29:49 -0800 (PST) Zwane Mwaikambo wrote:
>
> > VBE1.2 doesn't support function 15h (DDC) resulting in a 'hang' whilst
> > uncompressing kernel with some video cards. Make sure we check VBE version
> > before fiddling around with DDC.
> >
> > http://bugzilla.kernel.org/show_bug.cgi?id=1458
> >
> > Opened: 2003-10-30 09:12 Last update: 2007-02-13 22:03
> >
> > :(
>
> true.
>
> Just one question: why use 'je' instead of 'jle' (jge ?) : check for
> current version <= 0x0102, whatever that is in gas; I'm still used
> to intel syntax.

Good point;

Signed-off-by: Zwane Mwaikambo <[email protected]>

Index: linux-2.6.20-mm1/arch/i386/boot/video.S
===================================================================
RCS file: /home/cvsroot/linux-2.6.20-mm1/arch/i386/boot/video.S,v
retrieving revision 1.1.1.1
diff -u -p -B -r1.1.1.1 video.S
--- linux-2.6.20-mm1/arch/i386/boot/video.S 15 Feb 2007 17:35:57 -0000 1.1.1.1
+++ linux-2.6.20-mm1/arch/i386/boot/video.S 15 Feb 2007 22:28:34 -0000
@@ -1945,6 +1945,20 @@ store_edid:
rep
stosl

+ pushw %es
+ pushw %ds
+ popw %es
+ leaw modelist+1024, %di
+ movw $0x4f00, %ax
+ int $0x10
+ popw %es
+
+ cmpw $0x004f, %ax
+ jne no_edid
+
+ cmpw $0x0102, 4(%di) # only do EDID on > 1.2
+ jle no_edid
+
pushw %es # save ES
xorw %di, %di # Report Capability
pushw %di
Index: linux-2.6.20-mm1/arch/x86_64/boot/video.S
===================================================================
RCS file: /home/cvsroot/linux-2.6.20-mm1/arch/x86_64/boot/video.S,v
retrieving revision 1.1.1.1
diff -u -p -B -r1.1.1.1 video.S
--- linux-2.6.20-mm1/arch/x86_64/boot/video.S 15 Feb 2007 17:36:18 -0000 1.1.1.1
+++ linux-2.6.20-mm1/arch/x86_64/boot/video.S 15 Feb 2007 22:29:00 -0000
@@ -1945,6 +1945,20 @@ store_edid:
rep
stosl

+ pushw %es
+ pushw %ds
+ popw %es
+ leaw modelist+1024, %di
+ movw $0x4f00, %ax
+ int $0x10
+ popw %es
+
+ cmpw $0x004f, %ax
+ jne no_edid
+
+ cmpw $0x0102, 4(%di) # only do EDID on > 1.2
+ jle no_edid
+
pushw %es # save ES
xorw %di, %di # Report Capability
pushw %di

2007-02-16 04:57:20

by Andrew Morton

[permalink] [raw]
Subject: Re: [PATCH] Don't probe for DDC on VBE1.2

On Thu, 15 Feb 2007 08:29:49 -0800 (PST) Zwane Mwaikambo <[email protected]> wrote:

> VBE1.2 doesn't support function 15h (DDC) resulting in a 'hang' whilst
> uncompressing kernel with some video cards. Make sure we check VBE version
> before fiddling around with DDC.
>
> http://bugzilla.kernel.org/show_bug.cgi?id=1458
>
> Opened: 2003-10-30 09:12 Last update: 2007-02-13 22:03
>
> :(
>
> Much thanks to Tobias Hain for help in testing and investigating the bug.
> Tested on;
>
> i386, Chips & Technologies 65548 VESA VBE 1.2
> CONFIG_VIDEO_SELECT=Y
> CONFIG_FIRMWARE_EDID=Y
>
> Untested on x86_64.
>
> Signed-off-by: Zwane Mwaikambo <[email protected]>
>
> Index: linux-2.6.20-rc6-mm1/arch/i386/boot/video.S
> ===================================================================
> RCS file: /home/cvsroot/linux-2.6.20-rc6-mm1/arch/i386/boot/video.S,v
> retrieving revision 1.1.1.1
> diff -u -p -B -r1.1.1.1 video.S
> --- linux-2.6.20-rc6-mm1/arch/i386/boot/video.S 30 Jan 2007 05:28:31 -0000 1.1.1.1
> +++ linux-2.6.20-rc6-mm1/arch/i386/boot/video.S 15 Feb 2007 16:27:32 -0000
> @@ -1945,6 +1945,20 @@ store_edid:
> rep
> stosl
>
> + pushw %es
> + pushw %ds
> + popw %es
> + leaw modelist+1024, %di
> + movw $0x4f00, %ax
> + int $0x10
> + popw %es
> +
> + cmpw $0x004f, %ax
> + jne no_edid
> +
> + cmpw $0x0102, 4(%di) # only do EDID on > 1.2
> + je no_edid
> +
> pushw %es # save ES
> xorw %di, %di # Report Capability
> pushw %di

This makes the long-suffering-but-vigorously-defended Vaio come up with a
black display. Everything's working OK otherwise. Sort of a Black Screen
of Life. I wouldn't call it an improvement though.

2007-02-16 05:35:47

by Zwane Mwaikambo

[permalink] [raw]
Subject: Re: [PATCH] Don't probe for DDC on VBE1.2

On Thu, 15 Feb 2007, Andrew Morton wrote:

> This makes the long-suffering-but-vigorously-defended Vaio come up with a
> black display. Everything's working OK otherwise. Sort of a Black Screen
> of Life. I wouldn't call it an improvement though.

Bugger, what does your kernel commandline look like?

2007-02-16 05:45:21

by Andrew Morton

[permalink] [raw]
Subject: Re: [PATCH] Don't probe for DDC on VBE1.2

On Thu, 15 Feb 2007 21:35:35 -0800 (PST) Zwane Mwaikambo <[email protected]> wrote:

> On Thu, 15 Feb 2007, Andrew Morton wrote:
>
> > This makes the long-suffering-but-vigorously-defended Vaio come up with a
> > black display. Everything's working OK otherwise. Sort of a Black Screen
> > of Life. I wouldn't call it an improvement though.
>
> Bugger, what does your kernel commandline look like?

Kernel command line: ro root=LABEL=/ rhgb vga=0x263 clock=pit

http://userweb.kernel.org/~akpm/dmesg-sony.txt

2007-02-16 05:51:39

by Andrew Morton

[permalink] [raw]
Subject: Re: [PATCH] Don't probe for DDC on VBE1.2

On Thu, 15 Feb 2007 21:45:06 -0800 Andrew Morton <[email protected]> wrote:

> On Thu, 15 Feb 2007 21:35:35 -0800 (PST) Zwane Mwaikambo <[email protected]> wrote:
>
> > On Thu, 15 Feb 2007, Andrew Morton wrote:
> >
> > > This makes the long-suffering-but-vigorously-defended Vaio come up with a
> > > black display. Everything's working OK otherwise. Sort of a Black Screen
> > > of Life. I wouldn't call it an improvement though.
> >
> > Bugger, what does your kernel commandline look like?
>
> Kernel command line: ro root=LABEL=/ rhgb vga=0x263 clock=pit

Removing the vga=0x263 "fixes" it.

2007-02-16 06:20:06

by Zwane Mwaikambo

[permalink] [raw]
Subject: Re: [PATCH] Don't probe for DDC on VBE1.2

On Thu, 15 Feb 2007, Andrew Morton wrote:

> On Thu, 15 Feb 2007 21:45:06 -0800 Andrew Morton <[email protected]> wrote:
>
> > On Thu, 15 Feb 2007 21:35:35 -0800 (PST) Zwane Mwaikambo <[email protected]> wrote:
> >
> > > On Thu, 15 Feb 2007, Andrew Morton wrote:
> > >
> > > > This makes the long-suffering-but-vigorously-defended Vaio come up with a
> > > > black display. Everything's working OK otherwise. Sort of a Black Screen
> > > > of Life. I wouldn't call it an improvement though.
> > >
> > > Bugger, what does your kernel commandline look like?
> >
> > Kernel command line: ro root=LABEL=/ rhgb vga=0x263 clock=pit
>
> Removing the vga=0x263 "fixes" it.
>

Sorry i missed this earlier, could you also post up an Xorg.0.log (or
equivalent for your system).

Thanks,
Zwane

2007-02-16 07:02:58

by Andrew Morton

[permalink] [raw]
Subject: Re: [PATCH] Don't probe for DDC on VBE1.2

On Thu, 15 Feb 2007 21:59:06 -0800 (PST) Zwane Mwaikambo <[email protected]> wrote:

> On Thu, 15 Feb 2007, Andrew Morton wrote:
>
> > On Thu, 15 Feb 2007 21:45:06 -0800 Andrew Morton <[email protected]> wrote:
> >
> > > On Thu, 15 Feb 2007 21:35:35 -0800 (PST) Zwane Mwaikambo <[email protected]> wrote:
> > >
> > > > On Thu, 15 Feb 2007, Andrew Morton wrote:
> > > >
> > > > > This makes the long-suffering-but-vigorously-defended Vaio come up with a
> > > > > black display. Everything's working OK otherwise. Sort of a Black Screen
> > > > > of Life. I wouldn't call it an improvement though.
> > > >
> > > > Bugger, what does your kernel commandline look like?
> > >
> > > Kernel command line: ro root=LABEL=/ rhgb vga=0x263 clock=pit
> >
> > Removing the vga=0x263 "fixes" it.
> >
>
> Sorry i missed this earlier, could you also post up an Xorg.0.log (or
> equivalent for your system).
>

It's not an X problem - the screen is black immediately upon loading the
kernel.

But I guess you knew that and you're just after display info:
http://userweb.kernel.org/~akpm/Xorg.0.log.txt

2007-02-16 14:39:50

by Zwane Mwaikambo

[permalink] [raw]
Subject: Re: [PATCH] Don't probe for DDC on VBE1.2

On Thu, 15 Feb 2007, Andrew Morton wrote:

> It's not an X problem - the screen is black immediately upon loading the
> kernel.
>
> But I guess you knew that and you're just after display info:
> http://userweb.kernel.org/~akpm/Xorg.0.log.txt

Thanks, the X log told me your VBE version. I tried to reproduce it on my
thinkpad which seems to have a very similar video setup to no avail, Could
you test the following on the VAIO? If this isn't the case, i suspect i'm
corrupting your modelist.

P.s. Thanks for the vga=0x263!

Index: linux-2.6.20-mm1/arch/i386/boot/video.S
===================================================================
RCS file: /home/cvsroot/linux-2.6.20-mm1/arch/i386/boot/video.S,v
retrieving revision 1.1.1.1
diff -u -p -B -r1.1.1.1 video.S
--- linux-2.6.20-mm1/arch/i386/boot/video.S 15 Feb 2007 17:35:57 -0000 1.1.1.1
+++ linux-2.6.20-mm1/arch/i386/boot/video.S 16 Feb 2007 12:58:20 -0000
@@ -1945,6 +1945,25 @@ store_edid:
rep
stosl

+ pushw %es
+ pushw %ds
+ popw %es
+ leaw modelist+1024, %di
+ movw $0x02b3, %ax
+ movw %ax, (%di)
+ movw $0x9d4a, %ax
+ movw %ax, 2(%di) # set signature to "vbe2"
+
+ movw $0x4f00, %ax
+ int $0x10
+ popw %es
+
+ cmpw $0x004f, %ax
+ jne no_edid
+
+ cmpw $0x0200, 4(%di) # only do EDID on >= VBE2.0
+ jl no_edid
+
pushw %es # save ES
xorw %di, %di # Report Capability
pushw %di
Index: linux-2.6.20-mm1/arch/x86_64/boot/video.S
===================================================================
RCS file: /home/cvsroot/linux-2.6.20-mm1/arch/x86_64/boot/video.S,v
retrieving revision 1.1.1.1
diff -u -p -B -r1.1.1.1 video.S
--- linux-2.6.20-mm1/arch/x86_64/boot/video.S 15 Feb 2007 17:36:18 -0000 1.1.1.1
+++ linux-2.6.20-mm1/arch/x86_64/boot/video.S 16 Feb 2007 12:57:57 -0000
@@ -1945,6 +1945,25 @@ store_edid:
rep
stosl

+ pushw %es
+ pushw %ds
+ popw %es
+ leaw modelist+1024, %di
+ movw $0x02b3, %ax
+ movw %ax, (%di)
+ movw $0x9d4a, %ax
+ movw %ax, 2(%di) # set signature to "vbe2"
+
+ movw $0x4f00, %ax
+ int $0x10
+ popw %es
+
+ cmpw $0x004f, %ax
+ jne no_edid
+
+ cmpw $0x0200, 4(%di) # only do EDID on >= VBE2.0
+ jl no_edid
+
pushw %es # save ES
xorw %di, %di # Report Capability
pushw %di

2007-02-16 18:22:21

by Andrew Morton

[permalink] [raw]
Subject: Re: [PATCH] Don't probe for DDC on VBE1.2

On Fri, 16 Feb 2007 06:39:45 -0800 (PST) Zwane Mwaikambo <[email protected]> wrote:

> On Thu, 15 Feb 2007, Andrew Morton wrote:
>
> > It's not an X problem - the screen is black immediately upon loading the
> > kernel.
> >
> > But I guess you knew that and you're just after display info:
> > http://userweb.kernel.org/~akpm/Xorg.0.log.txt
>
> Thanks, the X log told me your VBE version. I tried to reproduce it on my
> thinkpad which seems to have a very similar video setup to no avail, Could
> you test the following on the VAIO? If this isn't the case, i suspect i'm
> corrupting your modelist.

It's still all black.

2007-02-17 08:36:00

by Zwane Mwaikambo

[permalink] [raw]
Subject: Re: [PATCH] Don't probe for DDC on VBE1.2

On Fri, 16 Feb 2007, Andrew Morton wrote:

> On Fri, 16 Feb 2007 06:39:45 -0800 (PST) Zwane Mwaikambo <[email protected]> wrote:
>
> > On Thu, 15 Feb 2007, Andrew Morton wrote:
> >
> > > It's not an X problem - the screen is black immediately upon loading the
> > > kernel.
> > >
> > > But I guess you knew that and you're just after display info:
> > > http://userweb.kernel.org/~akpm/Xorg.0.log.txt
> >
> > Thanks, the X log told me your VBE version. I tried to reproduce it on my
> > thinkpad which seems to have a very similar video setup to no avail, Could
> > you test the following on the VAIO? If this isn't the case, i suspect i'm
> > corrupting your modelist.
>
> It's still all black.

Ok it looks like i was corrupting the modelist. The following should take
care of your VAIO, but i haven't tested the failure case as Tobias is away
this weekend.

Index: linux-2.6.20-mm1/arch/i386/boot/video.S
===================================================================
RCS file: /home/cvsroot/linux-2.6.20-mm1/arch/i386/boot/video.S,v
retrieving revision 1.1.1.1
diff -u -p -B -r1.1.1.1 video.S
--- linux-2.6.20-mm1/arch/i386/boot/video.S 15 Feb 2007 17:35:57 -0000 1.1.1.1
+++ linux-2.6.20-mm1/arch/i386/boot/video.S 17 Feb 2007 08:29:11 -0000
@@ -571,6 +571,16 @@ setr1: lodsw
jmp _m_s

check_vesa:
+#ifdef CONFIG_FIRMWARE_EDID
+ leaw modelist+1024, %di
+ movw $0x4f00, %ax
+ int $0x10
+ cmpw $0x004f, %ax
+ jnz setbad
+
+ movw 4(%di), %ax
+ movw %ax, vbe_version
+#endif
leaw modelist+1024, %di
subb $VIDEO_FIRST_VESA>>8, %bh
movw %bx, %cx # Get mode information structure
@@ -1945,6 +1955,9 @@ store_edid:
rep
stosl

+ cmpw $0x0200, vbe_version # only do EDID on >= VBE2.0
+ jl no_edid
+
pushw %es # save ES
xorw %di, %di # Report Capability
pushw %di
@@ -1987,6 +2000,7 @@ do_restore: .byte 0 # Screen contents al
svga_prefix: .byte VIDEO_FIRST_BIOS>>8 # Default prefix for BIOS modes
graphic_mode: .byte 0 # Graphic mode with a linear frame buffer
dac_size: .byte 6 # DAC bit depth
+vbe_version: .word 0 # VBE bios version

# Status messages
keymsg: .ascii "Press <RETURN> to see video modes available, "
Index: linux-2.6.20-mm1/arch/x86_64/boot/video.S
===================================================================
RCS file: /home/cvsroot/linux-2.6.20-mm1/arch/x86_64/boot/video.S,v
retrieving revision 1.1.1.1
diff -u -p -B -r1.1.1.1 video.S
--- linux-2.6.20-mm1/arch/x86_64/boot/video.S 15 Feb 2007 17:36:18 -0000 1.1.1.1
+++ linux-2.6.20-mm1/arch/x86_64/boot/video.S 17 Feb 2007 08:29:11 -0000
@@ -571,6 +571,16 @@ setr1: lodsw
jmp _m_s

check_vesa:
+#ifdef CONFIG_FIRMWARE_EDID
+ leaw modelist+1024, %di
+ movw $0x4f00, %ax
+ int $0x10
+ cmpw $0x004f, %ax
+ jnz setbad
+
+ movw 4(%di), %ax
+ movw %ax, vbe_version
+#endif
leaw modelist+1024, %di
subb $VIDEO_FIRST_VESA>>8, %bh
movw %bx, %cx # Get mode information structure
@@ -1945,6 +1955,9 @@ store_edid:
rep
stosl

+ cmpw $0x0200, vbe_version # only do EDID on >= VBE2.0
+ jl no_edid
+
pushw %es # save ES
xorw %di, %di # Report Capability
pushw %di
@@ -1987,6 +2000,7 @@ do_restore: .byte 0 # Screen contents al
svga_prefix: .byte VIDEO_FIRST_BIOS>>8 # Default prefix for BIOS modes
graphic_mode: .byte 0 # Graphic mode with a linear frame buffer
dac_size: .byte 6 # DAC bit depth
+vbe_version: .word 0 # VBE bios version

# Status messages
keymsg: .ascii "Press <RETURN> to see video modes available, "

2007-02-17 08:49:59

by Andrew Morton

[permalink] [raw]
Subject: Re: [PATCH] Don't probe for DDC on VBE1.2

On Sat, 17 Feb 2007 00:35:52 -0800 (PST) Zwane Mwaikambo <[email protected]> wrote:

> On Fri, 16 Feb 2007, Andrew Morton wrote:
>
> > On Fri, 16 Feb 2007 06:39:45 -0800 (PST) Zwane Mwaikambo <[email protected]> wrote:
> >
> > > On Thu, 15 Feb 2007, Andrew Morton wrote:
> > >
> > > > It's not an X problem - the screen is black immediately upon loading the
> > > > kernel.
> > > >
> > > > But I guess you knew that and you're just after display info:
> > > > http://userweb.kernel.org/~akpm/Xorg.0.log.txt
> > >
> > > Thanks, the X log told me your VBE version. I tried to reproduce it on my
> > > thinkpad which seems to have a very similar video setup to no avail, Could
> > > you test the following on the VAIO? If this isn't the case, i suspect i'm
> > > corrupting your modelist.
> >
> > It's still all black.
>
> Ok it looks like i was corrupting the modelist. The following should take
> care of your VAIO, but i haven't tested the failure case as Tobias is away
> this weekend.

yup, no longer all black.

2007-02-18 18:57:57

by Tobias Hain

[permalink] [raw]
Subject: AW: [PATCH] Don't probe for DDC on VBE1.2

> Ok it looks like i was corrupting the modelist. The following should take
> care of your VAIO, but i haven't tested the failure case as Tobias is away

> this weekend.

Yes, this last patch also works on VBE 1.2: It skips the EDID calls, which
would crash my system here, and consequently boots the kernel fine.

Thanks,
tobias

2007-02-18 21:55:43

by Andi Kleen

[permalink] [raw]
Subject: Re: [PATCH] Don't probe for DDC on VBE1.2

On Saturday 17 February 2007 09:35, Zwane Mwaikambo wrote:
> On Fri, 16 Feb 2007, Andrew Morton wrote:
>
> > On Fri, 16 Feb 2007 06:39:45 -0800 (PST) Zwane Mwaikambo <[email protected]> wrote:
> >
> > > On Thu, 15 Feb 2007, Andrew Morton wrote:
> > >
> > > > It's not an X problem - the screen is black immediately upon loading the
> > > > kernel.
> > > >
> > > > But I guess you knew that and you're just after display info:
> > > > http://userweb.kernel.org/~akpm/Xorg.0.log.txt
> > >
> > > Thanks, the X log told me your VBE version. I tried to reproduce it on my
> > > thinkpad which seems to have a very similar video setup to no avail, Could
> > > you test the following on the VAIO? If this isn't the case, i suspect i'm
> > > corrupting your modelist.
> >
> > It's still all black.
>
> Ok it looks like i was corrupting the modelist. The following should take
> care of your VAIO, but i haven't tested the failure case as Tobias is away
> this weekend.

I merged this version of the patch now. Still needs some x86-64 testing
I guess (any volunteers?), although I don't expect much trouble
because the early boot code is very similar.

-Andi

>

2007-02-19 00:37:52

by Zwane Mwaikambo

[permalink] [raw]
Subject: Re: [PATCH] Don't probe for DDC on VBE1.2

On Sun, 18 Feb 2007, Andi Kleen wrote:

> On Saturday 17 February 2007 09:35, Zwane Mwaikambo wrote:
> > On Fri, 16 Feb 2007, Andrew Morton wrote:
> >
> > > On Fri, 16 Feb 2007 06:39:45 -0800 (PST) Zwane Mwaikambo <[email protected]> wrote:
> > >
> > > > On Thu, 15 Feb 2007, Andrew Morton wrote:
> > > >
> > > > > It's not an X problem - the screen is black immediately upon loading the
> > > > > kernel.
> > > > >
> > > > > But I guess you knew that and you're just after display info:
> > > > > http://userweb.kernel.org/~akpm/Xorg.0.log.txt
> > > >
> > > > Thanks, the X log told me your VBE version. I tried to reproduce it on my
> > > > thinkpad which seems to have a very similar video setup to no avail, Could
> > > > you test the following on the VAIO? If this isn't the case, i suspect i'm
> > > > corrupting your modelist.
> > >
> > > It's still all black.
> >
> > Ok it looks like i was corrupting the modelist. The following should take
> > care of your VAIO, but i haven't tested the failure case as Tobias is away
> > this weekend.
>
> I merged this version of the patch now. Still needs some x86-64 testing
> I guess (any volunteers?), although I don't expect much trouble
> because the early boot code is very similar.

I tested the x86_64 VBE3 case (similar to Andrew's VAIO), so we just need
a VBE1.2 on x86_64 test.

Thanks,
Zwane

2007-02-19 10:52:24

by Andi Kleen

[permalink] [raw]
Subject: Re: [PATCH] Don't probe for DDC on VBE1.2


> I tested the x86_64 VBE3 case (similar to Andrew's VAIO), so we just need
> a VBE1.2 on x86_64 test.

Does this mean you want to have an updated patch or not?

-Andi

2007-02-19 12:33:27

by Zwane Mwaikambo

[permalink] [raw]
Subject: Re: [PATCH] Don't probe for DDC on VBE1.2

On Mon, 19 Feb 2007, Andi Kleen wrote:

>
> > I tested the x86_64 VBE3 case (similar to Andrew's VAIO), so we just need
> > a VBE1.2 on x86_64 test.
>
> Does this mean you want to have an updated patch or not?

Nope, i'm happy with the last patch i sent (below to reconfirm).

Thanks

Index: linux-2.6.20-mm1/arch/i386/boot/video.S
===================================================================
RCS file: /home/cvsroot/linux-2.6.20-mm1/arch/i386/boot/video.S,v
retrieving revision 1.1.1.1
diff -u -p -B -r1.1.1.1 video.S
--- linux-2.6.20-mm1/arch/i386/boot/video.S 15 Feb 2007 17:35:57 -0000 1.1.1.1
+++ linux-2.6.20-mm1/arch/i386/boot/video.S 17 Feb 2007 08:29:11 -0000
@@ -571,6 +571,16 @@ setr1: lodsw
jmp _m_s

check_vesa:
+#ifdef CONFIG_FIRMWARE_EDID
+ leaw modelist+1024, %di
+ movw $0x4f00, %ax
+ int $0x10
+ cmpw $0x004f, %ax
+ jnz setbad
+
+ movw 4(%di), %ax
+ movw %ax, vbe_version
+#endif
leaw modelist+1024, %di
subb $VIDEO_FIRST_VESA>>8, %bh
movw %bx, %cx # Get mode information structure
@@ -1945,6 +1955,9 @@ store_edid:
rep
stosl

+ cmpw $0x0200, vbe_version # only do EDID on >= VBE2.0
+ jl no_edid
+
pushw %es # save ES
xorw %di, %di # Report Capability
pushw %di
@@ -1987,6 +2000,7 @@ do_restore: .byte 0 # Screen contents al
svga_prefix: .byte VIDEO_FIRST_BIOS>>8 # Default prefix for BIOS modes
graphic_mode: .byte 0 # Graphic mode with a linear frame buffer
dac_size: .byte 6 # DAC bit depth
+vbe_version: .word 0 # VBE bios version

# Status messages
keymsg: .ascii "Press <RETURN> to see video modes available, "
Index: linux-2.6.20-mm1/arch/x86_64/boot/video.S
===================================================================
RCS file: /home/cvsroot/linux-2.6.20-mm1/arch/x86_64/boot/video.S,v
retrieving revision 1.1.1.1
diff -u -p -B -r1.1.1.1 video.S
--- linux-2.6.20-mm1/arch/x86_64/boot/video.S 15 Feb 2007 17:36:18 -0000 1.1.1.1
+++ linux-2.6.20-mm1/arch/x86_64/boot/video.S 17 Feb 2007 08:29:11 -0000
@@ -571,6 +571,16 @@ setr1: lodsw
jmp _m_s

check_vesa:
+#ifdef CONFIG_FIRMWARE_EDID
+ leaw modelist+1024, %di
+ movw $0x4f00, %ax
+ int $0x10
+ cmpw $0x004f, %ax
+ jnz setbad
+
+ movw 4(%di), %ax
+ movw %ax, vbe_version
+#endif
leaw modelist+1024, %di
subb $VIDEO_FIRST_VESA>>8, %bh
movw %bx, %cx # Get mode information structure
@@ -1945,6 +1955,9 @@ store_edid:
rep
stosl

+ cmpw $0x0200, vbe_version # only do EDID on >= VBE2.0
+ jl no_edid
+
pushw %es # save ES
xorw %di, %di # Report Capability
pushw %di
@@ -1987,6 +2000,7 @@ do_restore: .byte 0 # Screen contents al
svga_prefix: .byte VIDEO_FIRST_BIOS>>8 # Default prefix for BIOS modes
graphic_mode: .byte 0 # Graphic mode with a linear frame buffer
dac_size: .byte 6 # DAC bit depth
+vbe_version: .word 0 # VBE bios version

# Status messages
keymsg: .ascii "Press <RETURN> to see video modes available, "