Jump to content

UPDATED 20.12. GenericBrightness.kext


ivik
 Share

674 posts in this topic

Recommended Posts

This is for what was brightness command utility ment for.
yes, but for a deprived guy (as I am), the hope is in further perfecting the menu-let as it seems to be the only solution to get brightness levels change in a better way.
Link to comment
Share on other sites

Hi

 

How do I know which EISAID I set?

 

Device (BRGT)
	{
		Name (_HID, EisaId ("APP0321"))

 

Also,

I've found out with RW-Everything that the EC register for changing the backlight in my laptop (HP DV6t) is:

						DLYT,   8, 
							Offset (0xE2), 
					BRTL,   8, 
							Offset (0xE6),

 

DLYT is for storing the value of the backlight, going in 100 steps from 0x00 to 0x63.

BRTL is read-only for reading the current backlight value.

How does this help me?

Thanks.

Link to comment
Share on other sites

I have _BCL, _BCM, and _BQC in my DSDT, but no "BCL" or "_BCQ" (did you mean the former ones?).

 

Attached my DSDT.dsl.

Thanks.

 

EDIT:

I think this is the relevant part:

				Device (DD02)
			{
				Method (_ADR, 0, Serialized)
				{
					Store (0xE3, DBGD)
					TRAP (TRTI, 0x21)
					If (LEqual (DID2, Zero))
					{
						Return (0x02)
					}
					Else
					{
						Return (And (0xFFFF, DID2))
					}
				}
				Method (_DCS, 0, NotSerialized)
				{
					If (LEqual (LIDS, Zero))
					{
						Return (Zero)
					}
					Return (CDDS (DID2))
				}
				Method (_DGS, 0, NotSerialized)
				{
					If (CondRefOf (SNXD))
					{
						Return (NXD2)
					}
					Return (NDDS (DID2))
				}
				Method (_DSS, 1, NotSerialized)
				{
					If (LEqual (And (Arg0, 0xC0000000), 0xC0000000))
					{
						Store (NSTE, CSTE)
					}
				}
				Method (_BCL, 0, NotSerialized)
				{
					If (IGDS)
					{
						Return (BCLT)
					}
					Else
					{
						Return (BCLT)
					}
				}
				Method (_BCM, 1, NotSerialized)
				{
					If (ECON)
					{
						SBCM (Arg0)
					}
				}
				Method (_BQC, 0, NotSerialized)
				{
					If (ECON)
					{
						Return (GBQC ())
					}
					Else
					{
						Return (GBQC ())
					}
				}
				Method (GBQC, 0, NotSerialized)
				{
					Store (Zero, Local0)
					Store (^^^LPCB.EC0.BRTL, Local1)
					While (LLess (Local0, 0x0B))
					{
						If (IGDS)
						{
							If (LEqual (LCDD, 0x22ECAF06))
							{
								Store (DerefOf (Index (BCL8, Local0)), Local2)
							}
							Else
							{
								If (LEqual (LCDD, 0x1680AF0D))
								{
									Store (DerefOf (Index (BCL9, Local0)), Local2)
								}
								Else
								{
									If (LEqual (LCDD, 0x021BE430))
									{
										Store (DerefOf (Index (BCLB, Local0)), Local2)
									}
									Else
									{
										If (LEqual (LCDD, 0x026AE430))
										{
											Store (DerefOf (Index (BCLC, Local0)), Local2)
										}
										Else
										{
											If (LEqual (LCDD, 0x3651A34C))
											{
												Store (DerefOf (Index (BCLD, Local0)), Local2)
											}
											Else
											{
												Store (DerefOf (Index (BCLD, Local0)), Local2)
											}
										}
									}
								}
							}
						}
						Else
						{
							If (LEqual (LCDD, 0x22ECAF06))
							{
								Store (DerefOf (Index (BCL1, Local0)), Local2)
							}
							Else
							{
								If (LEqual (LCDD, 0x1680AF0D))
								{
									Store (DerefOf (Index (BCL2, Local0)), Local2)
								}
								Else
								{
									If (LEqual (LCDD, 0x021BE430))
									{
										Store (DerefOf (Index (BCL3, Local0)), Local2)
									}
									Else
									{
										If (LEqual (LCDD, 0x109EAF06))
										{
											Store (DerefOf (Index (BCL4, Local0)), Local2)
										}
										Else
										{
											If (LEqual (LCDD, 0x0226E430))
											{
												Store (DerefOf (Index (BCL5, Local0)), Local2)
											}
											Else
											{
												If (LEqual (LCDD, 0x1711AF0D))
												{
													Store (DerefOf (Index (BCL6, Local0)), Local2)
												}
												Else
												{
													If (LEqual (LCDD, 0x3651A34C))
													{
														Store (DerefOf (Index (BCLA, Local0)), ^^^LPCB.EC0.BRTL)
													}
													Else
													{
														If (LEqual (LCDD, 0x026AE430))
														{
															Store (DerefOf (Index (BCLE, Local0)), ^^^LPCB.EC0.BRTL)
														}
														Else
														{
															Store (DerefOf (Index (BCL7, Local0)), Local2)
														}
													}
												}
											}
										}
									}
								}
							}
						}
						If (LEqual (Local1, Local2))
						{
							Add (Local0, 0x02, Local2)
							If (IGDS)
							{
								Store (DerefOf (Index (BCLT, Local2)), Local3)
							}
							Else
							{
								Store (DerefOf (Index (BCLT, Local2)), Local3)
							}
							Store (0x0B, Local0)
						}
						Increment (Local0)
					}
					Return (Local3)
				}
				Method (SBCM, 1, NotSerialized)
				{
					Store (Zero, Local0)
					While (LLess (Local0, 0x0B))
					{
						Add (Local0, 0x02, Local1)
						If (IGDS)
						{
							Store (DerefOf (Index (BCLT, Local1)), Local2)
						}
						Else
						{
							Store (DerefOf (Index (BCLT, Local1)), Local2)
						}
						If (LEqual (Arg0, Local2))
						{
							If (IGDS)
							{
								If (LEqual (LCDD, 0x22ECAF06))
								{
									Store (DerefOf (Index (BCL8, Local0)), DPBL)
								}
								Else
								{
									If (LEqual (LCDD, 0x1680AF0D))
									{
										Store (DerefOf (Index (BCL9, Local0)), DPBL)
									}
									Else
									{
										If (LEqual (LCDD, 0x021BE430))
										{
											Store (DerefOf (Index (BCLB, Local0)), DPBL)
										}
										Else
										{
											If (LEqual (LCDD, 0x026AE430))
											{
												Store (DerefOf (Index (BCLC, Local0)), DPBL)
											}
											Else
											{
												If (LEqual (LCDD, 0x3651A34C))
												{
													Store (DerefOf (Index (BCLD, Local0)), DPBL)
												}
												Else
												{
													Store (DerefOf (Index (BCLD, Local0)), DPBL)
												}
											}
										}
									}
								}
								Store (DPBL, ^^^LPCB.EC0.BRTL)
								AINT (One, DPBL)
							}
							Else
							{
								If (LEqual (LCDD, 0x22ECAF06))
								{
									Store (DerefOf (Index (BCL1, Local0)), ^^^LPCB.EC0.BRTL)
								}
								Else
								{
									If (LEqual (LCDD, 0x1680AF0D))
									{
										Store (DerefOf (Index (BCL2, Local0)), ^^^LPCB.EC0.BRTL)
									}
									Else
									{
										If (LEqual (LCDD, 0x021BE430))
										{
											Store (DerefOf (Index (BCL3, Local0)), ^^^LPCB.EC0.BRTL)
										}
										Else
										{
											If (LEqual (LCDD, 0x109EAF06))
											{
												Store (DerefOf (Index (BCL4, Local0)), ^^^LPCB.EC0.BRTL)
											}
											Else
											{
												If (LEqual (LCDD, 0x0226E430))
												{
													Store (DerefOf (Index (BCL5, Local0)), ^^^LPCB.EC0.BRTL)
												}
												Else
												{
													If (LEqual (LCDD, 0x1711AF0D))
													{
														Store (DerefOf (Index (BCL6, Local0)), ^^^LPCB.EC0.BRTL)
													}
													Else
													{
														If (LEqual (LCDD, 0x3651A34C))
														{
															Store (DerefOf (Index (BCLA, Local0)), ^^^LPCB.EC0.BRTL)
														}
														Else
														{
															If (LEqual (LCDD, 0x026AE430))
															{
																Store (DerefOf (Index (BCLE, Local0)), ^^^LPCB.EC0.BRTL)
															}
															Else
															{
																Store (DerefOf (Index (BCL7, Local0)), ^^^LPCB.EC0.BRTL)
															}
														}
													}
												}
											}
										}
									}
								}
							}
							Store (0x0B, Local0)
						}
						Increment (Local0)
					}
				}

DSDT_after_all_fixes.rar

Link to comment
Share on other sites

No, not yet. I'll try that now.

 

Okay, so I've done that and I get the brightness slider, but as soon as I move it, it goes back to the original position (max).

 

OK, I've added:

		Device (PNLF)
	{
		Name (_HID, EisaId ("APP0002"))
		Name (_CID, "backlight")
		Name (_UID, 0x0A)
		Name (_STA, 0x0B)
	}

And installed the GenericBrightness.kext to /E/E.

I have the slider, but it moves back to original (max) position every time I try to move it.

Link to comment
Share on other sites

Hi Ivik,

 

may you have a look at my dsdt? I am not quite sure where to find proper entry for storing / reading brightness levels. I do have shortkeys for changing brightness in windows os (FN + Pos1 / End). But in OSX they dont work. You can find them in my dsdt searching q14 / q15. They are connected via link to "brlv"????

 

By the way brightness is working with device pnlf + dsdt mod for my x3100. Using an old framebuffer for the x3100 from 10.5.2 i have working brightness, but your solution seems better cause its more vanilla, lecker.

stable.dsl.zip

Link to comment
Share on other sites

Do you have moving slider?

Check in rw-everything if this is register for brightness and try writing to it. If brightness changes (when you write to it), there is hope for you.

am total noob when it's related to rw-everything; btw, I 've got those screenshots and some the values changing in parallel when I change brightness:

brightness up & down respectively seem to be the ones in green: 0801 & 0701

brightness values seem to be the ones in red

post-498884-1292529662_thumb.pngpost-498884-1292529674_thumb.png

post-498884-1292529687_thumb.png

I just installed windows to get those values. If you need anything else, please let me know.

Thanks.

Link to comment
Share on other sites

E2 register is BRTL. Did you try writing to it?

Write down value for every brightness levels.

sorry but am lost here. And yes tried to follow post 50 and your suggestions for swavek, but I don't even know how to:

post-498884-1292534958_thumb.pngpost-498884-1292534946_thumb.png

then I corrected offset to what you did suggest for nvidia, but still, same thing: nothing shown

post-498884-1292536558_thumb.png

please help

Link to comment
Share on other sites

ivik,

 

does this work with GraphicsEnabler?

 

I added PNLF into our DSDT and modified GraphicsEnabler to inject the pwm etc into the DSDT.

 

Here are what I observed during my test:

- Without the pwm injection the slider doesn't stay (always return to max)

- With pwm injection the slider stays, the value on ioreg changed too, but there was no effect on the brightness.

- Using Fn+Brightness Up/Down, I am able to adjust the brightness, only there are no On Screen Display (the sun) indicator. This has been working without PNLF and/or pwm. Also this doesn't move the slider.

 

One strange thing is, the max brightness value in ioregexplorer was very large.

post-508994-1292537907_thumb.png

 

Here is the DSDT I use, please take alook if you have time.

DSDT_withPNLF.zip

 

I am no expert on DSDT, so what actually those values in the /* */ mean for?

Maybe the pwm value I added into GraphicsEnabler is not correct, I just copy them from the few posts above.

Like theking said, it is not a good idea to blindly copy and paste without knowing what it's for.

But then I couldn't help it want to try your solution here.

 

Also, do I need to load the kext you provided on the 1st post?

 

Cheers

Link to comment
Share on other sites

Like in C, or Java, stuff between /* and */ is ignored by the compiler - it's human-readable comments.

 

thx, then the rough injection i added into graphicsenabler

i just checked the DSDT and apparently it has _BCM _BCL and _BQC only they are in Device LCD0

i wonder if it save to move those methods into PNLF instead

Link to comment
Share on other sites

ivik,

 

does this work with GraphicsEnabler?

 

I added PNLF into our DSDT and modified GraphicsEnabler to inject the pwm etc into the DSDT.

 

Here are what I observed during my test:

- Without the pwm injection the slider doesn't stay (always return to max)

- With pwm injection the slider stays, the value on ioreg changed too, but there was no effect on the brightness.

- Using Fn+Brightness Up/Down, I am able to adjust the brightness, only there are no On Screen Display (the sun) indicator. This has been working without PNLF and/or pwm. Also this doesn't move the slider.

 

One strange thing is, the max brightness value in ioregexplorer was very large.

 

Here is the DSDT I use, please take alook if you have time.

 

I am no expert on DSDT, so what actually those values in the /* */ mean for?

Maybe the pwm value I added into GraphicsEnabler is not correct, I just copy them from the few posts above.

Like theking said, it is not a good idea to blindly copy and paste without knowing what it's for.

But then I couldn't help it want to try your solution here.

 

Also, do I need to load the kext you provided on the 1st post?

 

Cheers

 

PNLF loads backlight drivers and gives you slider.

For nvidia, there must be some other info injected (PWM...), from where max brightness is read.

 

Some notebooks have brightness controll with nvidia graphics. Apple also. https://gist.github.com/raw/451904/ecdf2c40...bf8/nvidia_bl.c

 

This is why some dells, samsung, LG have native brightness. (confirmed on this topic)

 

I think that your laptop controlls it with EC0.BRTL.

 

Hm.. that is some big max brightness. Usually is 0x400 for nvidia. Do values from ioreg lineary change when you move slider? (from 0 to max?)

Try Archive2.zip and add _BCL, BCM to PNLF.

 

GraphicsEnabler doesn't injects those values. (PWM, NVMT...)

Link to comment
Share on other sites

GraphicsEnabler doesn't injects those values. (PWM, NVMT...)
Relying on Jingu's effort, I managed to get NVPM and display-cfg injected with my boot-loader. In the same manner, NVMT and pwm-info can also be injected. How useful, is to be verified though.
Link to comment
Share on other sites

Hm.. that is some big max brightness. Usually is 0x400 for nvidia. Do values from ioreg lineary change when you move slider? (from 0 to max?)

 

ivik,

 

i noticed the max brightness number are similar with IODisplayGUID, only added with 80, which is the brightness value if the slider is at the rightmost (max = 80,min = 0)

where this IODisplayGUID came from?

 

i did try GenericBrightness.kext in /E/E but it is not diplayed when i checked it kextstat -l

 

valv,

 

i modified meklort's branch, to inject pwm, backlight-control and display-cfg. the values i used are taken from post # 325, together with PNLF in DSDT I have the slider, only it is not changing the brightness.

the functioning fn keys don't affect this slider.

they seem to be disconnected.

 

the netbook i use is hp mini 311, i think the same model like the king mentioned few posts ahead.

Link to comment
Share on other sites

Relying on Jingu's effort, I managed to get NVPM and display-cfg injected with my boot-loader. In the same manner, NVMT and pwm-info can also be injected. How useful, is to be verified though.

Hi, valv i'm using your great bootloader v.4_07132010 (Many thanks).

 

1. Are NVPM and display-cfg keys injected with your bootloader by default? What values do you used for display-cfg keys or can bootloader calculate it? I searched few IOregs from real Macs and can't find any NVPM key. Is it needed?

2. Do you can to calculate correct values for NVMT and pwm-info keys?

Link to comment
Share on other sites

Hi, valv i'm using your great bootloader v.4_07132010 (Many thanks).

 

1. Are NVPM and display-cfg keys injected with your bootloader by default? What values do you used for display-cfg keys or can bootloader calculate it? I searched few IOregs from real Macs and can't find any NVPM key. Is it needed?

2. Do you can to calculate correct values for NVMT and pwm-info keys?

Hi Bungo,

when GraphicsEnabler=yes. for display-cfg default value is <ff ff ff ff>

NVPM is <01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00>

NVPM as on slice's explanation : "seems to be NVidia PowerManagement aka GPU Speedstep"

needed ? No i don't think so.

 

Some notebooks have brightness controll with nvidia graphics. Apple also. https://gist.github.com/raw/451904/ecdf2c40...bf8/nvidia_bl.c
@ivik, ok slowly but surely

I 've finally ended up understanding how to go with reggie_se.

ps: I have 9600m GT so I should add 61c084 to bar0 (0xD2000000) to get 0xD261C084

but using your kext from the All.zip no value does change (into reggie_se) with brightness (menu-let):

post-498884-1292615580_thumb.png

Also, regarding all the values of brightness, (I got them from rw-everything) from lowest to highest:

14 14, 19 19, 1f 1f, 24 24, 29 29, 2e 2e, 34 34, 3d 3d, 48 48, 55 55, 5c 5c

can you do something with it?

Link to comment
Share on other sites

we managed to get a native GPUPM on Mini 311 by using LegacyAGPM developed by Master Chief, i think you could easily search it on this forum.

it is nothing to do with NVPM DSDT at all.

 

reading the posts here, it seems pwm entry are required for back-light control, but it is kind of hit and miss on what values to use.

Link to comment
Share on other sites

 Share

×
×
  • Create New...