Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/i915/backlight: Check if VESA backlight is possible

Check if BACKLIGHT_BRIGHTNESS_AUX_SET_CAPABLE bit is
set then EDP_PWMGEN_BIT_COUNT_CAP_MIN and EDP_PWMGEN_BIT_COUNT_CAP_MAX
follow the eDP 1.4b Section 10.3. Which states min should
be >= 1 and max should be >= min. Some legacy panels
do not follow this properly. They set the
BACKLIGHT_BRIGHTNESS_AUX_SET_CAPABLE bit while not correctly
populating the min and max fields leading to a 0 max value.

Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/7514
Fixes: 40d2f5820951 ("drm/i915/backlight: Remove try_vesa_interface")
Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Pranay Samala <pranay.samala@intel.com>
Link: https://patch.msgid.link/20260316031850.81794-1-suraj.kandpal@intel.com

+31 -1
+31 -1
drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
··· 610 610 } 611 611 612 612 static bool 613 + check_if_vesa_backlight_possible(struct intel_dp *intel_dp) 614 + { 615 + int ret; 616 + u8 bit_min, bit_max; 617 + 618 + if (!(intel_dp->edp_dpcd[2] & DP_EDP_BACKLIGHT_BRIGHTNESS_AUX_SET_CAP)) 619 + return true; 620 + 621 + ret = drm_dp_dpcd_read_byte(&intel_dp->aux, DP_EDP_PWMGEN_BIT_COUNT_CAP_MIN, &bit_min); 622 + if (ret < 0) 623 + return false; 624 + 625 + bit_min &= DP_EDP_PWMGEN_BIT_COUNT_MASK; 626 + if (bit_min < 1) 627 + return false; 628 + 629 + ret = drm_dp_dpcd_read_byte(&intel_dp->aux, DP_EDP_PWMGEN_BIT_COUNT_CAP_MAX, &bit_max); 630 + if (ret < 0) 631 + return false; 632 + 633 + bit_max &= DP_EDP_PWMGEN_BIT_COUNT_MASK; 634 + if (bit_max < bit_min) 635 + return false; 636 + 637 + return true; 638 + } 639 + 640 + static bool 613 641 intel_dp_aux_supports_vesa_backlight(struct intel_connector *connector) 614 642 { 615 643 struct intel_display *display = to_intel_display(connector); ··· 653 625 return true; 654 626 } 655 627 656 - if (drm_edp_backlight_supported(intel_dp->edp_dpcd)) { 628 + if (drm_edp_backlight_supported(intel_dp->edp_dpcd) && 629 + check_if_vesa_backlight_possible(intel_dp)) { 657 630 drm_dbg_kms(display->drm, 658 631 "[CONNECTOR:%d:%s] AUX Backlight Control Supported!\n", 659 632 connector->base.base.id, connector->base.name); 660 633 return true; 661 634 } 635 + 662 636 return false; 663 637 } 664 638