Skip to contentSkip to conversation

Fixing i915/opregion issues with firmware which lists more then 8 output devices

DISCUSSION Hans de Goede 2 participants 6 messages Nov 5, 2015 – Mar 23, 2016

lore
Share & tools
lore
#0 lore raw

Hi,

As discussed in the past, the i915 opregion code does not do the right thing wrt the CADL field when there are more then 8 outputs, this is causing issues on many different types of Asus laptops.

This thread has details and a number of attempts to fix this:

https://lkml.org/lkml/2014/2/11/1032

This is impacting many users, here is an incomplete list of bug reports:

https://bugzilla.kernel.org/show_bug.cgi?id=70241
https://bugzilla.kernel.org/show_bug.cgi?id=88941
https://bugzilla.redhat.com/show_bug.cgi?id=1144866
https://bugzilla.redhat.com/show_bug.cgi?id=1277785

And I'm pretty sure that is just the tip of the iceberg, some users have even analyzed their BIOS AML code and come up with an AML hack in an attempt to fix this:

http://blog.yjwong.name/fixing-display-backlight-hotkeys-on-asus-n550jk/

It would be really great of someone from Intel could step up and start working on a proper fix for this.

Regards,

Hans

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#1 lore raw
Quoted 17 lines · Hans de Goede

Hi,

As discussed in the past, the i915 opregion code does not do the right thing wrt the CADL field when there are more then 8 outputs, this is causing issues on many different types of Asus laptops.

This thread has details and a number of attempts to fix this:

https://lkml.org/lkml/2014/2/11/1032

This is impacting many users, here is an incomplete list of bug reports:

https://bugzilla.kernel.org/show_bug.cgi?id=70241
https://bugzilla.kernel.org/show_bug.cgi?id=88941
https://bugzilla.redhat.com/show_bug.cgi?id=1144866
https://bugzilla.redhat.com/show_bug.cgi?id=1277785

Quoted 8 lines

And I'm pretty sure that is just the tip of the iceberg, some users have even analyzed their BIOS AML code and come up with an AML hack in an attempt to fix this:

http://blog.yjwong.name/fixing-display-backlight-hotkeys-on-asus-n550jk/

It would be really great of someone from Intel could step up and start working on a proper fix for this.

Hans, thanks for bringing this up again.

IIUC this would require something along the lines of:

- Properly map acpi video bus children and DRM connectors in intel_didl_outputs(). This is likely the hardest part. Save the display ids in struct intel_connector.

- Replace intel_setup_cadls() with functions to add/remove display ids from opregion CADL.

- Call the above functions as part of the modeset sequence (either from intel_display.c or from the encoder hooks, whichever is best) to keep CADL up-to-date about active outputs. Here, getting DP MST right is probably the hard one.

If the mapping goes wrong, and some id that used to be in CADL with the current code gets dropped, this may regress. That's the biggest risk, really.

For the backlight/hotkey stuff, the minimal fix may be to keep the stupid static initialization of the CADL in intel_setup_cadls() like we have now, but ensuring the embedded displays are included in the list.

BR,
Jani.

Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw

Hi,

Quoted 43 lines · Jani Nikula
Quoted 17 lines · Hans de Goede

Hi,

As discussed in the past, the i915 opregion code does not do the right thing wrt the CADL field when there are more then 8 outputs, this is causing issues on many different types of Asus laptops.

This thread has details and a number of attempts to fix this:

https://lkml.org/lkml/2014/2/11/1032

This is impacting many users, here is an incomplete list of bug reports:

https://bugzilla.kernel.org/show_bug.cgi?id=70241
https://bugzilla.kernel.org/show_bug.cgi?id=88941
https://bugzilla.redhat.com/show_bug.cgi?id=1144866
https://bugzilla.redhat.com/show_bug.cgi?id=1277785

Quoted 8 lines

And I'm pretty sure that is just the tip of the iceberg, some users have even analyzed their BIOS AML code and come up with an AML hack in an attempt to fix this:

http://blog.yjwong.name/fixing-display-backlight-hotkeys-on-asus-n550jk/

It would be really great of someone from Intel could step up and start working on a proper fix for this.

Hans, thanks for bringing this up again.

IIUC this would require something along the lines of:

- Properly map acpi video bus children and DRM connectors in intel_didl_outputs(). This is likely the hardest part. Save the display ids in struct intel_connector.

- Replace intel_setup_cadls() with functions to add/remove display ids from opregion CADL.

- Call the above functions as part of the modeset sequence (either from intel_display.c or from the encoder hooks, whichever is best) to keep CADL up-to-date about active outputs. Here, getting DP MST right is probably the hard one.

Quoted 7 lines

If the mapping goes wrong, and some id that used to be in CADL with the current code gets dropped, this may regress. That's the biggest risk, really.

For the backlight/hotkey stuff, the minimal fix may be to keep the stupid static initialization of the CADL in intel_setup_cadls() like we have now, but ensuring the embedded displays are included in the list.

This is what Aaron's first attempt at fixing this more or less did:

https://lkml.org/lkml/2014/2/11/1032

Unless someone actually steps up to do a proper fix for this *now*, maybe the i915 driver needs to incorporate a slightly revised / improved version of that patch as a work around for now ?

Regards,

Hans
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#3 lore raw
Quoted 54 lines · Hans de Goede

Hi,

Quoted 43 lines · Jani Nikula
Quoted 17 lines · Hans de Goede

Hi,

As discussed in the past, the i915 opregion code does not do the right thing wrt the CADL field when there are more then 8 outputs, this is causing issues on many different types of Asus laptops.

This thread has details and a number of attempts to fix this:

https://lkml.org/lkml/2014/2/11/1032

This is impacting many users, here is an incomplete list of bug reports:

https://bugzilla.kernel.org/show_bug.cgi?id=70241
https://bugzilla.kernel.org/show_bug.cgi?id=88941
https://bugzilla.redhat.com/show_bug.cgi?id=1144866
https://bugzilla.redhat.com/show_bug.cgi?id=1277785

Quoted 8 lines

And I'm pretty sure that is just the tip of the iceberg, some users have even analyzed their BIOS AML code and come up with an AML hack in an attempt to fix this:

http://blog.yjwong.name/fixing-display-backlight-hotkeys-on-asus-n550jk/

It would be really great of someone from Intel could step up and start working on a proper fix for this.

Hans, thanks for bringing this up again.

IIUC this would require something along the lines of:

- Properly map acpi video bus children and DRM connectors in intel_didl_outputs(). This is likely the hardest part. Save the display ids in struct intel_connector.

- Replace intel_setup_cadls() with functions to add/remove display ids from opregion CADL.

- Call the above functions as part of the modeset sequence (either from intel_display.c or from the encoder hooks, whichever is best) to keep CADL up-to-date about active outputs. Here, getting DP MST right is probably the hard one.

Quoted 7 lines

If the mapping goes wrong, and some id that used to be in CADL with the current code gets dropped, this may regress. That's the biggest risk, really.

For the backlight/hotkey stuff, the minimal fix may be to keep the stupid static initialization of the CADL in intel_setup_cadls() like we have now, but ensuring the embedded displays are included in the list.

Quoted 7 lines

This is what Aaron's first attempt at fixing this more or less did:

https://lkml.org/lkml/2014/2/11/1032

Unless someone actually steps up to do a proper fix for this *now*, maybe the i915 driver needs to incorporate a slightly revised / improved version of that patch as a work around for now ?

I dug into this a bit. (Well, more than just a bit. Friday night, doing ACPI dumps and deciphering AML. What was I thinking?)

It seems that part of the problem is caused by

commit 3143751ff51a163b77f7efd389043e038f3e008e

Author: Zhang Rui <[email protected]>
Date:   Mon Mar 29 15:12:16 2010 +0800

drm/i915: set DIDL using the ACPI video output device _ADR method return.

which apparently caters for buggy bioses. The relevant bug report is [1].

IIUC, the graphics driver is supposed to set up the IDs (so that would take care of the "hardest part" above). On a couple of modern machines that I checked, the above commit causes i915 to ask the AML code using _ADR, which looks at DIDL, which is what we're trying to initialize so it's zero, and then AML pulls IDs out of thin air, also for devices that don't really exist because AML doesn't know.

I'll probably submit a patch doing a revert of the above, if only to test. But we'll still have to figure out something for the regressions it probably causes for the buggy machines. *sigh*.

This just reinforces my opinion that adding hacks to fix some broken machines is not worth it. The no regressions rule turns the hacks into a nightmare when it breaks good hardware.

BR,
Jani.

[1] https://bugzilla.kernel.org/show_bug.cgi?id=15054

Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#4 lore raw
In reply to Hans de Goede
Quoted 52 lines · Hans de Goede
Quoted 43 lines · Jani Nikula
Quoted 17 lines · Hans de Goede

Hi,

As discussed in the past, the i915 opregion code does not do the right thing wrt the CADL field when there are more then 8 outputs, this is causing issues on many different types of Asus laptops.

This thread has details and a number of attempts to fix this:

https://lkml.org/lkml/2014/2/11/1032

This is impacting many users, here is an incomplete list of bug reports:

https://bugzilla.kernel.org/show_bug.cgi?id=70241
https://bugzilla.kernel.org/show_bug.cgi?id=88941
https://bugzilla.redhat.com/show_bug.cgi?id=1144866
https://bugzilla.redhat.com/show_bug.cgi?id=1277785

Quoted 8 lines

And I'm pretty sure that is just the tip of the iceberg, some users have even analyzed their BIOS AML code and come up with an AML hack in an attempt to fix this:

http://blog.yjwong.name/fixing-display-backlight-hotkeys-on-asus-n550jk/

It would be really great of someone from Intel could step up and start working on a proper fix for this.

Hans, thanks for bringing this up again.

IIUC this would require something along the lines of:

- Properly map acpi video bus children and DRM connectors in intel_didl_outputs(). This is likely the hardest part. Save the display ids in struct intel_connector.

- Replace intel_setup_cadls() with functions to add/remove display ids from opregion CADL.

- Call the above functions as part of the modeset sequence (either from intel_display.c or from the encoder hooks, whichever is best) to keep CADL up-to-date about active outputs. Here, getting DP MST right is probably the hard one.

Quoted 7 lines

If the mapping goes wrong, and some id that used to be in CADL with the current code gets dropped, this may regress. That's the biggest risk, really.

For the backlight/hotkey stuff, the minimal fix may be to keep the stupid static initialization of the CADL in intel_setup_cadls() like we have now, but ensuring the embedded displays are included in the list.

Quoted 7 lines

This is what Aaron's first attempt at fixing this more or less did:

https://lkml.org/lkml/2014/2/11/1032

Unless someone actually steps up to do a proper fix for this *now*, maybe the i915 driver needs to incorporate a slightly revised / improved version of that patch as a work around for now ?

"now" took a long time, but there's this series to try now:
https://patchwork.freedesktop.org/series/4783/

BR,
Jani.

Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#5 lore raw

Hi Jani,

Quoted 55 lines · Jani Nikula
Quoted 54 lines · Hans de Goede
Quoted 43 lines · Jani Nikula
Quoted 17 lines · Hans de Goede

Hi,

As discussed in the past, the i915 opregion code does not do the right thing wrt the CADL field when there are more then 8 outputs, this is causing issues on many different types of Asus laptops.

This thread has details and a number of attempts to fix this:

https://lkml.org/lkml/2014/2/11/1032

This is impacting many users, here is an incomplete list of bug reports:

https://bugzilla.kernel.org/show_bug.cgi?id=70241
https://bugzilla.kernel.org/show_bug.cgi?id=88941
https://bugzilla.redhat.com/show_bug.cgi?id=1144866
https://bugzilla.redhat.com/show_bug.cgi?id=1277785

Quoted 8 lines

And I'm pretty sure that is just the tip of the iceberg, some users have even analyzed their BIOS AML code and come up with an AML hack in an attempt to fix this:

http://blog.yjwong.name/fixing-display-backlight-hotkeys-on-asus-n550jk/

It would be really great of someone from Intel could step up and start working on a proper fix for this.

Hans, thanks for bringing this up again.

IIUC this would require something along the lines of:

- Properly map acpi video bus children and DRM connectors in intel_didl_outputs(). This is likely the hardest part. Save the display ids in struct intel_connector.

- Replace intel_setup_cadls() with functions to add/remove display ids from opregion CADL.

- Call the above functions as part of the modeset sequence (either from intel_display.c or from the encoder hooks, whichever is best) to keep CADL up-to-date about active outputs. Here, getting DP MST right is probably the hard one.

Quoted 7 lines

If the mapping goes wrong, and some id that used to be in CADL with the current code gets dropped, this may regress. That's the biggest risk, really.

For the backlight/hotkey stuff, the minimal fix may be to keep the stupid static initialization of the CADL in intel_setup_cadls() like we have now, but ensuring the embedded displays are included in the list.

This is what Aaron's first attempt at fixing this more or less did:

Quoted 8 lines
Quoted 5 lines

https://lkml.org/lkml/2014/2/11/1032

Unless someone actually steps up to do a proper fix for this *now*, maybe the i915 driver needs to incorporate a slightly revised / improved version of that patch as a work around for now ?

"now" took a long time, but there's this series to try now:
https://patchwork.freedesktop.org/series/4783/

Cool. Note I do not have hardware to test this.

I think it would be good if you add a link to that series to all the relevant bugreports, quoting from my original mail that would be the following bug reports:

https://bugzilla.kernel.org/show_bug.cgi?id=70241
https://bugzilla.kernel.org/show_bug.cgi?id=88941
https://bugzilla.redhat.com/show_bug.cgi?id=1144866
https://bugzilla.redhat.com/show_bug.cgi?id=1277785

Regards,

Hans
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx