public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Daniel Drake <dsd@gentoo.org>
Cc: Jan Beulich <jbeulich@novell.com>,
	linux-kernel@vger.kernel.org, zwane@infradead.org,
	Andi Kleen <ak@suse.de>, "H. Peter Anvin" <hpa@zytor.com>,
	"Antonino A. Daplas" <adaplas@pol.net>
Subject: Re: [PATCH] retrieve VBE EDID/DDC info independent of used video mode
Date: Sun, 8 Jul 2007 11:14:04 -0700	[thread overview]
Message-ID: <20070708111404.1486e73c.akpm@linux-foundation.org> (raw)
In-Reply-To: <4690E65B.5050607@gentoo.org>

On Sun, 08 Jul 2007 09:27:55 -0400 Daniel Drake <dsd@gentoo.org> wrote:

> Andrew Morton wrote:
> > On Sat, 30 Jun 2007 18:25:31 -0400 Daniel Drake <dsd@gentoo.org> wrote:
> >> This patch solves a 2.6.20.11 (and 2.6.21) regression added by the patch 
> >> titled "x86: Don't probe for DDC on VBE1.2"
> >>
> >> The regression caused the screen resolution to be incorrectly adjusted 
> >> by 6 pixels. This patch makes it go back to normal again.
> >>
> >> https://bugs.gentoo.org/show_bug.cgi?id=181067
> >>
> >> Please apply this patch or discuss further :)
> > 
> > Well drat.  I didn't merge the patch because it conflicts with
> > git-newsetup, and Peter believes that git-newsetup already contains an
> > equivalent fix.  Testing 2.6.22-rc6-mm1 would confirm that.  Please.
> 
> 2.6.22-rc6-mm1 has the same problem (it is not fixed there).
> 

Well damn, we've let this slide for too long.

Guys, 2.6.22 is days away.  Do we think that the below is safe to merge
now?

Add Daniel, this does fix things for you, doesn't it?


From: "Jan Beulich" <jbeulich@novell.com>

The code to retrieve this information was (a) inside a CONFIG_VIDEO_SELECT
section and (b) protected by a check of a variable (vbe_version) that would
get initialized only when a VESA mode was selected on the command line.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Cc: Daniel Drake <dsd@gentoo.org>
Cc: Andi Kleen <ak@suse.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/i386/boot/video.S |   28 ++++++++++++++++++----------
 1 file changed, 18 insertions(+), 10 deletions(-)

diff -puN arch/i386/boot/video.S~retrieve-vbe-edid-ddc-info-independent-of-used-video arch/i386/boot/video.S
--- a/arch/i386/boot/video.S~retrieve-vbe-edid-ddc-info-independent-of-used-video
+++ a/arch/i386/boot/video.S
@@ -96,6 +96,7 @@
 #define PARAM_LFB_PAGES		0x32
 #define PARAM_VESA_ATTRIB	0x34
 #define PARAM_CAPABILITIES	0x36
+#define PARAM_EDID_INFO		0x140
 
 /* Define DO_STORE according to CONFIG_VIDEO_RETAIN */
 #ifdef CONFIG_VIDEO_RETAIN
@@ -132,8 +133,8 @@ vid1:
 #ifdef CONFIG_VIDEO_RETAIN
 	call	restore_screen			# Restore screen contents
 #endif /* CONFIG_VIDEO_RETAIN */
-	call	store_edid
 #endif /* CONFIG_VIDEO_SELECT */
+	call	store_edid
 	call	mode_params			# Store mode parameters
 	popw	%ds				# Restore original DS
 	ret
@@ -571,16 +572,12 @@ 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
@@ -1935,6 +1932,7 @@ skip10:	movb	%ah, %al
 	popw	%cx
 	popw	%ax
 	ret
+#endif /* CONFIG_VIDEO_SELECT */
 
 store_edid:
 #ifdef CONFIG_FIRMWARE_EDID
@@ -1945,18 +1943,28 @@ store_edid:
 	pushw	%dx
 	pushw   %di
 
+	pushw	%ds
+	popw    %es
+	leaw	modelist, %di
+	movw	$0x4f00, %ax
+	int	$0x10
+	cmpw	$0x004f, %ax
+	setne	%dl
+	cmpw	$0x0200, 4(%di)			# only do EDID on >= VBE2.0
+	adc	%dl, %dl
+
 	pushw	%fs
 	popw    %es
 
 	movl	$0x13131313, %eax		# memset block with 0x13
 	movw    $32, %cx
-	movw	$0x140, %di
+	movw	$PARAM_EDID_INFO, %di
 	cld
 	rep
 	stosl
 
-	cmpw	$0x0200, vbe_version		# only do EDID on >= VBE2.0
-	jl	no_edid
+	testb	%dl, %dl
+	jnz	no_edid
 
 	pushw   %es				# save ES
 	xorw    %di, %di                        # Report Capability
@@ -1978,7 +1986,7 @@ store_edid:
 	movw	$0x01, %bx
 	movw	$0x00, %cx
 	movw    $0x00, %dx
-	movw	$0x140, %di
+	movw	$PARAM_EDID_INFO, %di
 	int	$0x10
 
 no_edid:
@@ -1991,6 +1999,7 @@ no_edid:
 #endif
 	ret
 
+#ifdef CONFIG_VIDEO_SELECT
 # VIDEO_SELECT-only variables
 mt_end:		.word	0	# End of video mode table if built
 edit_buf:	.space	6	# Line editor buffer
@@ -2000,7 +2009,6 @@ 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, "
_


  reply	other threads:[~2007-07-08 18:14 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-19 15:57 [PATCH] retrieve VBE EDID/DDC info independent of used video mode Jan Beulich
2007-06-30 22:25 ` Daniel Drake
2007-06-30 22:42   ` Andrew Morton
2007-07-08 13:27     ` Daniel Drake
2007-07-08 18:14       ` Andrew Morton [this message]
2007-07-08 18:33         ` H. Peter Anvin
2007-07-09 22:53           ` Daniel Drake
2007-07-09 22:59             ` H. Peter Anvin
2007-07-10 17:16               ` Daniel Drake
2007-07-10 17:23                 ` H. Peter Anvin
2007-07-10 18:07                   ` Daniel Drake
2007-07-10 18:15                     ` H. Peter Anvin
2007-07-31 23:58                       ` Daniel Drake
2007-08-01  0:21                         ` Zwane Mwaikambo
2007-08-01  1:17                           ` Daniel Drake
2007-08-01  1:53                             ` H. Peter Anvin
2007-08-01  1:54                             ` Antonino A. Daplas
2007-08-01  2:08                               ` Gabriel C
2007-08-02  3:09                               ` Antonino A. Daplas
2007-08-02  3:50                                 ` H. Peter Anvin
2007-08-02 10:16                                   ` Antonino A. Daplas
2007-08-02 13:23                                     ` H. Peter Anvin
2007-08-03  2:33                                     ` Daniel Drake
2007-08-03  3:33                                       ` Antonino A. Daplas
2007-08-01  1:04                         ` Antonino A. Daplas
2007-07-08 19:48         ` Andi Kleen
2007-07-09  1:10         ` Daniel Drake
2007-07-09  0:48       ` H. Peter Anvin
2007-07-02 20:13   ` Chuck Ebbert

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=20070708111404.1486e73c.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=adaplas@pol.net \
    --cc=ak@suse.de \
    --cc=dsd@gentoo.org \
    --cc=hpa@zytor.com \
    --cc=jbeulich@novell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zwane@infradead.org \
    /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