Chameleon

Chameleon Commit Details

Date:2012-12-28 05:59:20 (11 years 3 months ago)
Author:Evan Lojewski
Commit:2151
Parents: 2150
Message:Add graphics enabler code for HD4000. Select configuration bassed on video ram configured. Remove erroneous Intel from beginning of model names.
Changes:
M/trunk/i386/libsaio/gma.c

File differences

trunk/i386/libsaio/gma.c
1212
1313
1414
15
16
1517
1618
1719
......
128130
129131
130132
131
132
133
134
135
136
133
134
135
136
137
138
139
140
137141
138142
139143
......
224228
225229
226230
227
231
228232
229233
230234
......
245249
246250
247251
248
252
249253
250254
251255
......
266270
267271
268272
269
273
270274
271275
272276
......
275279
276280
277281
278
282
279283
280284
281285
......
285289
286290
287291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
288324
289325
290326
#include "platform.h"
#include "device_inject.h"
#include "gma.h"
#include "vbe.h"
#include "graphics.h"
#ifndef DEBUG_GMA
#define DEBUG_GMA 0
{ 0x80862A13, "GMAX3100"},
{ 0x80862A42, "GMAX3100"},
{ 0x80862A43, "GMAX3100"},
{ 0x80860102, "Intel HD Graphics 2000"},
{ 0x80860106, "Intel HD Graphics 2000 Mobile"},
{ 0x80860112, "Intel HD Graphics 3000"},
{ 0x80860116, "Intel HD Graphics 3000 Mobile"},
{ 0x80860122, "Intel HD Graphics 3000"},
{ 0x80860126, "Intel HD Graphics 3000 Mobile"},
{ 0x80860102, "HD Graphics 2000"},
{ 0x80860106, "HD Graphics 2000 Mobile"},
{ 0x80860112, "HD Graphics 3000"},
{ 0x80860116, "HD Graphics 3000 Mobile"},
{ 0x80860122, "HD Graphics 3000"},
{ 0x80860126, "HD Graphics 3000 Mobile"},
{ 0x80860162, "HD Graphics 4000" },
{ 0x80860166, "HD Graphics 4000 Mobile" },
};
char *get_gma_model(uint32_t id) {
devprop_add_value(device, "AAPL01,Stretch",GMAX3100_vals[21], 4);
devprop_add_value(device, "class-code",ClassFix, 4);
}
else if (model == (char *)&"Intel HD Graphics 2000 Mobile")
else if (model == (char *)&"HD Graphics 2000 Mobile")
{
devprop_add_value(device, "class-code", ClassFix, 4);
devprop_add_value(device, "hda-gfx", (uint8_t *)"onboard-1", 10);
devprop_add_value(device, "AAPL,tbl-info", HD2000_tbl_info, 18);
devprop_add_value(device, "AAPL,os-info", HD2000_os_info, 20);
}
else if (model == (char *)&"Intel HD Graphics 3000 Mobile")
else if (model == (char *)&"HD Graphics 3000 Mobile")
{
devprop_add_value(device, "class-code", ClassFix, 4);
devprop_add_value(device, "hda-gfx", (uint8_t *)"onboard-1", 10);
devprop_add_value(device, "AAPL,tbl-info", HD3000_tbl_info, 18);
devprop_add_value(device, "AAPL,os-info", HD3000_os_info, 20);
}
else if (model == (char *)&"Intel HD Graphics 2000")
else if (model == (char *)&"HD Graphics 2000")
{
devprop_add_value(device, "built-in", &BuiltIn, 1);
devprop_add_value(device, "class-code", ClassFix, 4);
devprop_add_value(device, "AAPL,tbl-info", HD2000_tbl_info, 18);
devprop_add_value(device, "AAPL,os-info", HD2000_os_info, 20);
}
else if (model == (char *)&"Intel HD Graphics 3000")
else if (model == (char *)&"HD Graphics 3000")
{
devprop_add_value(device, "built-in", &BuiltIn, 1);
devprop_add_value(device, "class-code", ClassFix, 4);
devprop_add_value(device, "AAPL,tbl-info", HD3000_tbl_info, 18);
devprop_add_value(device, "AAPL,os-info", HD3000_os_info, 20);
}
else if(model == (char*)&"HD Graphics 4000" ||
model == (char*)&"HD Graphics 4000 Mobile")
{
uint32_t ram = (((getVBEVideoRam() + 512) / 1024) + 512) / 1024;
uint32_t ig_platform_id;
switch (ram)
{
case 96:
ig_platform_id = 0x01660000; // 96mb
break;
case 64:
ig_platform_id = 0x01660009; // 64mb
break;
case 32:
ig_platform_id = 0x01620005; // 32mb
break;
default:
printf("Please specify 96, 64, or 32MB RAM for the HD4000 in the bios.\n"
"The selected %dMB RAM ocnfiguration is not supported for the HD4000.\n", ram);
pause();
return false;// Exit early before the AAPL,ig-platform-id property is set.
break;
}
devprop_add_value(device, "built-in", &BuiltIn, 1);
devprop_add_value(device, "class-code", ClassFix, 4);
devprop_add_value(device, "hda-gfx", (uint8_t *)"onboard-1", 10);
devprop_add_value(device, "AAPL,ig-platform-id", (uint8_t*)&ig_platform_id, 4);
}
stringdata = malloc(sizeof(uint8_t) * string->length);
if (!stringdata)

Archive Download the corresponding diff file

Revision: 2151