Jump to content

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


mnorthern
 Share

182 posts in this topic

Recommended Posts

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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

  • Like 1
Link to comment
Share on other sites

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

  • Like 1
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

post-21176-0-49960600-1363641245_thumb.png

post-21176-0-01763300-1363641254_thumb.png

post-21176-0-73262500-1363641263_thumb.png

DSDT.aml.zip

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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
},

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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)

Hello,

I added DSM method to my GFX0 and nothing changed.

Only backlight slider works.

Backlight keys don't work and screen is still black after wake up.

 

I also have my backlight at 100% after boot. Does anyone know how to fix this?

 

Thanks.

Link to comment
Share on other sites

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

I solved the problem with the backlight.kext by changing the "BQC use index" to FALSE, no there is no error.

But frankly I am confused regarding the BAR1 and BRI values. I cannot manage to find the right values, it is here my my problem.

I will be grateful if you could take a look at my dsdt file.

post-21176-0-21727400-1363721100_thumb.png

post-21176-0-52185000-1363721107_thumb.png

post-21176-0-43905900-1363721115.png

DSDT.aml.zip

Link to comment
Share on other sites

@mnorthern, good news here! I'm now able to wake up with backlight, finally! Attached is my working dsdt.

 

The changes are that I removed the original _WAK contents and added what you gave me:

 

Method (_WAK, 1, NotSerialized)
{
 Store (0x80000000, LEVW)
 Store (0x061A061A, LEVX) // This value should vary based on the RW Everything inspect results
 Store (0x80000000, LEV2)
 Store (0x12FF, LEVL)
 Return (Package (0x02)
 {
	 Zero,
	 Zero
 })
}

 

To enable sleep, I also removed my EHC2 device, which maybe the SD card slot; however I have to keep the EHC1 device so that my external USB wireless card (with a RTL8192CU7 chip) will resume working after waking up.

 

This is, however, only a special case for this strange graphic card. I'm not sure why it works without all the wake up logic; also, I don't understand why my Fn+Brightness keys work without showing the sun icon on screen.

 

BTW, the annoying coil sound remains.

 

Again thank you very much @mnorthern!

Archive.zip

  • Like 1
Link to comment
Share on other sites

@mnorthern, good news here! I'm now able to wake up with backlight, finally! Attached is my working dsdt.

 

The changes are that I removed the original _WAK contents and added what you gave me:

 

Method (_WAK, 1, NotSerialized)
{
 Store (0x80000000, LEVW)
 Store (0x061A061A, LEVX) // This value should vary based on the RW Everything inspect results
 Store (0x80000000, LEV2)
 Store (0x12FF, LEVL)
 Return (Package (0x02)
 {
	 Zero,
	 Zero
 })
}

 

To enable sleep, I also removed my EHC2 device, which maybe the SD card slot; however I have to keep the EHC1 device so that my external USB wireless card (with a RTL8192CU7 chip) will resume working after waking up.

 

This is, however, only a special case for this strange graphic card. I'm not sure why it works without all the wake up logic; also, I don't understand why my Fn+Brightness keys work without showing the sun icon on screen.

 

BTW, the annoying coil sound remains.

 

Again thank you very much @mnorthern!

 

This is interesting. You think this will work on my laptop? But why did you have to remove EHC2? How did you know that was causing a problem?

  • Like 1
Link to comment
Share on other sites

I solved the problem with the backlight.kext by changing the "BQC use index" to FALSE, no there is no error.

But frankly I am confused regarding the BAR1 and BRI values. I cannot manage to find the right values, it is here my my problem.

I will be grateful if you could take a look at my dsdt file.

Ok. A Little progress. I found the operation region values and put it in my dsdt, and now I can change backlight with slider and Fn-keys with the Sunlight apearing on the screen. Now to the resume after sleep and and resetting the backlight level. I will post the same screenshots to you as Filip chan in hoping you can figure out my _wak method, I suspect that it is something wrong with it.

Still can not get rid of the message "getindexforlevel(50)not found in _BCL table"

post-21176-0-85228200-1363803093_thumb.png

post-21176-0-02899100-1363803105_thumb.png

post-21176-0-59987600-1363803117_thumb.png

post-21176-0-47978400-1363803131_thumb.png

DSDT.zip

post-21176-0-33769100-1363804113_thumb.png

post-21176-0-33259600-1363804123_thumb.png

post-21176-0-56328000-1363807563_thumb.png

post-21176-0-74152900-1363981850_thumb.png

  • Like 1
Link to comment
Share on other sites

This is interesting. You think this will work on my laptop? But why did you have to remove EHC2? How did you know that was causing a problem?

 

I've to remove EHC2 since it wakes up the system automatically right after it sleeps; after removing EHC2, the system sleeps well :)

Also, my EHC1 has to be kept so that the USB ports should work. If not, the external wireless card driver will not work.

Link to comment
Share on other sites

 Share

×
×
  • Create New...