Jump to content

UPDATED 20.12. GenericBrightness.kext


ivik
 Share

674 posts in this topic

Recommended Posts

For me it is 0x0 for min and 0xF for max brightness.

 

What do you mean under buggy brightness change?

 

Same problem here, and same values (ioreg) that BlackCH in my Aspire 4320 with X3100 graphics; for example if I press bright "UP" (mapped as Pause) one time the brightness is up but if I press pause again then the screen light is "almost" off and same behavior for Fn+F12 (down).

Link to comment
Share on other sites

What do you mean under buggy brightness change?

Brightnes from ioreg is readed once per sec, and if it changed ACPI methods are then called.

 

Yes, I tryed your code, but it didnt make a difference yet.

 

I mean the brightness doesnt change gradually (it jumps up and down until the screen is competely dark) and this happens when pressing keys or moving the slider; moreover, the brightness isnt homogenic along the screen (one half is darker than the other)... I get that with or without your kext/dsdt code. Theres only a small segment of the slider (the upper 5%) in which the brightness control works and the screen looks OK.

 

I used to patch the X3100 driver (thats what I have on board) in order to bypass the brightness control routine (This method). In this way I could use purely ACPI calls with the keys asigned for brightness up-down (f7 and f8; same as for windows) and it would work fine, but of course I wouldnt get the on-screen icon nor the slider or any brightness-related functions

 

I will try to read the windows values, but how do you go to make AppleBacklightDisplay to use these values?

Link to comment
Share on other sites

Could you post your dsdt?

 

Try moving slider and read brightness from ioreg. Move it slowly and read changes. You must relaunch ioreg after changing brightness

Maybe is some weird offset in ioreg.

 

Yes, I tryed your code, but it didnt make a difference yet.

 

I mean the brightness doesnt change gradually (it jumps up and down until the screen is competely dark) and this happens when pressing keys or moving the slider; moreover, the brightness isnt homogenic along the screen (one half is darker than the other)... I get that with or without your kext/dsdt code. Theres only a small segment of the slider (the upper 5%) in which the brightness control works and the screen looks OK.

 

I used to patch the X3100 driver (thats what I have on board) in order to bypass the brightness control routine (This method). In this way I could use purely ACPI calls with the keys asigned for brightness up-down (f7 and f8; same as for windows) and it would work fine, but of course I wouldnt get the on-screen icon nor the slider or any brightness-related functions

 

I will try to read the windows values, but how do you go to make AppleBacklightDisplay to use these values?

 

Post your dsdt. And watch ioreg when changing brightness slider. Values should go linear up/down.

Link to comment
Share on other sites

OMG... what did you do with your dsdt... :/

 

It would be better if you posted vanilla one, so many methods modified, deleted...

 

try this one, maybe could work..

 

I didnt, Im actually testing it by request (seems to work OK though). Sorry, I shouldnt have posted that one

Here is one with minimum modifications if you like to see:

dsdt_v0.01.dsl.zip

 

 

EDIT:

I tryed the one you uploaded. no changes

The values I can see in the ioreg as I change the brightness by a key stroke are:

1ee, 1cf, 1b0, 191, 173, 154, 135, 116, f7, d8, b9, 9a, 7c, 5d, 3e, 1f, 0

 

Something I didnt mention before is that I get the message:

11/12/10 3:53:50 PM	kernel	IG: Invalid firmware max backlight setting

 

Thanks

Link to comment
Share on other sites

What does with that one kernel log says abou max/min brightness and levels?

 

Try this one:

 

No changes on the brightness control.

Kernel log says:

 

11/12/10 9:15:10 PM	kernel	Acpi brightness levels:11, lowest brightness:30, highest brightness:100

 

before it was 16 - 20 - 100

Link to comment
Share on other sites

I tried with the BlackCH posted values and inserted in my dsdt:

 

		Device (PNLF)
	 {
		 Name (_HID, EisaId ("APP0002"))
		 Name (_CID, "backlight")
		 Name (_UID, 0x0A)
		 Name (_STA, 0x0B)
		 Method (_BCL, 0, NotSerialized)
		 {
			 Return (Package (0x12)
			 {
				 0x01EE, 
				 0x001F, 
				 0x001F, 
				 0x003E, 
				 0x005D, 
				 0x007C, 
				 0x009A, 
				 0x00B9, 
				 0x00D8, 
				 0x00F7, 
				 0x0116, 
				 0x0135, 
				 0x0154, 
				 0x0173, 
				 0x0191, 
				 0x01B0, 
				 0x01CF, 
				 0x01EE, 
			 })
		 }

		 Name (BCLP, Package (0x10)
		 {
				 0x001F, 
				 0x003E, 
				 0x005D, 
				 0x007C, 
				 0x009A, 
				 0x00B9, 
				 0x00D8, 
				 0x00F7, 
				 0x0116, 
				 0x0135, 
				 0x0154, 
				 0x0173, 
				 0x0191, 
				 0x01B0, 
				 0x01CF, 
				 0x01EE, 
		 })
		 Name (BCLL, Package (0x10)
		 {
			 Zero, 
			 One, 
			 0x02, 
			 0x03, 
			 0x04, 
			 0x05, 
			 0x06, 
			 0x07, 
			 0x08, 
			 0x09, 
			 0x0A, 
			 0x0B, 
			 0x0C, 
			 0x0D, 
			 0x0E, 
			 0x0F, 
		 })
		 Method (_BCM, 1, NotSerialized)
		 {
			 Store (Match (BCLP, MEQ, Arg0, MTR, Zero, Zero), Local0)
			 If (LNotEqual (Local0, Ones))
			 {
				 Store (DerefOf (Index (BCLL, Local0)), ^^PCI0.LPCB.EC0.BLVL)
			 }
		 }
	 Method (_BQC, 0, NotSerialized)
	 {
	 Store(\_SB_.PCI0.LPCB.EC0.BLVL, Local0)
	 If(LNot(LGreater(Local0, 0xf)))
	 {
		 Return(DerefOf(Index(BCLP, Local0, )))
	 }
	 Else
	 {
		 Return(Zero)
	 }
	 }
	 }

 

And works partially; only the first 8 steps (counted in "sun" icon). I unknow if the step number by default ( in the mine are 9 steps in bios or windows) is related to 16 steps in brightness control (sun).

Link to comment
Share on other sites

No changes on the brightness control.

Kernel log says:

 

11/12/10 9:15:10 PM	kernel	Acpi brightness levels:11, lowest brightness:30, highest brightness:100

 

before it was 16 - 20 - 100

 

Hi again... try this dsdt

 

 

@quinielascom

Could you post your dsdt? Clean as posiblle please.

dsdt.aml.zip

Link to comment
Share on other sites

@quinielascom

 

try this dsdt:

 

Thanks, working fine here.

 

In dmesg: Acpi brightness levels:10, lowest brightness:10, highest brightness:100

 

Last step: map the correct keys for "normal" use.

 

Up --> Move from (Pause) to (Fn + Left Arrow)

Down --> Move from (Fn+ F12) to (Fn + Right Arrow)

Link to comment
Share on other sites

So... slider works, but not linear or doesn't work? (with last dsdt)

Maybe apple gma driver is messing with brightness registers-not alowing them to change with brightness methods.

 

Yes, as I said, if you hack the x3100 kext binary and bypass the brightness routine then you can use the windows-assigned keys to regulate the brightness but you loose all the OSX's native brightness function (on-screen icon, slider, auto-dim)

The problem is the screen itself; same laptop with different display (glossy model) works fine.

Im using a variation of this script mapped to F7-F8 with keyboardmaestro.app. Thats the only solution I've found so far, but is away from being a good one

Link to comment
Share on other sites

Hmm.. this utility only changes brightness slider value... this means that you have native brightness (same registers as osx, but writing different/wrong values for your notebook).

 

From pommed source code for gma950:

 * The GMA950 has a backlight control register at offset 0x00061254 in its
* PCI memory space (512K region):
*  - bits 0-15 represent the backlight value
*  - bits 16 indicates legacy mode is in use when set
*  - bits 17-31 hold the max backlight value << 1

 

gma 965:

* The GMA965 is slightly different; the backlight control register is at
* offset 0x00061250 in its PCI memory space (first 512K in the 1M region):
*  - bits 0-15 represent the backlight value
*  - bits 16-31 hold the max backlight value
*  - bit 30 indicates legacy mode is in use when set

 

For BOTH cards, the register for the backlight value is at offset 0x00061254.

 

Could you open reggie_se and watch those registers?

 

PhysMem calculation:

1. open pci tab and choose VGA compatible controller

2. open bar key bar0 (0xD0200000 on my laptop)

3. open calc (hex) and add:

bar0+offset(0x00061254)=> on my lap=0xD0261254

bar0+offset(0x00061250)

 

When you calculated those values, open PhysMem tab and enter those valuse (0xD0261254/0 on my laptop) in 32 bit.

Move slider and watch how these values are changed (for both 0xD0261254, 0xD0261250 mem space)

 

Brightness only works when PNLF is added and gma driver is patched?

Link to comment
Share on other sites

 Share

×
×
  • Create New...