Chameleon

Chameleon Commit Details

Date:2010-09-02 15:37:01 (9 years 1 month ago)
Author:Azimutz
Commit:474
Parents: 473
Message:Finished testing AutoResolution (for now), leaving some comments and cleanning.
Changes:
M/branches/azimutz/Chazi/doc-azi/CHANGES.txt
M/branches/azimutz/Chazi/i386/libsaio/autoresolution.h
M/branches/azimutz/Chazi/i386/boot2/graphics.c
M/branches/azimutz/Chazi/i386/libsaio/edid.c
M/branches/azimutz/Chazi/i386/boot2/gui.c
M/branches/azimutz/Chazi/i386/boot2/graphics.h
M/branches/azimutz/Chazi/i386/boot2/boot.h

File differences

branches/azimutz/Chazi/doc-azi/CHANGES.txt
288288
289289
290290
291
292
291
293292
293
294
295
296
294297
295298
296299
AutoResolution=y enables the patch.
Note: Obviously, it only works in Graphics Mode (Gui).
Disabled by default.
Note: Obviously, it only works in Graphics Mode (Gui). Disabled by default.
Note: resolution set on theme.plist is overriding the native one set by AutoResolution. For now the
possible solutions are, remove the boot resolution (boot_width, boot_height) from theme.plist
or add "Graphics Mode"=<native resolution>.
Motif: ... mentioned above. Check the topic for more details:
http://forum.voodooprojects.org/index.php/topic,1227.0.html
branches/azimutz/Chazi/i386/libsaio/autoresolution.h
1616
1717
1818
19
20
1921
2022
2123
#ifndef __915_RESOLUTION_H
#define __915_RESOLUTION_H
//#define AUTORES_DEBUG 1 // enable AutoResolution debug - review!
#include "edid.h"
#if DEBUG
branches/azimutz/Chazi/i386/libsaio/edid.c
3232
3333
3434
35
35
36
3637
3738
3839
......
6970
7071
7172
72
73
74
7375
7476
7577
7678
7779
78
80
7981
8082
8183
free( edidInfo );
} else {
// TODO: check *all* resolutions reported and eithe ruse the highest, or the native resolution (if there is a flag for that)
// 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);
do
{
// TODO: This currently only retrieves the *last* block, make the block buffer expand as needed / calculated from the first block
// TODO: This currently only retrieves the *last* block, make the block buffer expand
// as needed / calculated from the first block.
bzero( edidInfo, EDID_BLOCK_SIZE);
status = getEDID(edidInfo, blocks_left);
//printf("Buffer location: 0x%X\n", SEG(buffer) << 16 | OFF(buffer));
//printf("Buffer location: 0x%X\n", SEG(buffer) << 16 | OFF(buffer));
/*
int j, i;
branches/azimutz/Chazi/i386/boot2/graphics.c
2626
2727
2828
29
29
3030
3131
3232
* All rights reserved.
*/
//Azi:include
//Azi:includes
//#include "boot.h" - included on graphics.h, which is included on gui.h
//#include "vbe.h" - same as above (needed if autoresolution is removed!)
#include "appleClut8.h"
branches/azimutz/Chazi/i386/boot2/graphics.h
77
88
99
10
10
1111
1212
1313
*
*/
//Azi:include
//Azi:includes
#include "boot.h" // was included on graphic_utils.h
#include "bootstruct.h"
#include "graphic_utils.h"
branches/azimutz/Chazi/i386/boot2/boot.h
9696
9797
9898
99
99
100100
101101
102102
#define kMD0Image"md0"// ramdisk.h
#define kTestConfigKey"config"// stringTable.c
#define kCanOverrideKey"CanOverride"// stringTable.c
#define kAutoResolutionKey"AutoResolution"// boot.c - don't forget F2 key, to change resolution! - Add to BootHelp.txt
#define kAutoResolutionKey"AutoResolution"// boot.c
/*
* Flags to the booter and/or kernel - these end with "Flag".
branches/azimutz/Chazi/i386/boot2/gui.c
88
99
1010
11
1112
1213
1314
15
16
1417
1518
1619
......
736739
737740
738741
739
742
740743
741744
742745
......
18691872
18701873
18711874
1872
1875
18731876
18741877
18751878
18761879
1877
1880
18781881
18791882
18801883
18811884
1882
1885
1886
1887
18831888
1889
1890
1891
1892
18841893
18851894
18861895
*
*/
//Azi:includes
#include "gui.h"
#include "appleboot.h"
#include "vers.h"
//#include "edid.h" //Azi: needed just for getResolution() call on drawBootGraphics()?? - No!! wtf... check later.
//#include "autoresolution.h"
#define IMG_REQUIRED -1
#define THEME_NAME_DEFAULT"Default"
bzero(&gui, sizeof(gui_t));
// find best matching vesa mode for our requested width & height
loadConfigFile(dirspec, &bootInfo->themeConfig); //Azi: check this later.
//loadConfigFile(dirspec, &bootInfo->themeConfig); //Azi: check this later.
getGraphicModeParams(screen_params);
// set our screen structure with the mode width & height
}
/*
* AutoResolution - Azi: review this stuff...***
* AutoResolution - Azi: check this later; resolution on theme.plist overrides the native one!
*/
if (gAutoResolution == true)
{
// Get Resolution from Graphics Mode key
count = getNumberArrayFromProperty(kGraphicsModeKey, screen_params, 4);
count = getNumberArrayFromProperty(kGraphicsModeKey, screen_params, 4); //Azi: this is ok!
// If no Graphics Mode key, get it from EDID
if ( count < 3 )
{
getResolution(screen_params);
getResolution(screen_params); //Azi: this returns default resolution (1024x768x32) if nothing found.
//PRINT("Resolution : %dx%d (EDID)\n",screen_params[0], screen_params[1]);
}
/*else
{
PRINT("Resolution : %dx%d (Graphics Mode key)\n",screen_params[0], screen_params[1]);
}*/
}
else
{

Archive Download the corresponding diff file

Revision: 474