Chameleon

Chameleon Commit Details

Date:2011-06-03 20:49:23 (8 years 1 month ago)
Author:Sergey Slice
Commit:947
Parents: 946
Message:merged full EDID parser
Changes:
M/trunk/i386/modules/Resolution/include/edid.h
M/trunk/i386/modules/Resolution/915resolution.c
M/trunk/i386/modules/Resolution/edid.c
M/trunk/i386/modules/Resolution/915resolution.h

File differences

trunk/i386/modules/Resolution/915resolution.c
1111
1212
1313
14
15
14
15
1616
1717
1818
......
2121
2222
2323
24
2425
25
2626
2727
2828
......
321321
322322
323323
324
324
325325
326326
327327
......
581581
582582
583583
584
585
584
585
586
587
588
589
590
586591
587592
588593
......
591596
592597
593598
599
594600
595
596601
597602
598603
......
631636
632637
633638
639
640
641
634642
635643
636644
#ifndef _RESOLUTION_H_
#define _RESOLUTION_H_
#include "libsaio.h"
#include "edid.h"
//#include "libsaio.h"
//#include "edid.h" //included
#include "915resolution.h"
UInt32 x = 0, y = 0, bp = 0;
getResolution(&x, &y, &bp);
verbose("getResolution: %dx%dx%d\n", (int)x, (int)y, (int)bp);
if (x != 0 &&
y != 0 &&
bp != 0)
int i = 0;
while (i < 512)
{ // we don't need to look through the whole bios, just the firs 512 bytes
{ // we don't need to look through the whole bios, just the first 512 bytes
if ((map->bios_ptr[i] == 'N')
&& (map->bios_ptr[i+1] == 'V')
&& (map->bios_ptr[i+2] == 'I')
char* edidInfo = readEDID();
if(!edidInfo) return 1;
mode->pixel_clock = (edidInfo[55] << 8) | edidInfo[54];
//Slice
if(!fb_parse_edid((struct EDID *)edidInfo, mode))
{
free( edidInfo );
return 1;
}
/*mode->pixel_clock = (edidInfo[55] << 8) | edidInfo[54];
mode->h_active = edidInfo[56] | ((edidInfo[58] & 0xF0) << 4);
mode->h_blanking = ((edidInfo[58] & 0x0F) << 8) | edidInfo[57];
mode->v_active = edidInfo[59] | ((edidInfo[61] & 0xF0) << 4);
mode->h_sync_width = (edidInfo[65] & 0x30) | edidInfo[63];
mode->v_sync_offset = (edidInfo[65] & 0x0C) | ((edidInfo[64] & 0x0C) >> 2);
mode->v_sync_width = ((edidInfo[65] & 0x3) << 2) | (edidInfo[64] & 0x03);
*/
free( edidInfo );
if(!mode->h_active) return 1;
//for (i=0; i < map->mode_table_size; i++) {
//if (map->mode_table[0].mode == mode) {
switch(map->bios) {
case BT_INTEL:
return;
case BT_1:
{
vbios_resolution_type1 * res = map_type1_resolution(map, map->mode_table[i].resolution);
trunk/i386/modules/Resolution/include/edid.h
55
66
77
8
89
10
11
912
10
11
1213
1314
1415
1516
1617
18
19
20
21
1722
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
18168
169
170
19171
20
21
22
172
* Created by Evan Lojewski on 12/1/09.
* Copyright 2009. All rights reserved.
*
* Slice 2010, based on Joblo works
*/
//#ifndef __EDID_H__
//#define __EDID_H__
#ifndef _EDID_H_
#define _EDID_H_
#include "libsaio.h"
#define EDID_BLOCK_SIZE128
#define EDID_V1_BLOCKS_TO_GO_OFFSET 126
//Slice - some more info about EDID
#define EDID_LENGTH0x80
#define EDID_HEADER0x00
#define EDID_HEADER_END0x07
#define ID_MANUFACTURER_NAME0x08
#define ID_MANUFACTURER_NAME_END0x09
#define ID_MODEL0x0a
#define ID_SERIAL_NUMBER0x0c
#define MANUFACTURE_WEEK0x10
#define MANUFACTURE_YEAR0x11
#define EDID_STRUCT_VERSION0x12
#define EDID_STRUCT_REVISION0x13
#define EDID_STRUCT_DISPLAY 0x14
#define DPMS_FLAGS0x18
#define ESTABLISHED_TIMING_10x23
#define ESTABLISHED_TIMING_20x24
#define MANUFACTURERS_TIMINGS0x25
/* standard timings supported */
#define STD_TIMING 8
#define STD_TIMING_DESCRIPTION_SIZE 2
#define STD_TIMING_DESCRIPTIONS_START 0x26
#define DETAILED_TIMING_DESCRIPTIONS_START0x36
#define DETAILED_TIMING_DESCRIPTION_SIZE18
#define NO_DETAILED_TIMING_DESCRIPTIONS4
#define DETAILED_TIMING_DESCRIPTION_10x36
#define DETAILED_TIMING_DESCRIPTION_20x48
#define DETAILED_TIMING_DESCRIPTION_30x5a
#define DETAILED_TIMING_DESCRIPTION_40x6c
#define DESCRIPTOR_DATA5
#define UPPER_NIBBLE( x ) \
(((128|64|32|16) & (x)) >> 4)
#define LOWER_NIBBLE( x ) \
((1|2|4|8) & (x))
#define COMBINE_HI_8LO( hi, lo ) \
( (((unsigned)hi) << 8) | (unsigned)lo )
#define COMBINE_HI_4LO( hi, lo ) \
( (((unsigned)hi) << 4) | (unsigned)lo )
#define PIXEL_CLOCK_LO (unsigned)block[ 0 ]
#define PIXEL_CLOCK_HI (unsigned)block[ 1 ]
#define PIXEL_CLOCK (COMBINE_HI_8LO( PIXEL_CLOCK_HI,PIXEL_CLOCK_LO )*10000)
#define H_ACTIVE_LO (unsigned)block[ 2 ]
#define H_BLANKING_LO (unsigned)block[ 3 ]
#define H_ACTIVE_HI UPPER_NIBBLE( (unsigned)block[ 4 ] )
#define H_ACTIVE COMBINE_HI_8LO( H_ACTIVE_HI, H_ACTIVE_LO )
#define H_BLANKING_HI LOWER_NIBBLE( (unsigned)block[ 4 ] )
#define H_BLANKING COMBINE_HI_8LO( H_BLANKING_HI, H_BLANKING_LO )
#define V_ACTIVE_LO (unsigned)block[ 5 ]
#define V_BLANKING_LO (unsigned)block[ 6 ]
#define V_ACTIVE_HI UPPER_NIBBLE( (unsigned)block[ 7 ] )
#define V_ACTIVE COMBINE_HI_8LO( V_ACTIVE_HI, V_ACTIVE_LO )
#define V_BLANKING_HI LOWER_NIBBLE( (unsigned)block[ 7 ] )
#define V_BLANKING COMBINE_HI_8LO( V_BLANKING_HI, V_BLANKING_LO )
#define H_SYNC_OFFSET_LO (unsigned)block[ 8 ]
#define H_SYNC_WIDTH_LO (unsigned)block[ 9 ]
#define V_SYNC_OFFSET_LO UPPER_NIBBLE( (unsigned)block[ 10 ] )
#define V_SYNC_WIDTH_LO LOWER_NIBBLE( (unsigned)block[ 10 ] )
#define V_SYNC_WIDTH_HI ((unsigned)block[ 11 ] & (1|2))
#define V_SYNC_OFFSET_HI (((unsigned)block[ 11 ] & (4|8)) >> 2)
#define H_SYNC_WIDTH_HI (((unsigned)block[ 11 ] & (16|32)) >> 4)
#define H_SYNC_OFFSET_HI (((unsigned)block[ 11 ] & (64|128)) >> 6)
#define V_SYNC_WIDTH COMBINE_HI_4LO( V_SYNC_WIDTH_HI, V_SYNC_WIDTH_LO )
#define V_SYNC_OFFSET COMBINE_HI_4LO( V_SYNC_OFFSET_HI, V_SYNC_OFFSET_LO )
#define H_SYNC_WIDTH COMBINE_HI_4LO( H_SYNC_WIDTH_HI, H_SYNC_WIDTH_LO )
#define H_SYNC_OFFSET COMBINE_HI_4LO( H_SYNC_OFFSET_HI, H_SYNC_OFFSET_LO )
#define H_SIZE_LO (unsigned)block[ 12 ]
#define V_SIZE_LO (unsigned)block[ 13 ]
#define H_SIZE_HI UPPER_NIBBLE( (unsigned)block[ 14 ] )
#define V_SIZE_HI LOWER_NIBBLE( (unsigned)block[ 14 ] )
#define H_SIZE COMBINE_HI_8LO( H_SIZE_HI, H_SIZE_LO )
#define V_SIZE COMBINE_HI_8LO( V_SIZE_HI, V_SIZE_LO )
#define H_BORDER (unsigned)block[ 15 ]
#define V_BORDER (unsigned)block[ 16 ]
#define FLAGS (unsigned)block[ 17 ]
#define INTERLACED (FLAGS&128)
#define SYNC_TYPE (FLAGS&3<<3)/* bits 4,3 */
#define SYNC_SEPARATE (3<<3)
#define HSYNC_POSITIVE (FLAGS & 4)
#define VSYNC_POSITIVE (FLAGS & 2)
#define V_MIN_RATE block[ 5 ]
#define V_MAX_RATE block[ 6 ]
#define H_MIN_RATE block[ 7 ]
#define H_MAX_RATE block[ 8 ]
#define MAX_PIXEL_CLOCK (((int)block[ 9 ]) * 10)
#define GTF_SUPPORTblock[10]
#define DPMS_ACTIVE_OFF(1 << 5)
#define DPMS_SUSPEND(1 << 6)
#define DPMS_STANDBY(1 << 7)
struct EDID
{
UInt8header[8];//0
UInt8vendorProduct[4];//8
UInt8serialNumber[4];//12
UInt8weekOfManufacture;//16
UInt8yearOfManufacture;//17
UInt8version;//18
UInt8revision;//19
UInt8displayParams[5];//20
UInt8colorCharacteristics[10];//25
UInt8establishedTimings[3];//35
UInt16standardTimings[8];//38
UInt8detailedTimings[72];//54
UInt8extension;//126
UInt8checksum;//127
};
typedef struct _edid_mode {
unsigned short pixel_clock;
unsigned short h_active;
unsigned short h_blanking;
unsigned short v_active;
unsigned short v_blanking;
unsigned short h_sync_offset;
unsigned short h_sync_width;
unsigned short v_sync_offset;
unsigned short v_sync_width;
} edid_mode;
char* readEDID();
void getResolution(UInt32* x, UInt32* y, UInt32* bp);
int fb_parse_edid(struct EDID *edid, edid_mode* var);
int getEDID( void * edidBlock, UInt8 block);
void getResolution(UInt32* x, UInt32* y, UInt32* bp);
#endif /* _EDID_H_ */
//#endif
trunk/i386/modules/Resolution/edid.c
44
55
66
7
7
8
89
910
1011
12
1113
1214
1315
14
16
17
1518
19
20
21
1622
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
17237
18238
239
19240
241
242
243
244
245
246
247
248
249
250
251
252
20253
21
22254
23255
24256
......
26258
27259
28260
29
261
30262
31
32
263
264
265
33266
34
35
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
36293
294
295
296
37297
38298
39
40
299
300
41301
42302
43303
......
57317
58318
59319
60
320
61321
62322
63323
......
67327
68328
69329
70
71
330
331
72332
73333
74
75
334
335
76336
77
78
79337
338
339
80340
81341
82342
......
89349
90350
91351
92
352
93353
94354
95355
......
98358
99359
100360
101
102
361
362
103363
104364
105365
......
115375
116376
117377
118
119
120
378
379
380
121381
122382
123383
......
146406
147407
148408
149
*
* Created by Evan Lojewski on 12/1/09.
* Copyright 2009. All rights reserved.
*
*
*Slice 2010, based on Joblo works
*/
//#include "libsaio.h"
#include "edid.h"
#include "vbe.h"
#include "graphics.h"
#include "boot.h"
//----------------------------------------------------------------------------------
#define FBMON_FIX_HEADER 1
#define FBMON_FIX_INPUT 2
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
//----------------------------------------------------------------------------------
/*
struct broken_edid {
const char manufacturer[4];
UInt32 model;
UInt32 fix;
};
//----------------------------------------------------------------------------------
broken_edid brokendb[] = {
// DEC FR-PCXAV-YZ *
{ "DEC", 0x073a, FBMON_FIX_HEADER,},
// ViewSonic PF775a *
{ "VSC", 0x5a44, FBMON_FIX_INPUT,}
};
//----------------------------------------------------------------------------------
*/
const unsigned char edid_v1_header[] = { 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00};
//----------------------------------------------------------------------------------
int edid_compare(unsigned char *edid1, unsigned char *edid2)
{
int result = 0;
unsigned char *block = edid1 + ID_MANUFACTURER_NAME, manufacturer1[4], manufacturer2[4];;
manufacturer1[0] = ((block[0] & 0x7c) >> 2) + '@';
manufacturer1[1] = ((block[0] & 0x03) << 3) + ((block[1] & 0xe0) >> 5) + '@';
manufacturer1[2] = (block[1] & 0x1f) + '@';
manufacturer1[3] = 0;
block = edid2 + ID_MANUFACTURER_NAME;
manufacturer2[0] = ((block[0] & 0x7c) >> 2) + '@';
manufacturer2[1] = ((block[0] & 0x03) << 3) + ((block[1] & 0xe0) >> 5) + '@';
manufacturer2[2] = (block[1] & 0x1f) + '@';
manufacturer2[3] = 0;
int x;
for(x = 0; x < 4; x++)
{
if(manufacturer1[x] == manufacturer2[x])
result++;
}
return result;
}
int check_edid(unsigned char *edid)
{
unsigned char *block = edid + ID_MANUFACTURER_NAME, manufacturer[4];
//unsigned char *b;
UInt32 model;
//int i, fix = 0, ret = 0;
manufacturer[0] = ((block[0] & 0x7c) >> 2) + '@';
manufacturer[1] = ((block[0] & 0x03) << 3) +
((block[1] & 0xe0) >> 5) + '@';
manufacturer[2] = (block[1] & 0x1f) + '@';
manufacturer[3] = 0;
model = block[2] + (block[3] << 8);
/*
for (i = 0; i < (int)ARRAY_SIZE(brokendb); i++) {
if (!strncmp((const char *)manufacturer, brokendb[i].manufacturer, 4) &&
brokendb[i].model == model) {
DEBG("ATIFB: The EDID Block of "
"Manufacturer: %s Model: 0x%08lx is known to "
"be broken,\n", manufacturer, model);
fix = brokendb[i].fix;
break;
}
}
switch (fix) {
case FBMON_FIX_HEADER:
for (i = 0; i < 8; i++) {
if (edid[i] != edid_v1_header[i])
ret = fix;
}
break;
case FBMON_FIX_INPUT:
b = edid + EDID_STRUCT_DISPLAY;
/// Only if display is GTF capable will
//the input type be reset to analog *
if (b[4] & 0x01 && b[0] & 0x80)
ret = fix;
break;
}
*/
return 0; //ret;
}
//----------------------------------------------------------------------------------
static void fix_edid(unsigned char *edid, int fix)
{
unsigned char *b;
switch (fix) {
case FBMON_FIX_HEADER:
msglog("EDID: trying a header reconstruct\n");
memcpy(edid, edid_v1_header, 8);
break;
case FBMON_FIX_INPUT:
msglog("EDID: trying to fix input type\n");
b = edid + EDID_STRUCT_DISPLAY;
b[0] &= ~0x80;
edid[127] += 0x80;
}
}
//----------------------------------------------------------------------------------
int edid_checksum(unsigned char *edid)
{
unsigned char i, csum = 0, all_null = 0;
int err = 0, fix = check_edid(edid);
if (fix)
fix_edid(edid, fix);
for (i = 0; i < EDID_LENGTH; i++) {
csum += edid[i];
all_null |= edid[i];
}
if (csum == 0x00 && all_null) {
/* checksum passed, everything's good */
err = 1;
}
return err;
}
//----------------------------------------------------------------------------------
static int edid_check_header(unsigned char *edid)
{
int i, err = 1, fix = check_edid(edid);
if (fix)
fix_edid(edid, fix);
for (i = 0; i < 8; i++) {
if (edid[i] != edid_v1_header[i])
err = 0;
}
return err;
}
//------------------------------------------------------------------------
bool verifyEDID(unsigned char *edid)
{
if (edid == NULL || !edid_checksum(edid) ||!edid_check_header(edid))
{
return false;
}
return true;
}
int edid_is_timing_block(unsigned char *block)
{
if ((block[0] != 0x00) || (block[1] != 0x00) ||
(block[2] != 0x00) || (block[4] != 0x00))
return 1;
else
return 0;
}
//----------------------------------------------------------------------------------
int fb_parse_edid(struct EDID *edid, edid_mode* var) //(struct EDID *edid, UInt32* x, UInt32* y)
{
int i;
unsigned char *block;
if(!verifyEDID((unsigned char *)edid)) return 1;
block = (unsigned char *)edid + DETAILED_TIMING_DESCRIPTIONS_START; //54
for (i = 0; i < 4; i++, block += DETAILED_TIMING_DESCRIPTION_SIZE) {
if (edid_is_timing_block(block)) {
var->h_active = H_ACTIVE;
var->v_active = V_ACTIVE;
var->h_sync_offset = H_SYNC_OFFSET;
var->h_sync_width = H_SYNC_WIDTH;
var->h_blanking = H_BLANKING;
var->v_blanking = V_BLANKING;
var->pixel_clock = PIXEL_CLOCK;
var->h_sync_width = H_SYNC_WIDTH;
var->v_sync_width = V_SYNC_WIDTH;
/*
var->xres = var->xres_virtual = H_ACTIVE;
var->yres = var->yres_virtual = V_ACTIVE;
var->height = var->width = -1;
var->right_margin = H_SYNC_OFFSET;
var->left_margin = (H_ACTIVE + H_BLANKING) -
(H_ACTIVE + H_SYNC_OFFSET + H_SYNC_WIDTH);
var->upper_margin = V_BLANKING - V_SYNC_OFFSET -
V_SYNC_WIDTH;
var->lower_margin = V_SYNC_OFFSET;
var->hsync_len = H_SYNC_WIDTH;
var->vsync_len = V_SYNC_WIDTH;
var->pixclock = PIXEL_CLOCK;
var->pixclock /= 1000;
var->pixclock = KHZ2PICOS(var->pixclock);
if (HSYNC_POSITIVE)
var->sync |= FB_SYNC_HOR_HIGH_ACT;
if (VSYNC_POSITIVE)
var->sync |= FB_SYNC_VERT_HIGH_ACT;
*/
return 1;
}
}
return 0;
}
void getResolution(UInt32* x, UInt32* y, UInt32* bp)
{
//int val;
static UInt32 xResolution, yResolution, bpResolution;
/*
if(getIntForKey(kScreenWidth, &val, &bootInfo->bootConfig))
{
xResolution = val;
}
if(getIntForKey(kScreenHeight, &val, &bootInfo->bootConfig))
{
yResolution = val;
}
*/
bpResolution = 32;// assume 32bits
bpResolution = 32;// assume 32bits
if(!xResolution || !yResolution || !bpResolution)
{
char* edidInfo = readEDID();
if(!edidInfo) return;
edid_mode mode;
// TODO: check *all* resolutions reported and either use the highest, or the native resolution (if there is a flag for that)
xResolution = edidInfo[56] | ((edidInfo[58] & 0xF0) << 4);
yResolution = edidInfo[59] | ((edidInfo[61] & 0xF0) << 4);
//xResolution = edidInfo[56] | ((edidInfo[58] & 0xF0) << 4);
//yResolution = edidInfo[59] | ((edidInfo[61] & 0xF0) << 4);
//Slice - done here
//printf("H Active = %d", edidInfo[56] | ((edidInfo[58] & 0xF0) << 4) );
//printf("V Active = %d", edidInfo[59] | ((edidInfo[61] & 0xF0) << 4) );
if(fb_parse_edid((struct EDID *)edidInfo, &mode) == 0)
{
xResolution = DEFAULT_SCREEN_WIDTH;
yResolution = DEFAULT_SCREEN_HEIGHT;
}
else {
xResolution = mode.h_active;
yResolution = mode.v_active;
}
/*
0x00 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0x00 0x32 0x0C
0x00 0xDF 0x00 0x00 0x00 0x00 0xFF 0xFF 0xFF 0x00
0x0C 0xDF 0x00 0x00 0x12 0x03 0x21 0x78 0xE9 0x99
0x53 0x28 0xFF 0xFF 0x32 0xDF 0x00 0x12 0x80 0x78
0xD5 0x53 0x26 0x00 0x01 0x01 0x01 0x01 0xFF 0x00
0xDF 0x00 0x03 0x78 0x99 0x28 0x00 0x01 0x01 0x01
0x01 0x21 0x84 0x20 0xFF 0x0C 0x00 0x03 0x0A 0x53
0x54 0x01 0x01 0x01 0xDE 0x84 0x56 0x00 0xA0 0x30
0xFF 0xDF 0x12 0x78 0x53 0x00 0x01 0x01 0x01 0x84
0x00 0x18 0x84 0x00 0x00 0x57 0xFF 0x00 0x80 0x99
0x54 0x01 0x01 0x21 0x20 0x00 0x50 0x00 0x00 0x35
0x57 0xFE 0x00 0x00 0x78 0x28 0x01 0x01 0x21 0x20
0x18 0x30 0x00 0x57 0x34 0xFE 0xAA 0x9A
*/
//msglog("H Active = %d ", edidInfo[56] | ((edidInfo[58] & 0xF0) << 4) );
//msglog("V Active = %d \n", edidInfo[59] | ((edidInfo[61] & 0xF0) << 4) );
free( edidInfo );
if(!xResolution) xResolution = DEFAULT_SCREEN_WIDTH;
if(!yResolution) yResolution = DEFAULT_SCREEN_HEIGHT;
//if(!xResolution) xResolution = DEFAULT_SCREEN_WIDTH;
//if(!yResolution) yResolution = DEFAULT_SCREEN_HEIGHT;
}
SInt16 status;
UInt16 blocks_left = 1;
//msglog("readEDID\n");
do
{
// TODO: This currently only retrieves the *last* block, make the block buffer expand as needed / calculated from the first block
status = getEDID(edidInfo, blocks_left);
//printf("Buffer location: 0x%X\n", SEG(buffer) << 16 | OFF(buffer));
/*
msglog("Buffer location: 0x%X status: %d\n", SEG(edidInfo) << 16 | OFF(edidInfo), status);
int j, i;
for (j = 0; j < 8; j++) {
for(i = 0; i < 16; i++) printf("0x%X ", ebiosInfo[((i+1) * (j + 1)) - 1]);
for(i = 0; i < 16; i++) msglog("0x%02X ", edidInfo[((i+1) * (j + 1)) - 1]);
msglog("\n");
}
printf("\n");
*/
if(status == 0)
{
//if( edidInfo[0] == 0x00 || edidInfo[0] == 0xFF)
if ( reported > blocks_left )
{
printf("EDID claims %d more blocks left\n", reported);
msglog("EDID claims %d more blocks left\n", reported);
}
if ( (last_reported <= reported && last_reported != -1)
//|| reported == MAGIC
)
{
printf("Last reported %d\n", last_reported);
printf( "EDID blocks left is wrong.\n"
msglog("Last reported %d\n", last_reported);
msglog( "EDID blocks left is wrong.\n"
"Your EDID is probably invalid.\n");
return 0;
}
}
else
{
printf("Invalid block %d\n", blocks_left);
printf("Header1 = %d", memcmp(edidInfo, header1, sizeof(header1)) );
printf("Header2 = %d", memcmp(edidInfo, header2, sizeof(header2)) );
msglog("Invalid block %d\n", blocks_left);
msglog("Header1 = %d", memcmp(edidInfo, header1, sizeof(header1)) );
msglog("Header2 = %d", memcmp(edidInfo, header2, sizeof(header2)) );
return 0;
}
}
bios( &bb );
return(bb.eax.r.h);
}
trunk/i386/modules/Resolution/915resolution.h
88
99
1010
11
12
13
1114
1215
1316
14
15
16
17
18
1719
1820
1921
......
2527
2628
2729
30
2831
2932
30
3133
3234
3335
......
116118
117119
118120
119
121
120122
121123
122124
*/
#ifndef __RESOLUTION_H
#define __RESOLUTION_H
#include "shortatombios.h"
#include "edid.h"
#ifndef __RESOLUTION_H
#define __RESOLUTION_H
//Slice - moved to edid.h
/*
typedef struct _edid_mode {
unsigned short pixel_clock;
unsigned short h_active;
unsigned short v_sync_offset;
unsigned short v_sync_width;
} edid_mode;
*/
void patchVideoBios();
typedef enum {
BT_UNKNOWN, BT_1, BT_2, BT_3, BT_ATI_1, BT_ATI_2, BT_NVDA
BT_UNKNOWN, BT_1, BT_2, BT_3, BT_ATI_1, BT_ATI_2, BT_NVDA, BT_INTEL
} bios_type;

Archive Download the corresponding diff file

Revision: 947