Chameleon

Chameleon Commit Details

Date:2010-01-26 04:36:29 (14 years 2 months ago)
Author:Pradeesh
Commit:33
Parents: 32
Message:Modified Meklort's 915 EDID patch for Intel onboard video cards , so that basically it gives full EDID detection for GMA 950/X3100 and even unsupported ones such as X4500HD !
Changes:
M/branches/prasys/i386/boot2/options.c
M/branches/prasys/i386/libsaio/vbe.h
M/branches/prasys/i386/boot2/graphics.c
M/branches/prasys/i386/boot2/boot.c
M/branches/prasys/i386/boot2/gui.c
M/branches/prasys/i386/boot2/graphics.h
M/branches/prasys/i386/libsaio/Makefile
M/branches/prasys/i386/libsaio/vbe.c

File differences

branches/prasys/i386/libsaio/vbe.c
7474
7575
7676
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
7795
7896
7997
......
105123
106124
107125
126
127
108128
109129
110130
return(bb.eax.r.h);
}
int getEDID( void * edidBlock, UInt8 block)
{
bzero(&bb, sizeof(bb));
bb.intno = 0x10;
bb.eax.rr = funcGetEDID;
bb.ebx.r.l= 0x01;
bb.edx.rr = block;
bb.es = SEG( edidBlock );
bb.edi.rr = OFF( edidBlock );
bios( &bb );
return(bb.eax.r.h);
}
int getVBEModeInfo( int mode, void * minfo_p )
{
bb.intno = 0x10;
return(bb.eax.r.h);
}
/*
* Default GTF parameter values.
*/
branches/prasys/i386/libsaio/vbe.h
6868
6969
7070
71
71
72
7273
7374
7475
......
269270
270271
271272
273
274
272275
273276
274277
funcGetSetPaletteFormat = 0x4F08,
funcGetSetPaletteData = 0x4F09,
funcGetProtModeInterdace = 0x4F0A,
funcGetSetPixelClock = 0x4F0B
funcGetSetPixelClock = 0x4F0B,
funcGetEDID = 0x4f15
};
enum {
typedef unsigned long VBEPalette[256];
extern int getVBEInfo(void *vinfo_p);
extern int getEDID( void * edidBlock, UInt8 blocks_left );
extern int getVBEModeInfo(int mode, void *minfo_p);
extern int getVBEDACFormat(unsigned char *format);
extern int setVBEDACFormat(unsigned char format);
branches/prasys/i386/libsaio/Makefile
4040
4141
4242
43
43
4444
4545
4646
freq_detect.o platform.o dsdt_patcher.o \
smbios_patcher.o fake_efi.o ext2fs.o \
hpet.o spd.o usb.o pci_setup.o \
device_inject.o nvidia.o ati.o gma.o
device_inject.o nvidia.o ati.o gma.o 915resolution.o edid.o
SAIO_EXTERN_OBJS = console.o
branches/prasys/i386/boot2/graphics.c
182182
183183
184184
185
185
186186
187187
188188
// Return the VESA mode that matches the properties specified.
// If a mode is not found, then return the "best" available mode.
static unsigned short
unsigned short
getVESAModeWithProperties( unsigned short width,
unsigned short height,
unsigned char bitsPerPixel,
branches/prasys/i386/boot2/boot.c
5757
5858
5959
60
61
62
63
6064
6165
6266
......
356360
357361
358362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
359395
360396
361397
#include "libsa.h"
#include "ramdisk.h"
#include "gui.h"
#include "graphics.h"
#include "vbe.h"
#include "915resolution.h"
#include "edid.h"
long gBootMode; /* defaults to 0 == kBootModeNormal */
BOOL gOverrideKernel;
if ( getBoolForKey(kGUIKey, &useGUI, &bootInfo->bootConfig) && !useGUI )
useGUI = FALSE;
// Before initGui, path the video bios with the correct resolution
UInt32 x = 0, y = 0;
UInt32 bp = 0;
getResolution(&x, &y, &bp);
if (x!=0 && y!=0) {
vbios_map * map;
map = open_vbios(CT_UNKWN);
unlock_vbios(map);
set_mode(map, x, y, bp, 0, 0);
relock_vbios(map);
close_vbios(map);
verbose("Patched first resolution mode to %dx%d.\n", x, y);
}
//printf("Press any key to continue...");
//getc();
// Try initialising the GUI unless disabled
if( useGUI )
initGUI();
branches/prasys/i386/boot2/graphics.h
1010
1111
1212
13
1314
1415
1516
......
4445
4546
4647
48
49
50
51
52
53
54
55
56
57
4758
#include "boot.h"
#include "bootstruct.h"
#include "graphic_utils.h"
#include "vbe.h"
#ifndef __BOOT_GRAPHICS_H
char *getVBEModeInfoString();
void getGraphicModeParams(unsigned long params[]);
unsigned short getVESAModeWithProperties( unsigned short width,
unsigned short height,
unsigned char bitsPerPixel,
unsigned short attributesSet,
unsigned short attributesClear,
VBEModeInfoBlock * outModeInfo,
unsigned short * vesaVersion );
#endif /* !__BOOT_GRAPHICS_H */
branches/prasys/i386/boot2/gui.c
1111
1212
1313
14
1415
1516
1617
......
494495
495496
496497
497
498
498499
499500
501
502
500503
501504
502505
......
504507
505508
506509
507
508
509
510
511
512
513
510514
511
512
513515
514516
515517
......
523525
524526
525527
526
527528
528529
529530
530531
531532
532533
533
534
535
536
537
534
538535
539
540
541
542536
543537
544538
......
17071701
17081702
17091703
1704
17101705
17111706
17121707
1713
17141708
17151709
17161710
17171711
17181712
1713
1714
1715
1716
17191717
17201718
17211719
17221720
17231721
17241722
1725
1726
1727
1728
1729
1723
17301724
1731
1732
1733
1734
1735
1736
1737
17381725
17391726
17401727
#include "gui.h"
#include "appleboot.h"
#include "vers.h"
#include "edid.h"
#ifdef EMBED_THEME
#include "art.h"
int initGUI()
{
int val, len;
int len;
char dirspec[256];
#ifdef EMBED_THEME
config_file_t *embedded = &bootInfo->themeDefault;
// build xml dictionary for embedded theme.plist
ParseXMLFile( (char *) __theme_plist, &embedded->dictionary);
// parse display size parameters
if(getIntForKey("screen_width", &val, &bootInfo->themeDefault))
screen_params[0] = val;
// determine screen params form edid
getResolution(&screen_params[0], &screen_params[1], &screen_params[2]);
if(getIntForKey("screen_height", &val, &bootInfo->themeDefault))
screen_params[1] = val;
#else
/*
// Initalizing GUI strucutre.
bzero(&gui, sizeof(gui_t));
screen_params[2] = 32;
// find theme name in boot.plist
getValueForKey( "Theme", &theme_name, &len, &bootInfo->bootConfig );
sprintf(dirspec, "/Extra/Themes/%s/theme.plist", theme_name);
if ( !loadConfigFile(dirspec, &bootInfo->themeConfig) )
{
// parse display size parameters
if(getIntForKey("screen_width", &val, &bootInfo->themeConfig))
screen_params[0] = val;
loadConfigFile(dirspec, &bootInfo->themeConfig);
if(getIntForKey("screen_height", &val, &bootInfo->themeConfig))
screen_params[1] = val;
}
// find best matching vesa mode for our requested width & height
getGraphicModeParams(screen_params);
//==========================================================================
// drawBootGraphics
//funciton used when starting up OS X.
void drawBootGraphics()
{
int pos;
int length;
const char *dummyVal;
BOOL legacy_logo;
uint16_t x, y;
/** Read default resolution from the graphics card, instead of the theme **/
getResolution(&screen_params[0], &screen_params[1], &screen_params[2]);
if (getBoolForKey("Legacy Logo", &legacy_logo, &bootInfo->bootConfig) && legacy_logo)
usePngImage = NO;
else if (bootImageData == NULL)
loadBootGraphics();
// parse screen size parameters
if(getIntForKey("boot_width", &pos, &bootInfo->themeConfig))
screen_params[0] = pos;
else
screen_params[0] = DEFAULT_SCREEN_WIDTH;
if(getIntForKey("boot_height", &pos, &bootInfo->themeConfig))
screen_params[1] = pos;
else
screen_params[1] = DEFAULT_SCREEN_HEIGHT;
screen_params[2] = 32;
gui.screen.width = screen_params[0];
gui.screen.height = screen_params[1];
branches/prasys/i386/boot2/options.c
700700
701701
702702
703
703
704704
705705
706706
707
707
708708
709
709
710
711
710712
711713
712714
......
837839
838840
839841
840
842
841843
842844
843845
timeout = sysConfigValid?kBootTimeout:0;
}
if (timeout < 0)
if (timeout < 0 || gDeviceCount <= 1)
gBootMode |= kBootModeQuiet;
// If the user is holding down a modifier key,
// enter safe mode.
// abort quiet mode.
if ( ( readKeyboardShiftFlags() & 0x0F ) != 0 ) {
gBootMode |= kBootModeSafe;
//gBootMode |= kBootModeSafe;
gBootMode &= ~kBootModeQuiet;
firstRun = NO;
}
// If user typed F8, abort quiet mode,
}
if ( firstRun && ( timeout > 0 ) &&
( countdown("Press any key to enter startup options.",
( countdown(""/*"Press any key to enter startup options."*/,
kMenuTopRow, timeout) == 0 ) )
{
// If the user is holding down a modifier key,

Archive Download the corresponding diff file

Revision: 33