Chameleon

Issue 123: From 1051 to 1174, SNB framebuffer did not show, unload!

Reported by Liu Colin, Jul 19, 2011

My laptop is HP dv4 3011TX, and the Intel HD3000 was fully working 
on chameleon 1051.
After I upgrade to 1174, it will show "SNB framebuffer did not 
show, unload" while start. And then in about this mac, it only 
shows 64M graphic ram. And the card working without QE/CI.

Comment 1 by Cosmosis Jones, Jul 19, 2011

please post a bdmesg from 1051
and a bdmesg from current trunk.

Thanks
Labels: Target:2.0
Status: Accepted
Owner: azimutz

Comment 2 by Liu Colin, Jul 20, 2011

Attached bdmesg from 1051 and 1168.

Comment 3 by Cosmosis Jones, Jul 20, 2011

did you by chance change the com.apple.Boot.plist
to 

org.chameleon.Boot.plist in /Extra?

The trunk uses that new file name

Comment 4 by Liu Colin, Jul 21, 2011

Ofcourse I did.....
Attached my com.apple.com.plist since I'm on 1051 now. :)

Comment 5 by Sergey Slice, Jul 22, 2011

The differencies:
Added 4 SSDT table(s) into XSDT

Added 3 SSDT table(s) into XSDT

And using caches. Try to clear caches.

Comment 6 by Liu Colin, Jul 22, 2011

You mean the kext caches of chameleon?

Comment 7 by Doug Abbott, Jul 23, 2011

I also had this problem and tracked it down. The extension that 
needs to load for this to work is AppleIntelSNBGraphicsFB.kext, and 
it has the "Safe Boot" property. A change was made in 
boot2/drivers.c beginning with r1108. The change is in ParseXML 
around line 807, and removes a check which prevents extensions with 
Safe Boot from being loaded. Apparently, loading that kext at that 
time instead of letting it load later causes a problem. In my case 
it doesn't always fail, but fails randomly, roughly half the time 
(which made this really difficult to track down.) I did extensive 
testing with r1211 after putting the check from r1107 back in 
ParseXML, and HD graphics was completely reliable.

Comment 8 by Cosmosis Jones, Jul 23, 2011

is this committd on the trunk?
Coudl you attach the diff if it's not so we can merge it.

Comment 9 by Cosmosis Jones, Jul 23, 2011

#if 0   /** remove this check. **/
    if (strcmp(XMLCastString(XMLGetProperty(moduleDict, 
kPropOSBundleRequired)), "Safe Boot") == 0)
    {
        // Don't load Safe Boot kexts. NOTE: -x should be check too.
        XMLFreeTag(moduleDict);
        return -2;
    }
#endif

Comment 10 by Doug Abbott, Jul 23, 2011

I'm not a Chameleon developer, and can't commit anything. The change 
(restoring the check from r1107) is to replace line 729:
	TagPtr     moduleDict;
with:
	TagPtr     moduleDict, required;

and replace lines 749-756:

#if 0   /** remove this check. **/   
    if (strcmp(XMLCastString(XMLGetProperty(moduleDict, 
kPropOSBundleRequired)), "Safe Boot") == 0)
    {
        // Don't load Safe Boot kexts. NOTE: -x should be check too.
        XMLFreeTag(moduleDict);
        return -2;
    }
#endif 

with:

    required = XMLGetProperty(moduleDict, kPropOSBundleRequired);
    if ( (required == 0) ||
         (required->type != kTagTypeString) ||
         !strcmp(required->string, "Safe Boot"))
    {
        XMLFreeTag(moduleDict);
        return -2;
    }

I've attached the svn diff file.

Comment 11 by Azimutz, Jul 24, 2011

Doug, seems to me that removing or commenting out
#if 0   /** remove this check. **/ and
#endif is the same thing.. can you try it?

Anyway, why the hell am i the owner of this issue?
Doug should be the owner :P

Comment 12 by Doug Abbott, Jul 24, 2011

The code between "#if 0" and "#endif" is already 
being ignored. (0 evaluates to false.) To fix it you need to make 
the replacement I described.

Comment 13 by Doug Abbott, Jul 24, 2011

It seems to me whoever removed the check should own this, so he can 
reconcile why he did that with the problem it is causing for HD 
2000/3000 graphics. The best solution might not be to just put it 
back, but some change to it instead.

Comment 14 by Azimutz, Jul 24, 2011

Doug, i know that code is being ignored; what i told you was to 
remove the code that is causing it to be ignored, so it's not 
ignored and can do it's job; afaics, it does the same as the old 
code.
About issue owners, you're right and i was just kidding ;)

Comment 15 by Doug Abbott, Jul 25, 2011

Sorry about that. For some reason I misunderstood what you wrote, 
although I don't see why now.

I tried just removing the #if 0 and #endif, and tested that version 
of the check. It does work ok. However, that version of the check 
doesn't correctly handle the case where XMLGetProperty returns 0, 
which causes XMLCastString to return NULL. NULL is not a valid 
argument to strcmp (even the version in libsa), and the result is 
undefined. Admittedly, it may never actually cause a problem, but 
the code from r1107 is more robust in my opinion.

Comment 16 by Evan Lojewski, Jul 25, 2011

I removed the check because it was wrong. I should not be added 
directly in as is, but should be corrected before added back in.

Comment 17 by Evan Lojewski, Jul 25, 2011

I removed the check because it was wrong. I should not be added 
directly in as is, but should be corrected before added back in.

Comment 18 by Doug Abbott, Jul 25, 2011

I'd agree with you that the version of the check that was disabled 
with #if...#endif is wrong, given what I wrote about strcmp and 
NULL. If that's what you mean, is there anything wrong with putting 
back the r1107 version (with the "required" variable)? In 
any case, if you have some new code you'd like me to test, just 
mention it here and I'll be glad to do that.

Comment 19 by Evan Lojewski, Jul 25, 2011

The code that was in there to begin with was wrong. It never checked 
for the safe mode flag. I've added the check back in w/ the safe 
mode check in the last commit. Let me know if it works.
Owner: meklort

Comment 20 by Doug Abbott, Jul 25, 2011

Thanks, I've tested the new code in R1221, and it works fine. HD3000 
graphics is completely reliable when I boot normally. As expected, I 
don't get HD graphics when I boot in safe mode.

Comment 21 by Evan Lojewski, Jul 25, 2011

Status: Fixed

Created: 8 years 1 day ago by Liu Colin

Updated: 7 years 11 months ago

Status: Fixed

Owner: Evan Lojewski

Followed by: 4 persons

Labels:
Priority:Medium
Type:Defect
Target:2.0