[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] vgabios: Check if mode is currently supported as vesa specifications
# HG changeset patch # User Frediano Ziglio <frediano.ziglio@xxxxxxxxxx> # Date 1336394337 -3600 # Node ID 5097d77b057b7cb4ccf6d05923a960b562a74d03 # Parent 8579bff9dc3f1aaf5543fc71d1c0f5e5c81f5222 vgabios: Check if mode is currently supported as vesa specifications Vesa specification require that mode information return if a given mode is supported or not so test if we can support it checking required memory and set correctly supported bit. Signed-off-by: Frediano Ziglio <frediano.ziglio@xxxxxxxxxx> Committed-by: Keir Fraser <keir@xxxxxxx> --- diff -r 8579bff9dc3f -r 5097d77b057b tools/firmware/vgabios/vbe.c --- a/tools/firmware/vgabios/vbe.c Mon May 07 13:38:23 2012 +0100 +++ b/tools/firmware/vgabios/vbe.c Mon May 07 13:38:57 2012 +0100 @@ -928,10 +928,22 @@ Bit16u *AX;Bit16u CX; Bit16u ES;Bit16u D if (cur_info != 0) { + Bit16u max_bpp = dispi_get_max_bpp(); + Bit16u size_64k; + Bit16u totalMemory; + + outw(VBE_DISPI_IOPORT_INDEX, VBE_DISPI_INDEX_VIDEO_MEMORY_64K); + totalMemory = inw(VBE_DISPI_IOPORT_DATA); #ifdef DEBUG printf("VBE found mode %x\n",CX); #endif memcpyb(ss, &info, 0xc000, &(cur_info->info), sizeof(ModeInfoBlockCompact)); + size_64k = size64(info.XResolution, info.YResolution, info.BitsPerPixel); + if ((info.XResolution > dispi_get_max_xres()) || + (info.BitsPerPixel > max_bpp) || + (size_64k > totalMemory)) + info.ModeAttributes &= ~VBE_MODE_ATTRIBUTE_SUPPORTED; + if (using_lfb) { info.NumberOfBanks = 1; } _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |