Jump to content
  • Announcements

    • Allan

      Forum Rules   04/13/2018

      Hello folks! As some things are being fixed, we'll keep you updated. Per hour the Forum Rules don't have a dedicated "Tab", so here is the place that we have our Rules back. New Users Lounge > [READ] - InsanelyMac Forum Rules - The InsanelyMac Staff Team. 
mnorthern

[Guide] Backlight + Brightness for Intel 8086:0046 (1st gen HD) (GMA 5700MHD)

181 posts in this topic

Recommended Posts

FOREWORD:

Be warned this is a messy guide for advanced users. This guide will apply if you have first generation Intel graphics also known as GMA 5700MHD (PCI id 8086:0046)

 

It is guaranteed to work on a HP G62 laptop (this laptop doesn't seem to use EC to manage brightness)

It may also work on other laptops, with some experimenting!

 

If it doesn't work, see the replies in this thread before asking for help.

Update: make sure you read other posts in this thread, if your laptop is not a HP G62 laptop, especially post 68 from jerrywilborn which may help you

http://www.insanelymac.com/forum/topic/287133-guide-backlight-brightness-for-intel-80860046-1st-gen-hd-gma-5700mhd/page__st__60?do=findComment&comment=1903273

 

OBJECTIVES:

This guide should help you enable:

  • Brightness keys
  • Brightness slider in preference panel
  • Backlight will work on waking up from ACPI sleep (note: if you ONLY want to enable this fix, and no other fixes, then see post number #6 )
  • Screen dimming will work after a short period of inactivity
  • Screen sleeping will work off after a longer period of inactivity
  • Automatic screen dim when switching to battery power

If you have applied my fixes from another thread, you will need to review them, as a lot has changed.

 

 

PREREQUISITES: First you will need to install hotKoffy's ACPI BACKLIGHT kext (attached).

(Note: Do not install the Generic Brightness kext -- if you have it , try and delete it)

 

----

GUIDE

----

 

Step1:

Find out our graphics BAR0 register (sometimes known as BAR1 register because some people count from 1...)

Mine is at 0xB0000004 so you will notice all my "magic numbers" starting with 0xB....

To find your BAR0/BAR1 address, you will have to look at your integrated graphics PCI configuration space.

It will usually be the second device on PCI bus 0 (device 00:02:00)

You have two options, Expert option: You can use the 64bit lspci driver from these forums and do it on your Mac.

 

Easier option: you can find this info even easier using RW-Everything on windows, but you will have to boot from windows. Download the RW-everything app from Download | RWEverything , start it, go to PCI window, and select your Intel Graphics from the drop down, take note of the BAR1 number (screenshot below:)

 

post-1135561-0-90572800-1363482522_thumb.png

 

The screenshot above is from giofrida's system. Because his BAR0 starts with 0xC.. we will need to modify the OperationRegions below so that 0xB00048254 becomes 0xC00048254, and 0xB00048250 becomes 0xC0048250 etc. You will need to do this for your system.

 

 

Step 2: --- ACTUAL PATCHES---

 

Open your DSDT.aml in a DSDT Editor (see other threads for how to use this. MODIFYING DSDT MAY SCREW UP YOUR COMPUTER SO BE SURE YOU KNOW WHAT YOU'RE DOING.)

 

The following needs to be placed just before the beginning of " Scope (_SB)" ( before the first occurence of this string in your DSDT). Make sure you change the magic numbers to comply with your BAR0.

 



OperationRegion (BRIT, SystemMemory, 0xB0048254, 0x04)
Field (BRIT, AnyAcc, Lock, Preserve)
{
LEVL, 32
}
OperationRegion (BRI2, SystemMemory, 0xB0048250, 0x04)
Field (BRI2, AnyAcc, Lock, Preserve)
{
LEV2, 32
}
OperationRegion (BRI3, SystemMemory, 0xB00C8250, 0x04)
Field (BRI3, AnyAcc, Lock, Preserve)
{
LEVW, 32
}
OperationRegion (BRI4, SystemMemory, 0xB00C8254, 0x04)
Field (BRI4, AnyAcc, Lock, Preserve)
{
LEVX, 32
}

 

2. Now, the following assumes your graphics module is called GFX0 and that the LCD is listed as the second sub-device of GFX0. To find your graphics module, you can try and look for the line "Name (_ADR, 0x00020000)". The LCD should be the second sub device, mine is called DD02. You can use IOREG to confirm the name of your graphics (eg. GFX0). You can use the following method to identify the LCD sub-device: simply, go to your GFX0 (or equivalent), and

then under that device, identify the sub-device that has those methods (_BCM, _BCQ, _BCL).

YOU NEED TO REMEMBER TO NAME THIS SUB- DEVICE by adding the following line:

Name (_HID, EisaId ("LCD1234"))

in my case it looks like this


Device (DD02)
{
Name (_HID, EisaId ("LCD1234"))
...

 

3. Then, you will need to add a new device PNLF. Usually you will have to add this before the beginning of Scope _PR, or after all other devices. IF YOU ALREADY HAVE ANOTHER PNLF DEVICE, you will need to replace any other PNLF you may already have (delete it and then use my code instead).

 

 


Device (PNLF)
{
Name (_HID, EisaId ("APP0002"))
Name (_CID, "backlight")
Name (_UID, 0x0A)
Name (_STA, 0x0B)
Method (_BCL, 0, NotSerialized)
{
Return (Package (0x13)
{
0x64,
0x32,
Zero,
0x06,
0x0C,
0x12,
0x18,
0x1E,
0x24,
0x2A,
0x30,
0x36,
0x3C,
0x42,
0x48,
0x4E,
0x54,
0x5A,
0x64
})
}
Method (_BCM, 1, NotSerialized)
{
Store (0x80000000, LEV2)
If (LGreaterEqual (Arg0, 0x64))
{
Store (0x12FF, LEVL)
}
Else
{
If (LGreaterEqual (Arg0, 0x5A))
{
Store (0x11FF, LEVL)
}
Else
{
If (LGreaterEqual (Arg0, 0x54))
{
Store (0x103A, LEVL)
}
Else
{
If (LGreaterEqual (Arg0, 0x4E))
{
Store (0x0EBB, LEVL)
}
Else
{
If (LGreaterEqual (Arg0, 0x48))
{
Store (0x0B24, LEVL)
}
Else
{
If (LGreaterEqual (Arg0, 0x42))
{
Store (0x0873, LEVL)
}
Else
{
If (LGreaterEqual (Arg0, 0x3C))
{
Store (0x065B, LEVL)
}
Else
{
If (LGreaterEqual (Arg0, 0x36))
{
Store (0x04C8, LEVL)
}
Else
{
If (LGreaterEqual (Arg0, 0x30))
{
Store (0x0396, LEVL)
}
Else
{
If (LGreaterEqual (Arg0, 0x2A))
{
Store (0x02B0, LEVL)
}
Else
{
If (LGreaterEqual (Arg0, 0x24))
{
Store (0x0266, LEVL)
}
Else
{
If (LGreaterEqual (Arg0, 0x1E))
{
Store (0x0218, LEVL)
}
Else
{
If (LGreaterEqual (Arg0, 0x18))
{
Store (0x01D1, LEVL)
}
Else
{
If (LGreaterEqual (Arg0, 0x12))
{
Store (0x0191, LEVL)
}
Else
{
If (LGreaterEqual (Arg0, 0x0C))
{
Store (0x0161, LEVL)
}
Else
{
If (LGreaterEqual (Arg0, 0x06))
{
Store (0x0132, LEVL)
}
Else
{
If (LGreaterEqual (Arg0, Zero))
{
Store (0x82, LEVL)
}
Else
{
Store (0x11FF, LEVL)
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
Method (_BQC, 0, NotSerialized)
{
Return (^^PCI0.GFX0.DD02._BQC ())
}
Method (_DOS, 1, NotSerialized)
{
^^PCI0.GFX0._DOS (Arg0)
}
}

 

In the code snippet above, you may have to change whenever it says "PCI0.GFX0..." to your equivalent, eg. say "_SB.PCI0.VGA0" or something.

 

Provided, the KEXTs were installed, this will enable your brightness slider, and it should work without problems incrementing/decrementing brightness in 17 discrete brightness steps (16 + zero state), and this is the number of steps needed to enable the brightness keys, so they will work now!

 

The final step is to enable Backlight after wake-up. The 1st gen HD graphics uses two special registers to achieve this, and the following will fix it for you:

  • Search your DSDT for the method _WAK
  • Add two lines to the beginning, so that it looks like this:
    Method (_WAK, 1, Serialized)
    {
     Store (0x80000000, LEVW)
     Store (0x13121312, LEVX)
    ...
    


Voila! Happy to help you with your DSDT's if you have any problems! Report if it's worked!

ACPIBacklight.kext.zip

Share this post


Link to post
Share on other sites

Hello, awesome work!

Backlight keys and slider are working perfectly and now backlight work after sleep. The issue for me is after sleep I can't write password and then login, only mouse pointer is work. And after reboot the brightness is restored to 100%.

 

Thanks mnorthern for this excellent guide.

 

Regards.

 

(DSDT attached)

MyDSDT.zip

Share this post


Link to post
Share on other sites

Backlight works after sleep? So does this guide enables the screen to wake up from sleep? Like in my case, I press sleep, it sleeps and when I wake it up from sleep, the screen is still black. Will this guide fix this issue?

Share this post


Link to post
Share on other sites

Backlight works after sleep? So does this guide enables the screen to wake up from sleep? Like in my case, I press sleep, it sleeps and when I wake it up from sleep, the screen is still black. Will this guide fix this issue?

 

Yes it should fix this issue. I had the same issue, and that's why I created this guide.

 

So you only have issues with sleep, and no issues with brightness keys and brightness setting?

 

Hello, awesome work!

Backlight keys and slider are working perfectly and now backlight work after sleep. The issue for me is after sleep I can't write password and then login, only mouse pointer is work. And after reboot the brightness is restored to 100%.

 

Thanks mnorthern for this excellent guide.

 

Regards.

 

(DSDT attached)

 

You're very welcome indeed. I will try and do some research on how to store brightness so that it is remembered after restart. Regarding your keyboard issue, I'm not sure what this could be. Have you tried playing with the USB settings in chameleon (USB legacy setting)

Share this post


Link to post
Share on other sites

Yes it should fix this issue. I had the same issue, and that's why I created this guide.

 

So you only have issues with sleep, and no issues with brightness keys and brightness setting?

 

 

Yeah just the black screen problem. My brightness keys work, i mean is that weird? The only difference is that I don't have the slider in System Preferences, and the little sun that pops up when changing brightness doesn't appear. If I press FN+Brightness Up or FN+Brightness Down it changes.

Share this post


Link to post
Share on other sites

Yeah just the black screen problem. My brightness keys work, i mean is that weird? The only difference is that I don't have the slider in System Preferences, and the little sun that pops up when changing brightness doesn't appear. If I press FN+Brightness Up or FN+Brightness Down it changes.

 

If you are happy with your brightness keys etc, and only want to fix the backlight after sleep, only apply the following steps:

 

1. Find your BAR0 as per the guide

2. Only apply the following Operation Regions (fill in with correct magic numbers, based on your BAR0 as per the guide)

 

OperationRegion (BRI3, SystemMemory, INSERT_YOUR_MAGIC_NUMBER_HERE[0xB00C8250] , 0x04)
Field (BRI3, AnyAcc, Lock, Preserve)
{
LEVW, 32
}
OperationRegion (BRI4, SystemMemory, INSERT_YOUR_MAGIC_NUMBER_HERE[0xB00C8254], 0x04)
Field (BRI4, AnyAcc, Lock, Preserve)
{
LEVX, 32
}

 

 

3. Search your DSDT for the method _WAK

 

Add two lines to the beginning, so that it looks like this:

 

 

Method (_WAK, 1, Serialized)

{

Store (0x80000000, LEVW)

Store (0x13121312, LEVX)

...

 

 

Do not apply any other changes, and do not install any kexts... let me know if it's worked!

Share this post


Link to post
Share on other sites

Yeah just the black screen problem. My brightness keys work, i mean is that weird? The only difference is that I don't have the slider in System Preferences, and the little sun that pops up when changing brightness doesn't appear. If I press FN+Brightness Up or FN+Brightness Down it changes.

 

Mine is exactly the same as yours. My model is ThinkPad x201i with Intel i3 370M, and the Intel 5700MHD graphics.

 

Hi, mnorthern, thank you for your excellent work but I'm not able to figure out my BAR0 address. I don't have a working Windows running on this ThinkPad; moreover, I only need to resolve the no-blacklight-from-sleep issue since my Fn+Brightness keys are working.

 

Would you be more specific on where to download the correct lspci for ML and how I can locate the correct address? Thanks ahead.

Share this post


Link to post
Share on other sites

I've tested methods on #6 but it doesn't work.

Here is my PCI BAR1 address: 0xF2000004, as shown in the figure below.

PCI.bmp

 

So I modified my magic numbers to be 0xF20C8250 and 0xF20C8254, added the _WAK fields, and reboot. Doesn't work.

Since the BAR1 address starts at 04, I then modified the magic numbers to be 0xF20C8254 and 0xF20C8258. Doesn't work neither.

 

Attached is my dsdt. @mnorthern would you please take time to have a look at it?

felix_dsdt.zip

Share this post


Link to post
Share on other sites

I've tested methods on #6 but it doesn't work.

Here is my PCI BAR1 address: 0xF2000004, as shown in the figure below.

PCI.bmp

 

So I modified my magic numbers to be 0xF20C8250 and 0xF20C8254, added the _WAK fields, and reboot. Doesn't work.

Since the BAR1 address starts at 04, I then modified the magic numbers to be 0xF20C8254 and 0xF20C8258. Doesn't work neither.

 

Attached is my dsdt. @mnorthern would you please take time to have a look at it?

felix_dsdt.zip

 

Hello Felix Chan. My BAR0 is actually 0xB0000004 so you should be fine with the numbers 0xF20C8250 and 0xF20C8254. I will have a look at your DSDT in a second, but first can you send me some screenshots. Could you run RW-everything and click on the "Memory" window and then go to the location 0xF20C8250, click on the 32-bit word button and send me the screenshot of what you're seeing. Also send me a similar screenshot of the location 0xF20C7200, thanks!

 

Attached are my screenshots for those locations:

post-1135561-0-39132400-1363526655_thumb.png

post-1135561-0-36921800-1363526728_thumb.png

Share this post


Link to post
Share on other sites

Felix Chan, thanks for the screenshots, can you please change your WAK to look like this

 


Method (_WAK, 1, Serialized)
{
Store (0x80000000, LEVW)
Store (0x061A061A, LEVX)
...

 

 

Test it.

 

If it doesn't work, try adding in the remaining Operation Regions

 

OperationRegion (BRIT, SystemMemory, 0xF2048254, 0x04)
Field (BRIT, AnyAcc, Lock, Preserve)
{
LEVL, 32
}
OperationRegion (BRI2, SystemMemory, 0xF2048250, 0x04)
Field (BRI2, AnyAcc, Lock, Preserve)
{
LEV2, 32
}

 

and changing your WAK again

 

 


Method (_WAK, 1, Serialized)
{
Store (0x80000000, LEVW)
Store (0x061A061A, LEVX)
Store (0x80000000, LEV2)
Store (0x12FF, LEVL)
...

Share this post


Link to post
Share on other sites

Hi, mnorthern. Thanks for your instruction but it doesn't seem to work on my laptop.

 

I can adjust backlight level by fn+backlight buttons (however no sun icon appears), and my laptop can go to sleep normally. The problem is that after wake from sleep, the backlight doesn't light up. I can see the LCD output with a torch, and the keyboard and mouse both work well.

 

The graphic drivers I used are exactly the same as in your post here: http://www.insanelym...-graphics-qeci/

 

Also I have two strange kexts: AppleBacklight.kext and AppleBacklightExpert.kext. I've tried to delete both of them and it works as usual, nothing changed.

 

If you have time, please help me find out a clue :)

 

Attached is my updated dsdt. Thanks a lot.

 

Archive.zip

Share this post


Link to post
Share on other sites

Hi, mnorthern. Thanks for your instruction but it doesn't seem to work on my laptop.

 

I can adjust backlight level by fn+backlight buttons (however no sun icon appears), and my laptop can go to sleep normally. The problem is that after wake from sleep, the backlight doesn't light up. I can see the LCD output with a torch, and the keyboard and mouse both work well.

 

The graphic drivers I used are exactly the same as in your post here: http://www.insanelym...-graphics-qeci/

 

Also I have two strange kexts: AppleBacklight.kext and AppleBacklightExpert.kext. I've tried to delete both of them and it works as usual, nothing changed.

 

If you have time, please help me find out a clue :)

 

Attached is my updated dsdt. Thanks a lot.

 

Archive.zip

 

Hmmm i see that your _WAK method is really big and there are a lot of calls to both EC and the video module.

 

Maybe those calls actually override the magic numbers that we are trying to store?

 

I suggest moving our four Store(..)Store(..)Store(...)Store(...) lines and seeing what happens

 

Let's put them at the end of the _WAK method, to make sure we override whatever else was stored before.

 

To be exact , let's put them between "Store (Zero, RRBF)" and "Return (WAKI)", and see what happens!

Share this post


Link to post
Share on other sites

I tried this but it does not wake up from sleep. The thing is, if I press any keyboard button or press the trackpad buttons, they're dead. The only way it will wake up is if I press the power button. However, the screen is still black, the buttons don't respond, the LED keyboard lights are off, trackpad doesn't respond, and the HDD flashes once and the fan starts getting loud. I think at this point the computer is technically dead and have to do a hard reset.

Share this post


Link to post
Share on other sites

I tried this but it does not wake up from sleep. The thing is, if I press any keyboard button or press the trackpad buttons, they're dead. The only way it will wake up is if I press the power button. However, the screen is still black, the buttons don't respond, the LED keyboard lights are off, trackpad doesn't respond, and the HDD flashes once and the fan starts getting loud. I think at this point the computer is technically dead and have to do a hard reset.

 

Can you send me your original DSDT , and your DSDT after patching with the stuff above? That's really peculiar. If you put a correct BAR0 number, then the only affected thing should be your graphics controller. Your keyboard or other buttons shouldn't be affected, unless there's something weird going on that I haven't figured out

 

 

I hope you didn't delete any stuff from your _WAK method, only added my stuff to the beginning

Share this post


Link to post
Share on other sites

The Bar 1 number that RW gave me is 0xF0000004, but you said that 0xF is what I need to replace in your code right?

 

post-620531-0-24726900-1363548744_thumb.png

 

The DSDTs are attached. I installed your kext and the backlight slider in System Preferences works. The only thing is that if I reboot, the brightness resets to high.

 

Actually your fix does not cause my problem. I've had that problem for a long time now. Other than that there is something wrong when it wakes up and I don't know how to fix it.

DSDT before Brightness.zip

DSDT after Brightness.zip

Share this post


Link to post
Share on other sites

Okies I will have a look tonight

 

Thank you and hopefully something can be found, and thanks for writing this great guide. :smoke: For others just follow the instructions carefully and it should work for all. Maybe when the DSDT does not refer to GFX0 is when people get confused. Its the same thing but instead of that its another abbreviation such as VID0 or something similar. Also make sure your using the correct place where the LCD is being used. In most cases it is on DD02, but again in DSDT editor search for methods _BCM, _BCQ, _BCL and the string will say which DD## is being used.

 

You can download my DSDT after brightness above to use it as a guide in case there is still confusion.

Share this post


Link to post
Share on other sites

Hi mnorthern,

I tried to follow your guide and my backlight slider in preferences dialog works now. But I still cannot use my backlight keys and my screen doesn't wake up after sleep too.

Please take a look at my patched DSDT.

 

Thank you very much!

 

DSDT.aml.zip

Share this post


Link to post
Share on other sites

GJ mnorthern :thumbsup_anim:

 

Just a quick question, do I need ACPI BACKLIGHT kext if I just want to try the wake-from-sleep backlight fix?

 

Also is it feasable for somebody to write an app/gui which finds out our graphics BAR0 register and auto patches a DSDT?

Share this post


Link to post
Share on other sites

@mnorthern

I have problems with the FB. Basically the Apple logo and the spinning wheel disappear and I'm stuck with a whitish screen. I add my DSDT so you can check it out and see if there is something strange.

DSDT.aml.zip

Share this post


Link to post
Share on other sites

Hi mnorthern,

I tried to follow your guide and my backlight slider in preferences dialog works now. But I still cannot use my backlight keys and my screen doesn't wake up after sleep too.

Please take a look at my patched DSDT.

 

Thank you very much!

 

DSDT.aml.zip

 

Hello I will have a look, if you can also send me the same screenshots as Felix Chan, that might help too!

 

GJ mnorthern :thumbsup_anim:

 

Just a quick question, do I need ACPI BACKLIGHT kext if I just want to try the wake-from-sleep backlight fix?

 

Also is it feasable for somebody to write an app/gui which finds out our graphics BAR0 register and auto patches a DSDT?

 

hiya no it shouldnt be needed for wake-up! also, i think i could write an app that uses LPCI to get the BAR0, actually thats a good idea

 

@mnorthern

I have problems with the FB. Basically the Apple logo and the spinning wheel disappear and I'm stuck with a whitish screen. I add my DSDT so you can check it out and see if there is something strange.

 

yes gonna have a look tonight or tomorrow

Share this post


Link to post
Share on other sites

Okies I will have a look tonight

 

OK i've posted a new thread in http://www.insanelym...hd-gma-5700mhd/

 

 

Everyone, please go check out this new guide to find out how to enable wake up from sleep and brightness keys!

 

calmesal, I'm finally gonna look at your DSDT now! :D

EDIT: I have compiled the following DSDT for you calmesal, but you will have to confirm that your BAR0 offset is OK before you use it (have a look at the new guide to see how to use RW-everything. Change the magic numbers if your BAR0 is different\)

 

I moved here.

I applied the BAR1 magic number to the dsdt and compiled without error, but it doesn't work.

Any more ides?

 

Edit. I found this in kernel log.

post-21176-0-81192900-1363564909_thumb.png

DSDT.aml.zip

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Recently Browsing   0 members

    No registered users viewing this page.

×