// // QEMU Cirrus CLGD 54xx VGABIOS Extension. // // Copyright (c) 2004 Makoto Suzuki (suzu) // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //#define CIRRUS_VESA3_PMINFO #ifdef VBE #undef CIRRUS_VESA3_PMINFO #endif #define PM_BIOSMEM_CURRENT_MODE 0x449 #define PM_BIOSMEM_CRTC_ADDRESS 0x463 #define PM_BIOSMEM_VBE_MODE 0x4BA #define PM_BIOSMEM_VBE_POWER 0x4BC typedef struct { /* + 0 */ unsigned short mode; unsigned short width; unsigned short height; unsigned short depth; /* + 8 */ unsigned short hidden_dac; /* 0x3c6 */ unsigned short *seq; /* 0x3c4 */ unsigned short *graph; /* 0x3ce */ unsigned short *crtc; /* 0x3d4 */ /* +16 */ unsigned char bitsperpixel; unsigned char vesacolortype; unsigned char vesaredmask; unsigned char vesaredpos; unsigned char vesagreenmask; unsigned char vesagreenpos; unsigned char vesabluemask; unsigned char vesabluepos; /* +24 */ unsigned char vesareservedmask; unsigned char vesareservedpos; } cirrus_mode_t; #define CIRRUS_MODE_SIZE 26 /* For VESA BIOS 3.0 */ #define CIRRUS_PM16INFO_SIZE 20 /* VGA */ unsigned short cseq_vga[] = {0x0007,0xffff}; unsigned short cgraph_vga[] = {0x0009,0x000a,0x000b,0xffff}; unsigned short ccrtc_vga[] = {0x001a,0x001b,0x001d,0xffff}; /* extensions */ unsigned short cgraph_svgacolor[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x4005,0x0506,0x0f07,0xff08, 0x0009,0x000a,0x000b, 0xffff }; /* 640x480x8 */ unsigned short cseq_640x480x8[] = { 0x0300,0x2101,0x0f02,0x0003,0x0e04,0x1107, 0x580b,0x580c,0x580d,0x580e, 0x0412,0x0013,0x2017, 0x331b,0x331c,0x331d,0x331e, 0xffff }; unsigned short ccrtc_640x480x8[] = { 0x2c11, 0x5f00,0x4f01,0x4f02,0x8003,0x5204,0x1e05,0x0b06,0x3e07, 0x4009,0x000c,0x000d, 0xea10,0xdf12,0x5013,0x4014,0xdf15,0x0b16,0xc317,0xff18, 0x001a,0x221b,0x001d, 0xffff }; /* 640x480x16 */ unsigned short cseq_640x480x16[] = { 0x0300,0x2101,0x0f02,0x0003,0x0e04,0x1707, 0x580b,0x580c,0x580d,0x580e, 0x0412,0x0013,0x2017, 0x331b,0x331c,0x331d,0x331e, 0xffff }; unsigned short ccrtc_640x480x16[] = { 0x2c11, 0x5f00,0x4f01,0x4f02,0x8003,0x5204,0x1e05,0x0b06,0x3e07, 0x4009,0x000c,0x000d, 0xea10,0xdf12,0xa013,0x4014,0xdf15,0x0b16,0xc317,0xff18, 0x001a,0x221b,0x001d, 0xffff }; /* 640x480x24 */ unsigned short cseq_640x480x24[] = { 0x0300,0x2101,0x0f02,0x0003,0x0e04,0x1507, 0x580b,0x580c,0x580d,0x580e, 0x0412,0x0013,0x2017, 0x331b,0x331c,0x331d,0x331e, 0xffff }; unsigned short ccrtc_640x480x24[] = { 0x2c11, 0x5f00,0x4f01,0x4f02,0x8003,0x5204,0x1e05,0x0b06,0x3e07, 0x4009,0x000c,0x000d, 0xea10,0xdf12,0x0013,0x4014,0xdf15,0x0b16,0xc317,0xff18, 0x001a,0x321b,0x001d, 0xffff }; /* 800x600x8 */ unsigned short cseq_800x600x8[] = { 0x0300,0x2101,0x0f02,0x0003,0x0e04,0x1107, 0x230b,0x230c,0x230d,0x230e, 0x0412,0x0013,0x2017, 0x141b,0x141c,0x141d,0x141e, 0xffff }; unsigned short ccrtc_800x600x8[] = { 0x2311,0x7d00,0x6301,0x6302,0x8003,0x6b04,0x1a05,0x9806,0xf007, 0x6009,0x000c,0x000d, 0x7d10,0x5712,0x6413,0x4014,0x5715,0x9816,0xc317,0xff18, 0x001a,0x221b,0x001d, 0xffff }; /* 800x600x16 */ unsigned short cseq_800x600x16[] = { 0x0300,0x2101,0x0f02,0x0003,0x0e04,0x1707, 0x230b,0x230c,0x230d,0x230e, 0x0412,0x0013,0x2017, 0x141b,0x141c,0x141d,0x141e, 0xffff }; unsigned short ccrtc_800x600x16[] = { 0x2311,0x7d00,0x6301,0x6302,0x8003,0x6b04,0x1a05,0x9806,0xf007, 0x6009,0x000c,0x000d, 0x7d10,0x5712,0xc813,0x4014,0x5715,0x9816,0xc317,0xff18, 0x001a,0x221b,0x001d, 0xffff }; /* 800x600x24 */ unsigned short cseq_800x600x24[] = { 0x0300,0x2101,0x0f02,0x0003,0x0e04,0x1507, 0x230b,0x230c,0x230d,0x230e, 0x0412,0x0013,0x2017, 0x141b,0x141c,0x141d,0x141e, 0xffff }; unsigned short ccrtc_800x600x24[] = { 0x2311,0x7d00,0x6301,0x6302,0x8003,0x6b04,0x1a05,0x9806,0xf007, 0x6009,0x000c,0x000d, 0x7d10,0x5712,0x2c13,0x4014,0x5715,0x9816,0xc317,0xff18, 0x001a,0x321b,0x001d, 0xffff }; /* 1024x768x8 */ unsigned short cseq_1024x768x8[] = { 0x0300,0x2101,0x0f02,0x0003,0x0e04,0x1107, 0x760b,0x760c,0x760d,0x760e, 0x0412,0x0013,0x2017, 0x341b,0x341c,0x341d,0x341e, 0xffff }; unsigned short ccrtc_1024x768x8[] = { 0x2911,0xa300,0x7f01,0x7f02,0x8603,0x8304,0x9405,0x2406,0xf507, 0x6009,0x000c,0x000d, 0x0310,0xff12,0x8013,0x4014,0xff15,0x2416,0xc317,0xff18, 0x001a,0x221b,0x001d, 0xffff }; /* 1024x768x16 */ unsigned short cseq_1024x768x16[] = { 0x0300,0x2101,0x0f02,0x0003,0x0e04,0x1707, 0x760b,0x760c,0x760d,0x760e, 0x0412,0x0013,0x2017, 0x341b,0x341c,0x341d,0x341e, 0xffff }; unsigned short ccrtc_1024x768x16[] = { 0x2911,0xa300,0x7f01,0x7f02,0x8603,0x8304,0x9405,0x2406,0xf507, 0x6009,0x000c,0x000d, 0x0310,0xff1
#! /bin/sh
# A little script I whipped up to make it easy to
# patch source trees and have sane error handling
# -Erik
#
# (c) 2002 Erik Andersen <andersen@codepoet.org>
# Set directories from arguments, or use defaults.
targetdir=${1-.}
patchdir=${2-../kernel-patches}
patchpattern=${3-*}
if [ ! -d "${targetdir}" ] ; then
echo "Aborting. '${targetdir}' is not a directory."
exit 1
fi
if [ ! -d "${patchdir}" ] ; then
echo "Aborting. '${patchdir}' is not a directory."
exit 1
fi
for i in ${patchdir}/${patchpattern} ; do
case "$i" in
*.gz)
type="gzip"; uncomp="gunzip -dc"; ;;
*.bz)
type="bzip"; uncomp="bunzip -dc"; ;;
*.bz2)
type="bzip2"; uncomp="bunzip2 -dc"; ;;
*.zip)
type="zip"; uncomp="unzip -d"; ;;
*.Z)
type="compress"; uncomp="uncompress -c"; ;;
*)
type="plaintext"; uncomp="cat"; ;;
esac
[ -d "${i}" ] && echo "Ignoring subdirectory ${i}" && continue
echo ""
echo "Applying ${i} using ${type}: "
${uncomp} ${i} | ${PATCH:-patch} -f -p1 -d ${targetdir}
if [ $? != 0 ] ; then
echo "Patch failed! Please fix $i!"
exit 1
fi
done
# Check for rejects...
if [ "`find $targetdir/ '(' -name '*.rej' -o -name '.*.rej' ')' -print`" ] ; then
echo "Aborting. Reject files found."
exit 1
fi
# Remove backup files
find $targetdir/ '(' -name '*.orig' -o -name '.*.orig' ')' -exec rm -f {} \;