Jump to content

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

first generation HD backlight brightness ACPI DSDT 8086:0046 GMA 5700MHD Ironlake Arrandale

  • Please log in to reply
161 replies to this topic

#1
mnorthern

mnorthern

    InsanelyMac Protégé

  • Members
  • PipPip
  • 52 posts
  • Gender:Male
  • Location:London, United Kingdom
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.insanelym...60#entry1903273

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:)

Attached File  BAR1 screenshot.png   266.77KB   1157 downloads

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!

Attached Files



#2
warraisraw

warraisraw

    InsanelyMac Protégé

  • Members
  • Pip
  • 45 posts
  • Gender:Male
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)

Attached Files



#3
GhostRaider

GhostRaider

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 350 posts
  • Gender:Male
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?

#4
mnorthern

mnorthern

    InsanelyMac Protégé

  • Members
  • PipPip
  • 52 posts
  • Gender:Male
  • Location:London, United Kingdom

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)

#5
GhostRaider

GhostRaider

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 350 posts
  • Gender:Male

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.

#6
mnorthern

mnorthern

    InsanelyMac Protégé

  • Members
  • PipPip
  • 52 posts
  • Gender:Male
  • Location:London, United Kingdom

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!

#7
Felix Chan

Felix Chan

    InsanelyMac Protégé

  • Members
  • Pip
  • 19 posts
  • Gender:Male
  • Location:Hangzhou, China

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.

#8
Felix Chan

Felix Chan

    InsanelyMac Protégé

  • Members
  • Pip
  • 19 posts
  • Gender:Male
  • Location:Hangzhou, China
I've tested methods on #6 but it doesn't work.
Here is my PCI BAR1 address: 0xF2000004, as shown in the figure below.
Attached File  PCI.bmp   1.3MB   151 downloads

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?
Attached File  felix_dsdt.zip   63.81KB   46 downloads

#9
giofrida

giofrida

    InsanelyMac Italy

  • Members
  • PipPipPipPipPipPipPip
  • 658 posts
  • Gender:Male
  • Location:Italy
All is working here! Great job!

#10
mnorthern

mnorthern

    InsanelyMac Protégé

  • Members
  • PipPip
  • 52 posts
  • Gender:Male
  • Location:London, United Kingdom

I've tested methods on #6 but it doesn't work.
Here is my PCI BAR1 address: 0xF2000004, as shown in the figure below.
Attached File  PCI.bmp   1.3MB   151 downloads

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?
Attached File  felix_dsdt.zip   63.81KB   46 downloads


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:
Attached File  Screen1.png   29.04KB   197 downloads
Attached File  my RW-everything2.png   12.29KB   182 downloads

#11
Felix Chan

Felix Chan

    InsanelyMac Protégé

  • Members
  • Pip
  • 19 posts
  • Gender:Male
  • Location:Hangzhou, China
Thanks mnorthern, here are my screenshots.

Attached File  memory.jpg   103.1KB   236 downloads
Attached File  memory-2.jpg   104.82KB   211 downloads

#12
mnorthern

mnorthern

    InsanelyMac Protégé

  • Members
  • PipPip
  • 52 posts
  • Gender:Male
  • Location:London, United Kingdom
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)
...



#13
Felix Chan

Felix Chan

    InsanelyMac Protégé

  • Members
  • Pip
  • 19 posts
  • Gender:Male
  • Location:Hangzhou, China
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.

Attached File  Archive.zip   63.87KB   53 downloads

#14
mnorthern

mnorthern

    InsanelyMac Protégé

  • Members
  • PipPip
  • 52 posts
  • Gender:Male
  • Location:London, United Kingdom

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.

Attached File  Archive.zip   63.87KB   53 downloads


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!

#15
voidRunner

voidRunner

    InsanelyMac Protégé

  • Members
  • Pip
  • 16 posts
Hi all,

Does anyone know which methods OSX calls when "Display Sleep" is triggered by power management?

Best regards,
voidRunner

#16
GhostRaider

GhostRaider

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 350 posts
  • Gender:Male
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.

#17
mnorthern

mnorthern

    InsanelyMac Protégé

  • Members
  • PipPip
  • 52 posts
  • Gender:Male
  • Location:London, United Kingdom

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

#18
GhostRaider

GhostRaider

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 350 posts
  • Gender:Male
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?

Attached File  RW.PNG   431.28KB   67 downloads

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.

Attached Files



#19
mnorthern

mnorthern

    InsanelyMac Protégé

  • Members
  • PipPip
  • 52 posts
  • Gender:Male
  • Location:London, United Kingdom
Okies I will have a look tonight

#20
GhostRaider

GhostRaider

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 350 posts
  • Gender:Male

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.





Also tagged with one or more of these keywords: first generation HD, backlight, brightness, ACPI, DSDT, 8086:0046, GMA, 5700MHD, Ironlake, Arrandale


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

© 2014 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Mac Netbook  |   PHP hosting by CatN  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy