Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaround for buggy vendor backlight implements #26

Merged
merged 2 commits into from Sep 28, 2020

Conversation

zhen-zen
Copy link
Contributor

@zhen-zen zhen-zen commented Sep 25, 2020

Yesterday I was notified for another exception.

The structure is:

GFX0@20000
- DD01@100
- DD02@2
- DD03@300
- DD04@301
- DD05@5
- DD06@6
- DD07@7
- DD08@8
- DD09@9
- DD0A@a
- DD0B@b
- DD0C@c
- DD0D@d
- DD0E@e
- DD0F@f
- DD1F@410

Which is quite similar to my desktop one

GFX0@20000
- DD01@100
- DD02@2
- DD03@300
- DD04@301
- DD05@302
- DD06@6
- DD07@7
- DD08@8
- DD09@9
- DD0A@a
- DD0B@b
- DD0C@c
- DD0D@d
- DD0E@e
- DD0F@f
- DD1F@1f

I added a mask to verify bit [11:8] for display type. However, later I was told DD02 was actually notified.

        Method (_Q1C, 0, NotSerialized)  // _Qxx: EC Query, xx=0x00-0xFF
        {
            P80H = 0x1C
            BCEN = Zero
            BCVE = Zero
            If (QWIK) // non-zero
            {
                Notify (^^^GFX0.DD02, 0x86) // Device-Specific
            }
            ElseIf (BCEN)
            {
                If (BCVE)
                {
                    If ((^^^GFX0.IGID != 0xFFFF))
                    {
                        ^^^GFX0.SPBR (BNVA, Zero)
                    }
                }

                LAMN (0x73)
            }
            Else
            {
                Acquire (MSGF, 0xFFFF)
                If ((^^^GFX0.IGID != 0xFFFF))
                {
                    BIAN (0x86) // will notify DD1F correctly
                }

                Release (MSGF)
            }
        }

The result didn't follow the spec as well. I suppose it's a mis-configuration that route to obsolete DD02 again.

I didn't come up with some good idea to identify that. So maybe it could be handled by additional fallback notifier?

@zhen-zen zhen-zen changed the title Workaround for buggy vendor implements Workaround for buggy vendor backlight implements Sep 25, 2020
@zhen-zen
Copy link
Contributor Author

zhen-zen commented Sep 25, 2020

For discrete one: newer systems don't use the 0x110 Legacy Panel for address. Instead, they could export the display type per specs, e.g. 0x8000a450.

Related notification also changed:

            Method (_Q14, 0, NotSerialized)  // _Qxx: EC Query, xx=0x00-0xFF
            {
                If (\_SB.PCI0.LPC.EC.HKEY.MHKK (0x8000))
                {
                    \_SB.PCI0.LPC.EC.HKEY.MHKQ (0x1010)
                }

                If (\NBCF)
                {
                    If (\VIGD)
                    {
                        Notify (\_SB.PCI0.VID.LCD0, 0x86) // Device-Specific
                    }
                    Else
                    {
                        Notify (\_SB.PCI0.PEG.VID.LCD0, 0x86) // Device-Specific
                    }
                }
                Else
                {
                    Local0 = \BRLV
                    If ((Local0 != 0x0F))
                    {
                        Local0++
                        \BRLV = Local0
                    }

                    If (\VIGD)
                    {
                        \UCMS (0x16)
                        \_SB.PCI0.LPC.EC.BRNS ()
                    }
                    Else
                    {
                        \VBRC (Local0)
                    }

                    \_SB.PCI0.LPC.EC.HKEY.MHKQ (0x6050)
                }
            }

Although I suppose discrete AMD graphics has disappeared for a long time, the separate notifiers might not break things such as duplicate notification. And graphics hot switch also seems impossible.

@zhen-zen zhen-zen marked this pull request as ready for review September 25, 2020 23:54
@vit9696 vit9696 merged commit 86d8fb2 into acidanthera:master Sep 28, 2020
usr-sse2 pushed a commit that referenced this pull request Sep 28, 2020
This reverts commit 86d8fb2.

Revert "Fix typo in Changelog (#25)"

This reverts commit 383e672.

Revert "Workaround for ICL/CML brightness keys (#23)"

This reverts commit 1e2925d.

Revert "Get ACPI notification for brightness keys from GFX0.DD1F/DD02 (#22)"

This reverts commit d5f0541.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants