Date: Thu, 16 Feb 2012 22:46:00 +0000 (UTC) From: Jung-uk Kim <jkim@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r231842 - head/sys/dev/fb Message-ID: <201202162246.q1GMk0YA037939@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jkim Date: Thu Feb 16 22:46:00 2012 New Revision: 231842 URL: http://svn.freebsd.org/changeset/base/231842 Log: Make sure the VESA mode number is between 256 and 511 inclusive. Modified: head/sys/dev/fb/vesa.c Modified: head/sys/dev/fb/vesa.c ============================================================================== --- head/sys/dev/fb/vesa.c Thu Feb 16 22:33:53 2012 (r231841) +++ head/sys/dev/fb/vesa.c Thu Feb 16 22:46:00 2012 (r231842) @@ -1311,7 +1311,9 @@ vesa_set_mode(video_adapter_t *adp, int if (!(info.vi_flags & V_INFO_GRAPHICS)) info.vi_flags &= ~V_INFO_LINEAR; - if (vesa_bios_set_mode(mode | ((info.vi_flags & V_INFO_LINEAR) ? 0x4000 : 0))) + if ((info.vi_flags & V_INFO_LINEAR) != 0) + mode |= 0x4000; + if (vesa_bios_set_mode(mode)) return (1); /* Palette format is reset by the above VBE function call. */ @@ -1329,7 +1331,7 @@ vesa_set_mode(video_adapter_t *adp, int #if VESA_DEBUG > 0 printf("VESA: mode set!\n"); #endif - vesa_adp->va_mode = mode; + vesa_adp->va_mode = mode & 0x1ff; /* Mode number is 9-bit. */ vesa_adp->va_flags &= ~V_ADP_COLOR; vesa_adp->va_flags |= (info.vi_flags & V_INFO_COLOR) ? V_ADP_COLOR : 0;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201202162246.q1GMk0YA037939>