MFC r1.28:
authorSascha Wildner <swildner@dragonflybsd.org>
Sat, 13 Sep 2008 23:46:36 +0000 (13 23:46 +0000)
committerSascha Wildner <swildner@dragonflybsd.org>
Sat, 13 Sep 2008 23:46:36 +0000 (13 23:46 +0000)
Add line width calculations for 15/16 and 24/32 bit modes in case
the "Get Scan Line Length" function fails, as it does in Parallels
(in Version 2.2, Build 2112 at least).

sys/dev/video/i386/vesa/vesa.c

index d6d6f4a..4568195 100644 (file)
@@ -24,7 +24,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/i386/isa/vesa.c,v 1.32.2.1 2002/08/13 02:42:33 rwatson Exp $
- * $DragonFly: src/sys/dev/video/i386/vesa/vesa.c,v 1.25 2008/04/30 04:05:21 dillon Exp $
+ * $DragonFly: src/sys/dev/video/i386/vesa/vesa.c,v 1.25.2.1 2008/09/13 23:46:36 swildner Exp $
  */
 
 #include "opt_vga.h"
@@ -1072,6 +1072,14 @@ vesa_set_mode(video_adapter_t *adp, int mode)
                default: /* shouldn't happen */
                        vesa_adp->va_line_width = info.vi_width;
                        break;
+               case 15:
+               case 16:
+                       vesa_adp->va_line_width = info.vi_width*2;
+                       break;
+               case 24:
+               case 32:
+                       vesa_adp->va_line_width = info.vi_width*4;
+                       break;
                }
        } else {
                vesa_adp->va_line_width = info.vi_width;