Index: i386/libsaio/gma.c
===================================================================
--- i386/libsaio/gma.c	(revision 2013)
+++ i386/libsaio/gma.c	(working copy)
@@ -187,21 +187,21 @@
 	devprop_add_value(device, "model", (uint8_t*)model, (strlen(model) + 1));
 	devprop_add_value(device, "device_type", (uint8_t*)"display", 8);	
 	
-	if ((model == (char *)"Mobile GMA950")
-		|| (model == (char *)"Mobile GMA3150"))
+	if (!strcmp(model,"Mobile GMA950")
+		|| !strcmp(model, "Mobile GMA3150"))
 	{
 		devprop_add_value(device, "AAPL,HasPanel", reg_TRUE, 4);
 		devprop_add_value(device, "built-in", &BuiltIn, 1);
 		devprop_add_value(device, "class-code", ClassFix, 4);
 	}
-	else if ((model == (char *)"Desktop GMA950")
-			|| (model == (char *)"Desktop GMA3150"))
+	else if (!strcmp(model, "Desktop GMA950")
+			 || !strcmp(model, "Desktop GMA3150"))
 	{
 		BuiltIn = 0x01;
 		devprop_add_value(device, "built-in", &BuiltIn, 1);
 		devprop_add_value(device, "class-code", ClassFix, 4);
 	}
-	else if (model == (char *)"GMAX3100")
+	else if (!strcmp(model, "GMAX3100"))
 	{
 		devprop_add_value(device, "AAPL,HasPanel",					GMAX3100_vals[0], 4);
 		devprop_add_value(device, "AAPL,SelfRefreshSupported",		GMAX3100_vals[1], 4);
@@ -227,7 +227,7 @@
 		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 (!strcmp(model, "Intel HD Graphics 2000 Mobile"))
 	{
 		devprop_add_value(device, "class-code", ClassFix, 4);
 		devprop_add_value(device, "hda-gfx", (uint8_t *)"onboard-1", 10); 
@@ -248,7 +248,7 @@
 		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 (!strcmp(model, "Intel HD Graphics 3000 Mobile"))
 	{
 		devprop_add_value(device, "class-code", ClassFix, 4);
 		devprop_add_value(device, "hda-gfx", (uint8_t *)"onboard-1", 10); 
@@ -269,7 +269,7 @@
 		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 (!strcmp(model, "Intel HD Graphics 2000"))
 	{
 		devprop_add_value(device, "built-in", &BuiltIn, 1);
 		devprop_add_value(device, "class-code", ClassFix, 4);
@@ -278,7 +278,7 @@
 		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 (!strcmp(model, "Intel HD Graphics 3000"))
 	{
 		devprop_add_value(device, "built-in", &BuiltIn, 1);
 		devprop_add_value(device, "class-code", ClassFix, 4);
@@ -288,15 +288,20 @@
 		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 4000")
+	else if (!strcmp(model, "Intel HD Graphics 4000") ||
+			 !strcmp(model, "Intel HD Graphics 4000 Mobile"))
 	{
+		uint32_t ig_platform_id = 0;	// Default to 0x01660000
+		getIntForKey("HD4000PlatformId", (int*)&ig_platform_id, &bootInfo->chameleonConfig);
+		if (ig_platform_id > 0xb) ig_platform_id = 0;
+		if (ig_platform_id >= 5 && ig_platform_id <= 7)
+			ig_platform_id |= 0x01620000;
+		else
+			ig_platform_id |= 0x01660000;
+		devprop_add_value(device, "AAPL,ig-platform-id", (uint8_t*)&ig_platform_id, 4);
 		devprop_add_value(device, "built-in", &BuiltIn, 1);
 		devprop_add_value(device, "class-code", ClassFix, 4);
-        device_id = 0x00000166;											// Inject a valid mobile GPU device id instead of patching kexts
-		devprop_add_value(device, "device-id", (uint8_t*)&device_id, sizeof(device_id));
-		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);
+		devprop_add_value(device, "hda-gfx", (uint8_t *)"onboard-1", 10);
 	}
 	
 	stringdata = malloc(sizeof(uint8_t) * string->length);
