Commit 1bb52cc9 authored by Aaro Koskinen's avatar Aaro Koskinen Committed by Greg Kroah-Hartman

staging: xgifb: delete legacy DAC data

Delete DAC data for unsupported legacy modes.
Signed-off-by: default avatarAaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a157961c
...@@ -16,36 +16,6 @@ ...@@ -16,36 +16,6 @@
#define IndexMask 0xff #define IndexMask 0xff
static const unsigned short XGINew_MDA_DAC[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15,
0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15,
0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15,
0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15,
0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F};
static const unsigned short XGINew_CGA_DAC[] = {
0x00, 0x10, 0x04, 0x14, 0x01, 0x11, 0x09, 0x15,
0x00, 0x10, 0x04, 0x14, 0x01, 0x11, 0x09, 0x15,
0x2A, 0x3A, 0x2E, 0x3E, 0x2B, 0x3B, 0x2F, 0x3F,
0x2A, 0x3A, 0x2E, 0x3E, 0x2B, 0x3B, 0x2F, 0x3F,
0x00, 0x10, 0x04, 0x14, 0x01, 0x11, 0x09, 0x15,
0x00, 0x10, 0x04, 0x14, 0x01, 0x11, 0x09, 0x15,
0x2A, 0x3A, 0x2E, 0x3E, 0x2B, 0x3B, 0x2F, 0x3F,
0x2A, 0x3A, 0x2E, 0x3E, 0x2B, 0x3B, 0x2F, 0x3F};
static const unsigned short XGINew_EGA_DAC[] = {
0x00, 0x10, 0x04, 0x14, 0x01, 0x11, 0x05, 0x15,
0x20, 0x30, 0x24, 0x34, 0x21, 0x31, 0x25, 0x35,
0x08, 0x18, 0x0C, 0x1C, 0x09, 0x19, 0x0D, 0x1D,
0x28, 0x38, 0x2C, 0x3C, 0x29, 0x39, 0x2D, 0x3D,
0x02, 0x12, 0x06, 0x16, 0x03, 0x13, 0x07, 0x17,
0x22, 0x32, 0x26, 0x36, 0x23, 0x33, 0x27, 0x37,
0x0A, 0x1A, 0x0E, 0x1E, 0x0B, 0x1B, 0x0F, 0x1F,
0x2A, 0x3A, 0x2E, 0x3E, 0x2B, 0x3B, 0x2F, 0x3F};
static const unsigned short XGINew_VGA_DAC[] = { static const unsigned short XGINew_VGA_DAC[] = {
0x00, 0x10, 0x04, 0x14, 0x01, 0x11, 0x09, 0x15, 0x00, 0x10, 0x04, 0x14, 0x01, 0x11, 0x09, 0x15,
0x2A, 0x3A, 0x2E, 0x3E, 0x2B, 0x3B, 0x2F, 0x3F, 0x2A, 0x3A, 0x2E, 0x3E, 0x2B, 0x3B, 0x2F, 0x3F,
...@@ -1393,34 +1363,13 @@ static void XGI_WriteDAC(unsigned short dl, ...@@ -1393,34 +1363,13 @@ static void XGI_WriteDAC(unsigned short dl,
static void XGI_LoadDAC(unsigned short ModeNo, unsigned short ModeIdIndex, static void XGI_LoadDAC(unsigned short ModeNo, unsigned short ModeIdIndex,
struct vb_device_info *pVBInfo) struct vb_device_info *pVBInfo)
{ {
unsigned short data, data2, time, i, j, k, m, n, o, si, di, bx, dl, al, unsigned short data, data2, i, k, m, n, o, si, di, bx, dl, al, ah, dh;
ah, dh; const unsigned short *table = XGINew_VGA_DAC;
const unsigned short *table = NULL;
data = pVBInfo->EModeIDTable[ModeIdIndex].Ext_ModeFlag;
data &= DACInfoFlag;
time = 64;
if (data == 0x00)
table = XGINew_MDA_DAC;
else if (data == 0x08)
table = XGINew_CGA_DAC;
else if (data == 0x10)
table = XGINew_EGA_DAC;
else if (data == 0x18) {
time = 256;
table = XGINew_VGA_DAC;
}
if (time == 256)
j = 16;
else
j = time;
outb(0xFF, pVBInfo->P3c6); outb(0xFF, pVBInfo->P3c6);
outb(0x00, pVBInfo->P3c8); outb(0x00, pVBInfo->P3c8);
for (i = 0; i < j; i++) { for (i = 0; i < 16; i++) {
data = table[i]; data = table[i];
for (k = 0; k < 3; k++) { for (k = 0; k < 3; k++) {
...@@ -1437,45 +1386,43 @@ static void XGI_LoadDAC(unsigned short ModeNo, unsigned short ModeIdIndex, ...@@ -1437,45 +1386,43 @@ static void XGI_LoadDAC(unsigned short ModeNo, unsigned short ModeIdIndex,
} }
} }
if (time == 256) { for (i = 16; i < 32; i++) {
for (i = 16; i < 32; i++) { data = table[i];
data = table[i];
for (k = 0; k < 3; k++)
outb(data, pVBInfo->P3c9);
}
si = 32; for (k = 0; k < 3; k++)
outb(data, pVBInfo->P3c9);
}
for (m = 0; m < 9; m++) { si = 32;
di = si;
bx = si + 0x04;
dl = 0;
for (n = 0; n < 3; n++) { for (m = 0; m < 9; m++) {
for (o = 0; o < 5; o++) { di = si;
dh = table[si]; bx = si + 0x04;
ah = table[di]; dl = 0;
al = table[bx];
si++;
XGI_WriteDAC(dl, ah, al, dh, pVBInfo);
}
si -= 2; for (n = 0; n < 3; n++) {
for (o = 0; o < 5; o++) {
dh = table[si];
ah = table[di];
al = table[bx];
si++;
XGI_WriteDAC(dl, ah, al, dh, pVBInfo);
}
for (o = 0; o < 3; o++) { si -= 2;
dh = table[bx];
ah = table[di];
al = table[si];
si--;
XGI_WriteDAC(dl, ah, al, dh, pVBInfo);
}
dl++; for (o = 0; o < 3; o++) {
dh = table[bx];
ah = table[di];
al = table[si];
si--;
XGI_WriteDAC(dl, ah, al, dh, pVBInfo);
} }
si += 5; dl++;
} }
si += 5;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment