History

Revert "drm/i915/backlight: Remove try_vesa_interface"

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.

Suraj Kandpal committed 6 months ago

Commit 29147091 parent 26eb7c01 file · +12 −7Browse files

Unified · Split

drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c+12−7
@@ -691,10 +691,9 @@ int intel_dp_aux_init_backlight_funcs(struct intel_connector *connector) · 690 unmodified lines
691691 struct intel_dp *intel_dp = intel_attached_dp(connector);
692692 struct drm_device *dev = connector->base.dev;
693693 struct intel_panel *panel = &connector->panel;
694− bool try_intel_interface = false;
694+ bool try_intel_interface = false, try_vesa_interface = false;
695695
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
698697 * interfaces to probe
699698 */
700699 switch (display->params.enable_dpcd_backlight) {
@@ -703,6 +702,7 @@ int intel_dp_aux_init_backlight_funcs(struct intel_connector *connector) · 2 unmodified lines
703702 case INTEL_DP_AUX_BACKLIGHT_AUTO:
704703 switch (panel->vbt.backlight.type) {
705704 case INTEL_BACKLIGHT_VESA_EDP_AUX_INTERFACE:
705+ try_vesa_interface = true;
706706 break;
707707 case INTEL_BACKLIGHT_DISPLAY_DDI:
708708 try_intel_interface = true;
@@ -715,12 +715,20 @@ int intel_dp_aux_init_backlight_funcs(struct intel_connector *connector) · 6 unmodified lines
715715 if (panel->vbt.backlight.type != INTEL_BACKLIGHT_VESA_EDP_AUX_INTERFACE)
716716 try_intel_interface = true;
717717
718+ try_vesa_interface = true;
719+ break;
720+ case INTEL_DP_AUX_BACKLIGHT_FORCE_VESA:
721+ try_vesa_interface = true;
718722 break;
719723 case INTEL_DP_AUX_BACKLIGHT_FORCE_INTEL:
720724 try_intel_interface = true;
721725 break;
722726 }
723727
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+
724732 /*
725733 * Since Intel has their own backlight control interface, the majority of machines out there
726734 * 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
733741 * panel with Intel's OUI - which is also required for us to be able to detect Intel's
734742 * backlight interface at all. This means that the only sensible way for us to detect both
735743 * 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.
739744 */
740745 if (try_intel_interface && intel_dp->edp_dpcd[0] <= DP_EDP_14b &&
741746 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
745750 return 0;
746751 }
747752
748− if (intel_dp_aux_supports_vesa_backlight(connector)) {
753+ if (try_vesa_interface && intel_dp_aux_supports_vesa_backlight(connector)) {
749754 drm_dbg_kms(dev, "[CONNECTOR:%d:%s] Using VESA eDP backlight controls\n",
750755 connector->base.base.id, connector->base.name);
751756 panel->backlight.funcs = &intel_dp_vesa_bl_funcs;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t