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
165 replies to this topic

#21
baongoc124

baongoc124

    InsanelyMac Protégé

  • Members
  • Pip
  • 7 posts
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!

Attached File  DSDT.aml.zip   16.96KB   24 downloads

#22
red555

red555

    InsanelyMac Protégé

  • Members
  • Pip
  • 16 posts
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?

#23
pentothal

pentothal

    InsanelyMac Protégé

  • Members
  • PipPip
  • 75 posts
@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.

Attached Files



#24
mnorthern

mnorthern

    InsanelyMac Protégé

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

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!

Attached File  DSDT.aml.zip   16.96KB   24 downloads


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

#25
calmesal

calmesal

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 167 posts

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.

Attached Files



#26
Felix Chan

Felix Chan

    InsanelyMac Protégé

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

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!


Hi mnorthern, sadly it doesn't work. Actually my LCD0 device doesn't have methods such as _BCM, etc. Maybe this is the problem. Anyway thank you very much for your help :)

#27
Van Gog

Van Gog

    InsanelyMac Protégé

  • Members
  • Pip
  • 11 posts
  • Gender:Male
  • Location:Russia
Hi mnorthern!
I did everything as you said, but the brightness does not work. Scroll brightness and keyboard shortcut work, but the brightness does not change. Could you see my dsdt. Any ideas?
Brightness wake after sleep also doesn't work.
Thank you for your help.
DSDT and ioreg
http://cl.ly/2M451I3W0J3Q

#28
trik82

trik82

    InsanelyMac Protégé

  • Members
  • Pip
  • 22 posts
great work mnorthern!!! it works perfectly on asus u30jc (operation region 0xD34). for those who have this laptop, here it is my patched dsdt

Attached Files



#29
Felix Chan

Felix Chan

    InsanelyMac Protégé

  • Members
  • Pip
  • 19 posts
  • Gender:Male
  • Location:Hangzhou, China
Here is my log after sleep:

3/18/13 8:56:52.000 AM kernel[0]: sleep
3/18/13 8:56:52.000 AM kernel[0]: Wake reason = power-button
3/18/13 8:56:52.000 AM kernel[0]: No interval found for . Using 8000000
3/18/13 8:56:52.000 AM kernel[0]: Previous Sleep Cause: 5
3/18/13 8:56:52.013 AM SyncServer[199]: [0x7f80c8c0be30] |SyncServer|Warning| Refreshing watchdog because of a calendar time change alert.
3/18/13 8:56:52.275 AM WindowServer[94]: handle_will_sleep_auth_and_shield_windows: no action for lock state 1
3/18/13 8:56:55.000 AM kernel[0]: disk1s2: media is not present.
3/18/13 8:56:55.000 AM kernel[0]: hfs: err 6 reading VH blk (iATKOS ML2)
3/18/13 8:56:55.239 AM YoudaoDict[179]: Reachability Flag Status: - ------- networkStatusForFlags
3/18/13 8:56:55.240 AM YoudaoDict[179]: Reachability Flag Status: - ------- networkStatusForFlags
3/18/13 8:56:55.241 AM YoudaoDict[179]: Reachability Flag Status: - ------- networkStatusForFlags
3/18/13 8:56:55.243 AM YoudaoDict[179]: Reachability Flag Status: - ------- networkStatusForFlags
3/18/13 8:56:55.243 AM YoudaoDict[179]: Reachability Flag Status: - ------- networkStatusForFlags
3/18/13 8:56:55.244 AM UserEventAgent[11]: Captive: [mySCCopyWiFiDevices:162] WiFi Device Name == NULL
3/18/13 8:56:55.244 AM YoudaoDict[179]: Reachability Flag Status: - ------- networkStatusForFlags
3/18/13 8:56:55.244 AM YoudaoDict[179]: Reachability Flag Status: - ------- networkStatusForFlags
3/18/13 8:56:55.245 AM YoudaoDict[179]: Reachability Flag Status: - ------- networkStatusForFlags
3/18/13 8:56:55.246 AM YoudaoDict[179]: Reachability Flag Status: - ------- networkStatusForFlags
3/18/13 8:56:55.246 AM YoudaoDict[179]: Reachability Flag Status: - ------- networkStatusForFlags
3/18/13 8:56:55.246 AM YoudaoDict[179]: Reachability Flag Status: - ------- networkStatusForFlags
3/18/13 8:56:55.247 AM YoudaoDict[179]: Reachability Flag Status: - ------- networkStatusForFlags
3/18/13 8:56:55.247 AM YoudaoDict[179]: Reachability Flag Status: - ------- networkStatusForFlags
3/18/13 8:56:55.248 AM YoudaoDict[179]: Reachability Flag Status: - ------- networkStatusForFlags
3/18/13 8:56:55.248 AM YoudaoDict[179]: Reachability Flag Status: - ------- networkStatusForFlags
3/18/13 8:56:55.249 AM YoudaoDict[179]: Reachability Flag Status: - ------- networkStatusForFlags
3/18/13 8:56:55.250 AM YoudaoDict[179]: Reachability Flag Status: - ------- networkStatusForFlags
3/18/13 8:56:55.250 AM YoudaoDict[179]: Reachability Flag Status: - ------- networkStatusForFlags
3/18/13 8:56:55.251 AM YoudaoDict[179]: Reachability Flag Status: - ------- networkStatusForFlags
3/18/13 8:56:55.251 AM YoudaoDict[179]: Reachability Flag Status: - ------- networkStatusForFlags
3/18/13 8:56:55.251 AM YoudaoDict[179]: Reachability Flag Status: - ------- networkStatusForFlags
3/18/13 8:56:55.252 AM YoudaoDict[179]: Reachability Flag Status: - ------- networkStatusForFlags
3/18/13 8:56:55.252 AM YoudaoDict[179]: Reachability Flag Status: - ------- networkStatusForFlags
3/18/13 8:56:55.252 AM YoudaoDict[179]: Reachability Flag Status: - ------- networkStatusForFlags
3/18/13 8:56:55.253 AM YoudaoDict[179]: Reachability Flag Status: - ------- networkStatusForFlags
3/18/13 8:56:55.254 AM YoudaoDict[179]: Reachability Flag Status: - ------- networkStatusForFlags
3/18/13 8:56:55.254 AM YoudaoDict[179]: Reachability Flag Status: - ------- networkStatusForFlags
3/18/13 8:56:55.254 AM YoudaoDict[179]: Reachability Flag Status: - ------- networkStatusForFlags
3/18/13 8:56:55.255 AM YoudaoDict[179]: Reachability Flag Status: - ------- networkStatusForFlags
3/18/13 8:56:55.255 AM YoudaoDict[179]: Reachability Flag Status: - ------- networkStatusForFlags
3/18/13 8:56:55.255 AM YoudaoDict[179]: Reachability Flag Status: - ------- networkStatusForFlags
3/18/13 8:56:55.255 AM YoudaoDict[179]: Reachability Flag Status: - ------- networkStatusForFlags
3/18/13 8:56:55.432 AM _networkd[233]: /usr/libexec/ntpd-wrapper: scutil key State:/Network/Global/DNS not present after 30 seconds
3/18/13 8:56:55.000 AM kernel[0]: USBMSC Identifier (non-unique): 20071114173400000 0xbda 0x159 0x5888
3/18/13 8:56:56.271 AM _networkd[238]: Unable to resolve hostname(s)
3/18/13 8:56:56.322 AM ntpd[97]: proto: precision = 1.000 usec
3/18/13 8:57:07.826 AM WindowServer[94]: CGXGetConnectionProperty: Invalid connection 43267
3/18/13 8:57:07.826 AM WindowServer[94]: CGXGetConnectionProperty: Invalid connection 43267
3/18/13 8:57:07.826 AM WindowServer[94]: CGXGetConnectionProperty: Invalid connection 43267
3/18/13 8:57:07.827 AM WindowServer[94]: CGXGetConnectionProperty: Invalid connection 43267
3/18/13 8:57:07.828 AM WindowServer[94]: CGXGetConnectionProperty: Invalid connection 43267
3/18/13 8:57:07.829 AM WindowServer[94]: dict count after removing entry for window 0x22 is 0
3/18/13 8:57:08.966 AM com.apple.launchd.peruser.501[121]: (com.tencent.ScreenCapture[177]) Exited: Killed: 9
3/18/13 8:57:08.966 AM com.apple.launchd.peruser.501[121]: (com.tencent.localserver[176]) Exited: Killed: 9
3/18/13 8:57:08.966 AM com.apple.launchd.peruser.501[121]: ([0x0-0x15015].com.baidu.inputmethod.BaiduIM[198]) Exited: Killed: 9
3/18/13 8:57:08.977 AM coreservicesd[74]: SendFlattenedData, got error #268435460 (ipc/send) timed out from ::mach_msg(), sending notification kLSNotifyApplicationDeath to notificationID=198
3/18/13 8:57:08.989 AM com.apple.launchd.peruser.501[121]: (org.pqrs.KeyRemap4MacBook.server[158]) Exited: Killed: 9
3/18/13 8:57:08.990 AM coreservicesd[74]: SendFlattenedData, got error #268435459 (ipc/send) invalid destination port from ::mach_msg(), sending notification kLSNotifyApplicationDeath to notificationID=164
3/18/13 8:57:09.006 AM com.apple.launchd.peruser.501[121]: (com.apple.talagent[135]) Exited: Killed: 9
3/18/13 8:57:09.019 AM UserEventAgent[11]: Captive: [UserAgentDied:139] User Agent @port=43527 Died
3/18/13 8:57:09.020 AM com.apple.launchd.peruser.501[121]: ([0x0-0xd00d].com.apple.iTunesHelper[175]) Exited with code: 1
3/18/13 8:57:09.021 AM coreservicesd[74]: SendFlattenedData, got error #268435459 (ipc/send) invalid destination port from ::mach_msg(), sending notification kLSNotifyApplicationDeath to notificationID=115
3/18/13 8:57:09.023 AM com.apple.launchd.peruser.501[121]: (com.apple.UserEventAgent-Aqua[124]) Exited: Killed: 9
3/18/13 8:57:09.025 AM com.apple.launchd.peruser.501[121]: (com.apple.mdworker.shared.04000000-0000-0000-0000-000000000000[223]) Exited: Killed: 9
3/18/13 8:57:09.025 AM com.apple.launchd.peruser.501[121]: (com.apple.mdworker.single.08000000-0000-0000-0000-000000000000[225]) Exited: Killed: 9
3/18/13 8:57:09.027 AM com.apple.launchd.peruser.501[121]: (com.apple.mdworker.lsb.01000000-0000-0000-0000-000000000000[224]) Exited: Killed: 9
3/18/13 8:57:09.262 AM com.apple.launchd[1]: (com.apple.dock.extra[250]) XPC Service could not exec(3). Resetting port.
3/18/13 8:57:09.263 AM coreservicesd[74]: SendFlattenedData, got error #268435459 (ipc/send) invalid destination port from ::mach_msg(), sending notification kLSNotifyApplicationDeath to notificationID=144
3/18/13 8:57:09.264 AM NotificationCenter[145]: Connection interrupted.
3/18/13 8:57:09.271 AM WindowServer[94]: CGXGetConnectionProperty: Invalid connection 43267
3/18/13 8:57:09.271 AM WindowServer[94]: CGXGetConnectionProperty: Invalid connection 43267
3/18/13 8:57:09.271 AM WindowServer[94]: CGXGetConnectionProperty: Invalid connection 43267
3/18/13 8:57:09.272 AM WindowServer[94]: CGXGetConnectionProperty: Invalid connection 43267
3/18/13 8:57:09.272 AM WindowServer[94]: CGXGetConnectionProperty: Invalid connection 43267
3/18/13 8:57:12.713 AM loginwindow[54]: DEAD_PROCESS: 54 console
3/18/13 8:57:13.394 AM loginwindow[54]: Application hardKill returned -600
3/18/13 8:57:13.395 AM WindowServer[94]: CGXGetConnectionProperty: Invalid connection 43267
3/18/13 8:57:13.395 AM WindowServer[94]: CGXGetConnectionProperty: Invalid connection 43267
3/18/13 8:57:13.396 AM WindowServer[94]: CGXGetConnectionProperty: Invalid connection 43267
3/18/13 8:57:13.396 AM WindowServer[94]: CGXGetConnectionProperty: Invalid connection 43267
3/18/13 8:57:13.396 AM WindowServer[94]: CGXGetConnectionProperty: Invalid connection 43267
3/18/13 8:57:13.455 AM shutdown[252]: halt by Felix:
3/18/13 8:57:13.455 AM shutdown[252]: SHUTDOWN_TIME: 1363568233 454866

At the end I shut down the computer. Between then, there are no graphics related messages, I guess.
Any ideas?

#30
baongoc124

baongoc124

    InsanelyMac Protégé

  • Members
  • Pip
  • 7 posts

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


Hi, I don't have Windows installed so I can't send you the screenshot but I can dump whole PCI configuration space. This is the result. And also, my BAR0 is 0xf0000004.
Please tell me if this could help you or not.

Thanks.
root@ubuntu:~# lspci -s 00:02.0 -vvxxxx
00:02.0 VGA compatible controller: Intel Corporation Core Processor Integrated Graphics Controller (rev 12) (prog-if 00 [VGA controller])
Subsystem: Dell Device 0434
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0
Interrupt: pin A routed to IRQ 42
Region 0: Memory at f0000000 (64-bit, non-prefetchable) [size=4M]
Region 2: Memory at d0000000 (64-bit, prefetchable) [size=256M]
Region 4: I/O ports at 1800 [size=8]
Expansion ROM at <unassigned> [disabled]
Capabilities: [90] MSI: Enable+ Count=1/1 Maskable- 64bit-
  Address: fee0f00c  Data: 4169
Capabilities: [d0] Power Management version 2
  Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
  Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [a4] PCI Advanced Features
  AFCap: TP+ FLR+
  AFCtrl: FLR-
  AFStatus: TP-
Kernel driver in use: i915
Kernel modules: i915
00: 86 80 46 00 07 04 90 00 12 00 00 03 00 00 00 00
10: 04 00 00 f0 00 00 00 00 0c 00 00 d0 00 00 00 00
20: 01 18 00 00 00 00 00 00 00 00 00 00 28 10 34 04
30: 00 00 00 00 90 00 00 00 00 00 00 00 05 01 00 00
40: 09 00 0c 01 26 61 b1 00 88 00 c0 00 0f 17 17 17
50: 00 00 50 03 09 00 00 00 00 00 00 00 00 00 00 be
60: 00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00
70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
90: 05 d0 01 00 0c f0 e0 fe 69 41 00 00 00 00 00 00
a0: 11 11 11 00 13 00 06 03 00 00 14 60 25 04 3a 30
b0: 00 00 00 00 00 00 00 00 00 02 00 00 00 00 00 00
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d0: 01 a4 22 00 00 00 00 00 00 00 00 00 00 01 02 00
e0: 00 00 00 00 00 00 00 00 00 80 00 00 00 00 00 00
f0: 00 00 00 00 00 00 00 00 ab 0f 14 00 18 e0 78 bb


#31
mnorthern

mnorthern

    InsanelyMac Protégé

  • Members
  • PipPip
  • 52 posts
  • Gender:Male
  • Location:London, United Kingdom
I have a lot of DSDT's too look at so sorry for any delays guys, I will try to get them sorted as soon as i can

In the meantime, If anyone wants to do their own experimenting with different Operation Regions, this document gives you the registers to look at (search for Backlight)

http://www.x.org/doc...3_Part2_BJS.pdf


In that document, if they say there is a register at 48250h, it means take your bar value and make it to look like 0xB0048250, and use RW-everything for seeing what this value looks like, and then try using DSDT to write these values to Operation Regions

Also try googling for the source code for Linux intel i915 drivers, especially Ironlake patches to those drivers, they're very educational

#32
mnorthern

mnorthern

    InsanelyMac Protégé

  • Members
  • PipPip
  • 52 posts
  • Gender:Male
  • Location:London, United Kingdom
Edit: Does anyone know how difficult is it to write a program that dumps some arbitrary memory locations (like our graphics MMIO registers) on wake up from sleep? This would be so extremely useful for debugging for people who can't enable their backlight

#33
calmesal

calmesal

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 167 posts

I have a lot of DSDT's too look at so sorry for any delays guys, I will try to get them sorted as soon as i can

In the meantime, If anyone wants to do their own experimenting with different Operation Regions, this document gives you the registers to look at (search for Backlight)

http://www.x.org/doc...3_Part2_BJS.pdf


In that document, if they say there is a register at 48250h, it means take your bar value and make it to look like 0xB0048250, and use RW-everything for seeing what this value looks like, and then try using DSDT to write these values to Operation Regions

Also try googling for the source code for Linux intel i915 drivers, especially Ironlake patches to those drivers, they're very educational


Holly Cow! That was a hole science for me, but anyway I found these values on page 59-60 and put it in my dsdt , but nothing.
"My BAR1 0xFAC00004" Am I doing it wrong? I dont know.

Attached Files



#34
warraisraw

warraisraw

    InsanelyMac Protégé

  • Members
  • Pip
  • 47 posts
  • Gender:Male
Hello, backlight is enabled after wake from sleep, the only issue for me is the keyboard. I can't write the password to login again.
I'm using VoodooPS2Controller.kext. (Trackpad and keyboard)
Anyone know how fix this issue? I need modify my dsdt or the kext?

Regards.

#35
calmesal

calmesal

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 167 posts

Hello, backlight is enabled after wake from sleep, the only issue for me is the keyboard. I can't write the password to login again.
I'm using VoodooPS2Controller.kext. (Trackpad and keyboard)
Anyone know how fix this issue? I need modify my dsdt or the kext?

Regards.


What did you do to enable backlight after wakeup?
Delete every PS2Controller you have, install the latest voodoops2controller.kext and ApplePS2Nub.kext.

#36
mnorthern

mnorthern

    InsanelyMac Protégé

  • Members
  • PipPip
  • 52 posts
  • Gender:Male
  • Location:London, United Kingdom
I have read through all the linux drivers + Intel documentation and this should be the (nearly) complete list of registers you need to experiment with. Since people's laptops are so different, it's difficult for me to do this remotely :worried_anim:

The procedure should be:
  • Use RW-everything to note down the value in the register
  • Try defining that register using Operation Regions and storing its correct value in your _WAK method in your DSDT
The following are related to the PCH (south display) controllers
registers ending in C7200, C7204, C7208, C720C C7210 -- should be saved and then restored on wake up

The following are related to the display port and power-related
registers ending in E1180, C6014, C6018, C6040

The following are strictly backlight related
registers ending in 48250, 48254, c8250, c8254

The following is a Legacy Backlight Register. It is possible that your laptop uses legacy mode to set brightness. This register is not memory mapped. Therefore it is not in BAR0 (BAR1). Instead, it is directly in the PCI configuration space.
It is on the device 0:2:0 on the PCI, at the offset 0xF4 (bits 0 to 7)
By writing 0xFF to that location, you will achieve max brightness if legacy mode is enabled.

Please let me know your findings.

Holly Cow! That was a hole science for me, but anyway I found these values on page 59-60 and put it in my dsdt , but nothing.
"My BAR1 0xFAC00004" Am I doing it wrong? I dont know.


Yes what you're forgetting is that you're defining the same thing twice! (Look at your third screenshot)

Your BRIT region is the same as your BRI4 region and your LEVL field is at the exactly same location as your LEVX
The same problem is with BRI2 being in the same location as BRI3 and therefore LEV2=LEVW, so it doesn't make sense to define thing twice
You should define a different region (you can name them BRI5, BRI6 etc) and a different field in that region (LEV3, LEV4 etc) and then make them to point to different registers (E1180, 48250, C6018, etc etc) and then store different values in them depending on your system's values (eg. from RW-everything)

Update:

i STRONGLY suspect that if you write Zero (0x00000000) to your BLC_PWM_CPU_CTL2 (this is in BAR0 at offset 0x00048250) then you should be able to manipulate the brightness by writing to the LBB (Legacy Brightness) register (which is not memory mapped therefore not in BAR0 but instead on the device 0:2:0 on the PCI, at the offset 0xF4 ), so that by writing 0xFF to it you should be able to enable the backlight without having to manipulate all those other registers... the downside would be, you lose all the OS X brightness sliders and buttons unless you hack them somehow

I am trying to learn how to write drivers so that maybe in a few weeks time I will be able to write a kext patch or something, this is a really cool hobby (not advisable if you have a girlfriend/boyfriend)

Question:

Could someone confirm that a _WAK method is guaranteed to be called on computer's wake up from sleep? If it's not guaranteed to be called, then we may be wasting time, because it's simply not called on some people's computers, and they need a kext instead of a DSDT patch

#37
Felix Chan

Felix Chan

    InsanelyMac Protégé

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

I have read through all the linux drivers + Intel documentation and this should be the (nearly) complete list of registers you need to experiment with. Since people's laptops are so different, it's difficult for me to do this remotely :worried_anim:

The procedure should be:

  • Use RW-everything to note down the value in the register
  • Try defining that register using Operation Regions and storing its correct value in your _WAK method in your DSDT
The following are related to the PCH (south display) controllers
registers ending in C7200, C7204, C7208, C720C C7210 -- should be saved and then restored on wake up

The following are related to the display port and power-related
registers ending in E1180, C6014, C6018, C6040

The following are strictly backlight related
registers ending in 48250, 48254, c8250, c8254

The following is a Legacy Backlight Register. It is possible that your laptop uses legacy mode to set brightness. This register is not memory mapped. Therefore it is not in BAR0 (BAR1). Instead, it is directly in the PCI configuration space.
It is on the device 0:2:0 on the PCI, at the offset 0xF4 (bits 0 to 7)
By writing 0xFF to that location, you will achieve max brightness if legacy mode is enabled.

Please let me know your findings.



Yes what you're forgetting is that you're defining the same thing twice! (Look at your third screenshot)

Your BRIT region is the same as your BRI4 region and your LEVL field is at the exactly same location as your LEVX
The same problem is with BRI2 being in the same location as BRI3 and therefore LEV2=LEVW, so it doesn't make sense to define thing twice
You should define a different region (you can name them BRI5, BRI6 etc) and a different field in that region (LEV3, LEV4 etc) and then make them to point to different registers (E1180, 48250, C6018, etc etc) and then store different values in them depending on your system's values (eg. from RW-everything)

Update:

i STRONGLY suspect that if you write Zero (0x00000000) to your BLC_PWM_CPU_CTL2 (this is in BAR0 at offset 0x00048250) then you should be able to manipulate the brightness by writing to the LBB (Legacy Brightness) register (which is not memory mapped therefore not in BAR0 but instead on the device 0:2:0 on the PCI, at the offset 0xF4 ), so that by writing 0xFF to it you should be able to enable the backlight without having to manipulate all those other registers... the downside would be, you lose all the OS X brightness sliders and buttons unless you hack them somehow

I am trying to learn how to write drivers so that maybe in a few weeks time I will be able to write a kext patch or something, this is a really cool hobby (not advisable if you have a girlfriend/boyfriend)

Question:

Could someone confirm that a _WAK method is guaranteed to be called on computer's wake up from sleep? If it's not guaranteed to be called, then we may be wasting time, because it's simply not called on some people's computers, and they need a kext instead of a DSDT patch


Guess that my _WAK is not called; also I don't have _BCM method in my dsdt. Weird.

#38
mnorthern

mnorthern

    InsanelyMac Protégé

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

Guess that my _WAK is not called; also I don't have _BCM method in my dsdt. Weird.


Possibly, but on the other hand, the ACPI specification says http://www.acpi.info...PIspec-2-0c.pdf

"_WAK: Power management control method run once system is awakened."

"7.3.5 \_WAK (System Wake)

After the system wakes from a sleeping state, it will invoke the \_WAK method and pass the sleeping state

value that has ended. This operation occurs asynchronously with other driver notifications in the system

and is not the first action to be taken when the system wakes"

:wallbash: whats going on lol

#39
mnorthern

mnorthern

    InsanelyMac Protégé

  • Members
  • PipPip
  • 52 posts
  • Gender:Male
  • Location:London, United Kingdom
Felix Chan, can you add the following code to the end of your _WAK method and tell me what happens?
Notify (\_SB.PCI0.VID.LCD0, 0x86)
Notify (\_SB.PCI0.PEG.VID.LCD0, 0x86)
Store (0xFF, \BRLV)
\_SB.PCI0.LPC.EC.BRNS ()


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.



Calmesal I think I know what you could try.. Can you make a backup of your ACPI BACKLIGHT kext, then copy the original kext to your desktop, show package contents, change the 'BQC use index' property in the Info.plist file to the opposite of whatever it is saying now, then reinstall using kext wizard, and restart. Let me know if anything changed and if you are still getting those messages in your log, thanks

EVERYONE, one more thing i forgot to mention

You will need the following properties to be injected into your screen's properties. Either via Natit or DSDT (in your GFX0/VID0/graphics device, find or create Method (_DSM, 4, NotSerialized)

and inside it Store (Package ( ) { X }, Local0 )
then call DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)


where X is the code below:

"AAPL,BacklightRestore",
Buffer (0x04)
{
0x01, 0x00, 0x00, 0x00
},

"AAPL,HasPanel",
Buffer (0x04)
{
0x01, 0x00, 0x00, 0x00
},

"AAPL,Haslid",
Buffer (0x04)
{
0x01, 0x00, 0x00, 0x00
},

"AAPL,backlight-control",
Buffer (0x04)
{
0x01, 0x00, 0x00, 0x00
},

"@0,backlight-control",
Buffer (0x04)
{
0x01, 0x00, 0x00, 0x00
},

"@0,AAPL,boot-display",
Buffer (0x04)
{
0x01, 0x00, 0x00, 0x00
},

"@0,built-in",
Buffer ()
{
One
},



#40
warraisraw

warraisraw

    InsanelyMac Protégé

  • Members
  • Pip
  • 47 posts
  • Gender:Male

What did you do to enable backlight after wakeup?
Delete every PS2Controller you have, install the latest voodoops2controller.kext and ApplePS2Nub.kext.



Hello, I tried with these kexts, but still I can't write the password, I think is another issue. Someone can login after wake from sleep? (with or without backlight enabled)
I modified my DSDT with this guide, only I changed the "levels" of 17 steps, because in the low levels my backlight were too dark. Only after reboot, backlight is restored to 100%.
Note: I added code in my DD03 device inside IGPU not in PNLF.

Regards





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