This reverts commit 40d2f5820951dee818d05c14677277048bd85f9f. Removing the try_vesa_interface gate caused a backlight regression on panels whose VBT correctly reports INTEL_BACKLIGHT_DISPLAY_DDI and whose PWM path is the actual backlight control, but whose DPCD optimistically advertises DP_EDP_BACKLIGHT_AUX_ENABLE_CAP / _BRIGHTNESS_AUX_SET_CAP. After the commit such panels silently bind to the VESA AUX backlight funcs; AUX writes complete but the panel ignores them, leaving brightness stuck (no-op backlight). Observed on at least KBL and TGL eDP setups.
Unified · Split
| @@ -691,10 +691,9 @@ int intel_dp_aux_init_backlight_funcs(struct intel_connector *connector) · 690 unmodified lines | ||
| 691 | 691 | struct intel_dp *intel_dp = intel_attached_dp(connector); |
| 692 | 692 | struct drm_device *dev = connector->base.dev; |
| 693 | 693 | struct intel_panel *panel = &connector->panel; |
| 694 | − bool try_intel_interface = false; | |
| 694 | + bool try_intel_interface = false, try_vesa_interface = false; | |
| 695 | 695 | |
| 696 | − /* | |
| 697 | − * Check the VBT and user's module parameters to figure out which | |
| 696 | + /* Check the VBT and user's module parameters to figure out which | |
| 698 | 697 | * interfaces to probe |
| 699 | 698 | */ |
| 700 | 699 | switch (display->params.enable_dpcd_backlight) { |
| @@ -703,6 +702,7 @@ int intel_dp_aux_init_backlight_funcs(struct intel_connector *connector) · 2 unmodified lines | ||
| 703 | 702 | case INTEL_DP_AUX_BACKLIGHT_AUTO: |
| 704 | 703 | switch (panel->vbt.backlight.type) { |
| 705 | 704 | case INTEL_BACKLIGHT_VESA_EDP_AUX_INTERFACE: |
| 705 | + try_vesa_interface = true; | |
| 706 | 706 | break; |
| 707 | 707 | case INTEL_BACKLIGHT_DISPLAY_DDI: |
| 708 | 708 | try_intel_interface = true; |
| @@ -715,12 +715,20 @@ int intel_dp_aux_init_backlight_funcs(struct intel_connector *connector) · 6 unmodified lines | ||
| 715 | 715 | if (panel->vbt.backlight.type != INTEL_BACKLIGHT_VESA_EDP_AUX_INTERFACE) |
| 716 | 716 | try_intel_interface = true; |
| 717 | 717 | |
| 718 | + try_vesa_interface = true; | |
| 719 | + break; | |
| 720 | + case INTEL_DP_AUX_BACKLIGHT_FORCE_VESA: | |
| 721 | + try_vesa_interface = true; | |
| 718 | 722 | break; |
| 719 | 723 | case INTEL_DP_AUX_BACKLIGHT_FORCE_INTEL: |
| 720 | 724 | try_intel_interface = true; |
| 721 | 725 | break; |
| 722 | 726 | } |
| 723 | 727 | |
| 728 | + /* For eDP 1.5 and above we are supposed to use VESA interface for brightness control */ | |
| 729 | + if (intel_dp->edp_dpcd[0] >= DP_EDP_15) | |
| 730 | + try_vesa_interface = true; | |
| 731 | + | |
| 724 | 732 | /* |
| 725 | 733 | * Since Intel has their own backlight control interface, the majority of machines out there |
| 726 | 734 | * using DPCD backlight controls with Intel GPUs will be using this interface as opposed to |
| @@ -733,9 +741,6 @@ int intel_dp_aux_init_backlight_funcs(struct intel_connector *connector) · 6 unmodified lines | ||
| 733 | 741 | * panel with Intel's OUI - which is also required for us to be able to detect Intel's |
| 734 | 742 | * backlight interface at all. This means that the only sensible way for us to detect both |
| 735 | 743 | * interfaces is to probe for Intel's first, and VESA's second. |
| 736 | − * | |
| 737 | − * Also there is a chance some VBTs may advertise false Intel backlight support even if the | |
| 738 | − * TCON DPCD says otherwise. This means we keep VESA interface as fallback in that case. | |
| 739 | 744 | */ |
| 740 | 745 | if (try_intel_interface && intel_dp->edp_dpcd[0] <= DP_EDP_14b && |
| 741 | 746 | intel_dp_aux_supports_hdr_backlight(connector)) { |
| @@ -745,7 +750,7 @@ int intel_dp_aux_init_backlight_funcs(struct intel_connector *connector) · 3 unmodified lines | ||
| 745 | 750 | return 0; |
| 746 | 751 | } |
| 747 | 752 | |
| 748 | − if (intel_dp_aux_supports_vesa_backlight(connector)) { | |
| 753 | + if (try_vesa_interface && intel_dp_aux_supports_vesa_backlight(connector)) { | |
| 749 | 754 | drm_dbg_kms(dev, "[CONNECTOR:%d:%s] Using VESA eDP backlight controls\n", |
| 750 | 755 | connector->base.base.id, connector->base.name); |
| 751 | 756 | panel->backlight.funcs = &intel_dp_vesa_bl_funcs; |