From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762021AbXELAtl (ORCPT ); Fri, 11 May 2007 20:49:41 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755033AbXELAte (ORCPT ); Fri, 11 May 2007 20:49:34 -0400 Received: from ebiederm.dsl.xmission.com ([166.70.28.69]:54283 "EHLO ebiederm.dsl.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754732AbXELAtd (ORCPT ); Fri, 11 May 2007 20:49:33 -0400 From: ebiederm@xmission.com (Eric W. Biederman) To: Gerd Hoffmann Cc: lkml - Kernel Mailing List , Rusty Russell , Andi Kleen , Alan , Ingo Molnar Subject: Re: [patch] Refine SCREEN_INFO sanity check for vgacon initialization. References: <46444F3F.6010308@redhat.com> Date: Fri, 11 May 2007 18:48:47 -0600 In-Reply-To: <46444F3F.6010308@redhat.com> (Gerd Hoffmann's message of "Fri, 11 May 2007 13:10:55 +0200") Message-ID: User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Gerd Hoffmann writes: > Hi, > > Checking video mode field only to see whenever SCREEN_INFO is > initialized is not enougth, in some cases it is zero although > a vga card is present. Lets additionally check cols and lines. Acked-by: "Eric W. Biederman" > > Updates f82af20e1a028e16b9bb11da081fa1148d40fa6a, should go > into 2.6.22. > > please apply, > Gerd > > Refine SCREEN_INFO sanity check for vgacon initialization. > > Checking video mode field only to see whenever SCREEN_INFO is > initialized is not enougth, in some cases it is zero although > a vga card is present. Lets additionally check cols and lines. > > Signed-off-by: Gerd Hoffmann > Cc: Rusty Russell > Cc: Andi Kleen > Cc: Alan > Cc: Ingo Molnar > Cc: Eric W. Biederman > --- > drivers/video/console/vgacon.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > Index: vanilla-2.6.21-git11/drivers/video/console/vgacon.c > =================================================================== > --- vanilla-2.6.21-git11.orig/drivers/video/console/vgacon.c > +++ vanilla-2.6.21-git11/drivers/video/console/vgacon.c > @@ -368,9 +368,14 @@ static const char *vgacon_startup(void) > #endif > } > > + /* SCREEN_INFO initialized? */ > + if ((ORIG_VIDEO_MODE == 0) && > + (ORIG_VIDEO_LINES == 0) && > + (ORIG_VIDEO_COLS == 0)) > + goto no_vga; > + > /* VGA16 modes are not handled by VGACON */ > - if ((ORIG_VIDEO_MODE == 0x00) || /* SCREEN_INFO not initialized */ > - (ORIG_VIDEO_MODE == 0x0D) || /* 320x200/4 */ > + if ((ORIG_VIDEO_MODE == 0x0D) || /* 320x200/4 */ > (ORIG_VIDEO_MODE == 0x0E) || /* 640x200/4 */ > (ORIG_VIDEO_MODE == 0x10) || /* 640x350/4 */ > (ORIG_VIDEO_MODE == 0x12) || /* 640x480/4 */