Jump to content

Laptop: Brightness not working until Sleep/Wake cycle after changing LCD panel


rlp
 Share

10 posts in this topic

Recommended Posts

I have a HP450-G4 Laptop with Mojave 10.14.6 / Lilu / Whatevergreen / SSDT-PNLF. I just changed its awful LCD TN panel for an IPS one (AUO B156HAN01.1).

 

What happens now is (no software changes, just changing the panel), the monitor is black until I move the brightness slider to its maximum setting. Any other setting generally show a black screen or a weird slow flicker. It worked fine with the TN panel.

 

If I enter sleep and resume, brightness works again until the next reboot.

 

Things I have tried:

 

- Injecting the monitor EDID (AFAIK shouldn't be necessary as it is correctly detected by Clover and IOREG dumps it correctly)

 

- Injecting a patched EDID with Apple Product ID using the different tools I found here (a ruby script, a shell script, FixEdid application). Strangely, with most of  the patched EDIDs, computer is then not able to sleep (sleeps but instantly wakes up), and even display colour artifacts during the second stage boot.

 

- Adding the generated EDID plist from FixEdid app on AppleBacklight.kext overrides in S/L/E. Same than previous point, either computer does not sleep or artifacts during second stage.

 

- Followed guides for AppleBacklightInjector / AppleBacklightFixup disabling WhateverGreen patches for backlight. Not working, not even know if those are related because the PNLF device already exists and the slider is there, and most of them seem outdated now that WhateverGreen does most things by itself.

 

- Used WhateverGreeen parameter igfxcflbklt=1 to apply backlight patches for Coffee-Lake. With them, brightness is always 100% regardless of slider. I didn't expect this to work as this is a Kaby Lake laptop, just tried it out of desperation.

 

So the problem is, I don't know what is my problem (EDID/DSDT) or what more things to try. I am lost. Any pointers appreciated. Please find attached my EFI folder with SSDT-PNLF, config.plist, etc...

 

Thanks in advance

hackfiles.zip

Edited by rlp
better title
Link to comment
Share on other sites

  • 1 month later...

Hello @rlp,

I have the same problem with LGD Touch Panel on my T460. In T460 guide section many with Touch Panel have this same brightness problem. I think clover can't activate this device properly on boot. 

 

Another thing I noticed on windows with MonitorinfoView shows 2 EDID for this panel. That could produce problems I think.

 

This thing should be bug reported to whatever green thread.

 

If anything new comes up please let me know.

 

regards,

junaed

Link to comment
Share on other sites

  • 2 weeks later...

Hi, I have been trying hard ever since. I have download several EDIDs for this screen, tried them patched and unpatched, and nothing. 

 

The root problem seems to be the Backlight registers are not properly initialised in _INI method of SSDT-PNLF.

 

I have tried some suggestions regarding GFX0.GRAN register but nothing changes.

I suspect the initialisation value of GFX0.LEVW is wrong, but it is just a shot in the dark.

 

I am trying a very low-level method involving installing ACPIDebug + ACPIPoll extensions to print debug info on registers LEVW, etc.. before and after sleep and check for differences, but it requires some modifications on the DSDT and SSDTs because the solution was meant to debug the CPU Fan SSDT and I need then to import the definitions of PNLF, something that I am not very convinced I am doing it right, as I am not an expert on all this.

 

Will keep you posted, Regards !

Link to comment
Share on other sites

Hi @rlp,

I also experimented with different combination of framebuffer patch related to internal display such as - FbForcePowerAlwaysConnected, FbAlternatePWMIncrement1/2 and FbAllowConnectorRecover with no success. Hope you find something usefull in DSDT and SSDT.

 

regards,

Junaed

Link to comment
Share on other sites

  • 2 weeks later...

I found the root cause of the problem: The lowlevel registers LEVW, GRAN, LEV2, etc ... are not correctly mapped, so SSDT-PNLF initialisations have no effect at all (registers always return 0xffffffff). In fact, just defining a dummy PNLF is enough for brightness to work after a sleep/wake cycle. I can provide patched SSDT-PNLF with syslog output if anyone would like to take a look. I don't know how to continue from here.

Edited by rlp
Link to comment
Share on other sites

17 hours ago, rlp said:

I found the root cause of the problem: The lowlevel registers LEVW, GRAN, LEV2, etc ... are not correctly mapped, so SSDT-PNLF initialisations have no effect at all (registers always return 0xffffffff). In fact, just defining a dummy PNLF is enough for brightness to work after a sleep/wake cycle. I can provide patched SSDT-PNLF with syslog output if anyone would like to take a look. I don't know how to continue from here.

Clover can set these registers. The example provided by default config.plist

		<key>#SetIntelBacklight</key>
		<false/>
		<key>#SetIntelMaxBacklight</key>
		<true/>
		<key>#IntelMaxValue</key>
		<string>0x710</string>

 

Link to comment
Share on other sites

Thanks very much for your suggestion. I have tried it but unfortunately nothing changes.

 

I think the problem is, besides the LEVX set by clover, SSDT-PNLF performs an initialisation on other registers as you can see in the source code, specially LEVW, whose initialisation to 0xc00000000 was reverse-engineered examining what OSX does after sleep. 

 

 As the OperationRegion seems invalid, this initialisation does not have any effect.

 

            // INTEL OPEN SOURCE HD GRAPHICS, INTEL IRIS GRAPHICS, AND INTEL IRIS PRO GRAPHICS PROGRAMMER'S REFERENCE MANUAL (PRM)
            // FOR THE 2015-2016 INTEL CORE PROCESSORS, CELERON PROCESSORS AND PENTIUM PROCESSORS BASED ON THE "SKYLAKE" PLATFORM
            // Volume 12: Display (https://01.org/sites/default/files/documentation/intel-gfx-prm-osrc-skl-vol12-display.pdf)
            //   page 189, Backlight Enabling Sequence, Description
            //   1. Set frequency and duty cycle in SBLC_PWM_CTL2 Backlight Modulation Frequency and Backlight Duty Cycle.
            //   2. Set granularity in 0xC2000 bit 0 (0 = 16, 1 = 128).
            //   3. Enable PWM output and set polarity in SBLC_PWM_CTL1 PWM PCH Enable and Backlight Polarity.
            //   4. Change duty cycle as needed in SBLC_PWM_CTL2 Backlight Duty Cycle.
            // This 0xC value comes from looking what OS X initializes this
            // register to after display sleep (using ACPIDebug/ACPIPoller)

            \RMDT.P5("PNLF/I DEBUG","INI1",Arg0,"HID",EisaId("APP0002"))

            If (0 == (2 & Arg0))
            {
                Local5 = 0xC0000000
                If (CondRefOf(\RMCF.LEVW)) { If (Ones != \RMCF.LEVW) { Local5 = \RMCF.LEVW } }
                ^LEVW = Local5
  
				// This fails... LEVW does not point to the correct place :(
         		\RMDT.P5("PNLF/I DEBUG","INI1 set LEVW TO",Local5,"result",^LEVW)
        
            }
            // from step 2 above (you may need 1 instead)
			// This also fails
            If (4 & Arg0)
            {
                If (CondRefOf(\RMCF.GRAN)) { ^GRAN = \RMCF.GRAN }
                Else { ^GRAN = 0 }
            }

            // This also fails, but IOReg shows decent values for them at init so brightness works at 100%
            If (CondRefOf(\RMCF.LEVX)) { ^LEVX = \RMCF.LEVX }
	        If (CondRefOf(\RMCF.LEV2)) { ^LEV2 = \RMCF.LEV2 }

         }

 

Link to comment
Share on other sites

  • 3 weeks later...
  • 3 months later...
  • 8 months later...
 Share

×
×
  • Create New...