Jump to content

UPDATED 20.12. GenericBrightness.kext


  • Please log in to reply
671 replies to this topic

#81
sw170

sw170

    InsanelyMac Geek

  • Members
  • PipPipPipPip
  • 212 posts
  • Gender:Male
  • Location:UK

_Q* methods are embedded controller events. In your's case they are writing some values to smif-system management interface.

Open rw-everything and watch EC controller. Watch values that are changing when brightness is changed. If there is no difference, then your brightness is not controlled by EC.

Hi ivik
ok, my dmesg brightness output:

Acpi brightness levels:11, lowest brightness:20, highest brightness:95
We still don't have brightness entry in ioreg... waiting...
We still don't have brightness entry in ioreg... waiting...

Rw-everything gives me two pairs of changing numbers while Im increasing, decreasing brightness
starting from darkest lvl:
14,18,1C,20,25,2B,32,3B,45,51,5F

thanks
swavek

#82
ivik

ivik

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 280 posts
Which register is this? post screenshot from EC and mark which register is changing.

@swavek
try this

@BlackCH
here is the dsdt for u
change in bcm method to values that u think that are right

Attached Files



#83
sw170

sw170

    InsanelyMac Geek

  • Members
  • PipPipPipPip
  • 212 posts
  • Gender:Male
  • Location:UK
here you go:
Attached File  RW.png   213.02KB   211 downloads

#84
ivik

ivik

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 280 posts
so... e2 and e3 are changing. try the dsdt that i posted. If it doesn't work, then we should also write to e3 in EC.

#85
sw170

sw170

    InsanelyMac Geek

  • Members
  • PipPipPipPip
  • 212 posts
  • Gender:Male
  • Location:UK

@swavek
try this


going to try now, but just to make clear - if the only method you changed is this:
Method (_BCL, 0, NotSerialized)
			{
					Return (BCL1)
			}

then I already tried that without success

#86
ivik

ivik

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 280 posts
hm... the we should write to e3 also.. il post modified dsdt in minute.

swavek dsdt:

Attached Files



#87
sw170

sw170

    InsanelyMac Geek

  • Members
  • PipPipPipPip
  • 212 posts
  • Gender:Male
  • Location:UK
thanks for all your help and time ivik
no luck with your last modifications here
posting RegExplorer screenshot just for off chance if will help
Attached File  reg.tiff   199.58KB   46 downloads

I wonder why I have 13 values in DSDT while only 11 change in rw-everything and dmesg says 11 too, also I have to check VoodooPS2 controller settings as I have sun icon only on F7 key, F8 shows desktops view and F6 doesnt work (same with your kext), still can check brightness in Desktop prefpanel - slider stays in max position now

cheers
s

#88
Zprood

Zprood

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 251 posts
  • Gender:Male
  • Location:CHN
@ivik, here is the dmesg :Attached File  dmesg.rtf   4.08KB   9 downloads
Unknown scancode= 0046
Unknown scancode= 00c6
Unknown scancode= 0046
Unknown scancode= 00c6
Unknown scancode= 0046
Unknown scancode= 00c6
Unknown scancode= 0046
Unknown scancode= 00c6
Unknown scancode= 0046
Unknown scancode= 00c6
Unknown scancode= 0046
Unknown scancode= 00c6
Unknown scancode= 0046
Unknown scancode= 00c6
Unknown scancode= 0046
Unknown scancode= 00c6
and this :
We still don't have brightness entry in ioreg... waiting...

thanks.

#89
ivik

ivik

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 280 posts

thanks for all your help and time ivik
no luck with your last modifications here
posting RegExplorer screenshot just for off chance if will help
Attached File  reg.tiff   199.58KB   46 downloads

I wonder why I have 13 values in DSDT while only 11 change in rw-everything and dmesg says 11 too, also I have to check VoodooPS2 controller settings as I have sun icon only on F7 key, F8 shows desktops view and F6 doesnt work (same with your kext), still can check brightness in Desktop prefpanel - slider stays in max position now

cheers
s


First 2 valuese are for brightness on charger/bat.

This is problem... max=0.
If you have intel card, read post 50. Maybe injecting some values in dsdt on boot could fix your max brightness 0.

@zprood

Are these scan codes from FN-up/down?
Are u using Voodoops2?

#90
BlackCH

BlackCH

    InsanelyMac Deity

  • Members
  • PipPipPipPipPipPipPipPipPipPip
  • 1,612 posts
  • Gender:Male
  • Location:BCN

@BlackCH
here is the dsdt for u
change in bcm method to values that u think that are right


Thanks al lot! but sadly it doesnt work yet. After a brightness value is set, the address is written with zeroes (black screen). Only when is at maximum brightness it remains there.
I dont know if you got my last PM. The correct values are FFFF0000 (minimum), FFFFFFFF (maximum). Notice the lower two bytes need to be always 'on' (FFFF) and the other two bytes are holding the brightness value. You could have 16 brightness steps for example: FFFF0000, FFFF1000, FFFF2000, FFFF3000, etc, up to FFFFFFFF

#91
ivik

ivik

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 280 posts
Did you modified dsdt?

If (LEqual (Arg0, 0x1E)) {Store (0xFFFF0000, LEVL)} for minimum.. snd so on

Example for max:
If (LEqual (Arg0, 0x64)) {Store (0xFFFFFFFF, LEVL)}

#92
BlackCH

BlackCH

    InsanelyMac Deity

  • Members
  • PipPipPipPipPipPipPipPipPipPip
  • 1,612 posts
  • Gender:Male
  • Location:BCN

Did you modified dsdt?

If (LEqual (Arg0, 0x1E)) {Store (0xFFFF0000, LEVL)} for minimum.. snd so on

Example for max:
If (LEqual (Arg0, 0x64)) {Store (0xFFFFFFFF, LEVL)}


I will try, and I let you know how it turns up

EDIT:

Yes! That worked. Apple driver write the wrong value first, and then the value gets corrected by your driver. The only bad thing is that you see this on the screen; but is far better than befor already. Thanks a lot
How I can add more brightness steps?
Sometimes the brightness get corrected after a couple of seconds (maybe less), would be possible to shorten this time?

EDIT 2:
When you change the BRT with the slider, there are some point in which the brightness does not get corrected. With key strokes works fine

Now I should try to remap the keys. Everytime I press brightness-up my DVD drive opens...

#93
ivik

ivik

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 280 posts
Nice!!!

I think that your laptop could change brightness without my driver. Problem is that max brightness is wrong FFFF?
[codebox] * 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
*
* Bit 16 indicates whether the backlight control should be used in legacy
* mode or not. This bit is 0 on MacBooks, indicating native mode should be
* used. This is the only method supported here.
*
*
* 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.
[/codebox]

maybe writing it at boot with _INI method on PCIO could solve this.
maybe setting both valuesfor max at 0x00061254 and 0x00061250, becuse x3100 uses both registers. to store brightness (bit 0-15)

Brightness is changed after one second and only if there is difference/changed. But apple driver changes it first... and since u have 11 steps, maxbrightness/11 then under these ranges is not set by my driver.

I could do some fixes for laptop, and change time to 0.5 second.

#94
BlackCH

BlackCH

    InsanelyMac Deity

  • Members
  • PipPipPipPipPipPipPipPipPipPip
  • 1,612 posts
  • Gender:Male
  • Location:BCN

Nice!!!

I think that your laptop could change brightness without my driver. Problem is that max brightness is wrong FFFF?


It works with FF00 too, I can not notice any difference. I will look into the other register, but last time I look @ 0x00061254 it was all zeros and I couldnt write to it with reggie_se

#95
ivik

ivik

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 280 posts
Ok, but maybe at boot time it could be changed.

Now give me all yours brightness velues from min to max to add all steps to your brightness.

#96
Zprood

Zprood

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 251 posts
  • Gender:Male
  • Location:CHN
Those code is by pressing Fn+Delete and Pause keys, when pressing Fn+up&down, no those code.I use the AppleACPIPS2Controller.kext for the keyboard driver, and modified by Slice, he do some patches to enable media key function.Upload here:Attached File  PS2_Multimedia_Snow.zip   95.82KB   48 downloads

#97
Defender666

Defender666

    InsanelyMac Protégé

  • Members
  • PipPip
  • 93 posts
BlackCH, i have 6710b Notebook which is very similar to yours, i also have the (uneven, 95%) brightness problems (display: 1680x1050 non-glare). Can you point out which parts of the DSDT you modified in the end to get it working now, so i can add it to my dsdt.

You write you patched original x3100 driver to disable driver brightness control? Can you explain this alternative solution. You said driver messes up brightness and it is corrected by the generic brightness.kext. Did you try a combination of patched driver and this kext.

I currently use the keyboard maestro solution.

#98
ivik

ivik

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 280 posts
I need scancodes... and i can only do changes in voodoops2 32 bit.

#99
BlackCH

BlackCH

    InsanelyMac Deity

  • Members
  • PipPipPipPipPipPipPipPipPipPip
  • 1,612 posts
  • Gender:Male
  • Location:BCN

Ok, but maybe at boot time it could be changed.

Now give me all yours brightness velues from min to max to add all steps to your brightness.


I've added them myself to the PNLF device.

Device (PNLF)        {            Name (_HID, EisaId ("APP0002"))            Name (_CID, "backlight")            Name (_UID, 0x0A)            Name (_STA, 0x0B)            Name (C1AF, Package (0x15)                   {                        0x64,                         0x33,                         0x1E,                         0x22,                         0x26,                        0x2A,                        0x2E,                        0x32,                         0x36,                        0x3A,                        0x3E,                        0x42,                         0x46,                         0x4A,                        0x4E,                        0x52,                         0x56,                        0x5A,                        0x5E,                        0x62,                        0x64                    })                    Name (C1B0, 0x00)                    Method (_BCL, 0, Serialized)                    {                        If (LAnd (LEqual (C1B0, 0x00), And (C06C, 0x10)))                        {                            Store (C06E, Local0)                            Store (0x00, Local1)                            While (LLess (Local1, 0x0B))                            {                                Store (DerefOf (Index (Local0, Local1)), Local2)                                Multiply (Local2, 0x64, Local3)                                Divide (Add (Local3, 0x7F), 0xFF, Local4, Local2)                                Store (Local2, Index (C1AF, Add (Local1, 0x02)))                                Increment (Local1)                            }                            Store (DerefOf (Index (C1AF, 0x05)), Index (C1AF, 0x01))                            Store (Local2, Index (C1AF, 0x00))                            Store (0x01, C1B0)                        }                        Return (C1AF)                    }                    Name (C1B1, 0x64)                    Method (_BCM, 1, Serialized)                    {/*                        Store (0x00, Local0)                        If (LGreater (\OSDW (), 0x05))                        {                            Or (C05B, 0x40, C05B)                            Store (0x01, Local0)                        }                        Store (Arg0, C1B1)                        Store (Match (C1AF, MEQ, Arg0, MTR, 0x00, 0x00), Local1)                        Store (Local1, C072)                        \_SB.C1B2 (0xEA74, 0x04, Local1, 0x00, 0x00)                        Signal (\_SB.C1AC) */			If (LEqual (Arg0, 0x1E)) {Store (0xFFFF0000, LEVL)} //minimum brightness			If (LEqual (Arg0, 0x22)) {Store (0xFFFF0500, LEVL)}			If (LEqual (Arg0, 0x26)) {Store (0xFFFF1000, LEVL)}			If (LEqual (Arg0, 0x2A)) {Store (0xFFFF2000, LEVL)}			If (LEqual (Arg0, 0x2E)) {Store (0xFFFF3000, LEVL)}			If (LEqual (Arg0, 0x32)) {Store (0xFFFF4000, LEVL)}			If (LEqual (Arg0, 0x36)) {Store (0xFFFF5000, LEVL)}			If (LEqual (Arg0, 0x3A)) {Store (0xFFFF6000, LEVL)}			If (LEqual (Arg0, 0x3E)) {Store (0xFFFF7000, LEVL)}			If (LEqual (Arg0, 0x42)) {Store (0xFFFF8000, LEVL)}			If (LEqual (Arg0, 0x46)) {Store (0xFFFF9000, LEVL)}			If (LEqual (Arg0, 0x4a)) {Store (0xFFFFa000, LEVL)}			If (LEqual (Arg0, 0x4e)) {Store (0xFFFFb000, LEVL)}			If (LEqual (Arg0, 0x52)) {Store (0xFFFFc000, LEVL)}			If (LEqual (Arg0, 0x56)) {Store (0xFFFFd000, LEVL)}			If (LEqual (Arg0, 0x5A)) {Store (0xFFFFe000, LEVL)}			If (LEqual (Arg0, 0x5E)) {Store (0xFFFFE500, LEVL)}			If (LEqual (Arg0, 0x62)) {Store (0xFFFFFF00, LEVL)}			If (LEqual (Arg0, 0x64)) {Store (0xFFFFFFFF, LEVL)} //maksimum                    }                    Method (_BQC, 0, Serialized)                    {                        Store (C1B1, Local0)                        Return (Local0)                    }                            }

Its a bit redundant (too many steps) but I was just trying things.

Thanks!!

#100
BlackCH

BlackCH

    InsanelyMac Deity

  • Members
  • PipPipPipPipPipPipPipPipPipPip
  • 1,612 posts
  • Gender:Male
  • Location:BCN

Do all these steps work?


If I enter those with reggie_se all works; I guess one could do a (BrightValue=BrightValue+1) in a loop, and you'll get a continuous smooth brightness going up (that wouldnt be useful though)

Could you try this driver? 16 steps and always writing values when slider is moved (when little moved).
It is modified only for your notebook.
There is also dsdt in archive that only works with this driver.


That didnt work. It acts like before (non-linear buggy brightness)





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