]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/i915/backlight: Check Luminance based brightness control for VESA
authorSuraj Kandpal <suraj.kandpal@intel.com>
Thu, 6 Feb 2025 06:32:49 +0000 (12:02 +0530)
committerSuraj Kandpal <suraj.kandpal@intel.com>
Thu, 6 Feb 2025 16:44:42 +0000 (22:14 +0530)
Check if we are capable of controlling brightness via luminance
which is dependent on PANEL_LUMINANCE_CONTROL_CAPABLE bit being set
on EDP_GENERAL_CAPABILITY_2 register.

--v2
-Prefer using luminance rather than nits [Jani]
-Fix commit message

--v3
-Fix the bit name used in commit message [Arun]
-Use correct edp_dpcd[] to check the capability [Arun]

Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Tested-by: Ben Kao <ben.kao@intel.com>
Reviewed-by: Arun R Murthy <arun.r.murthy@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250206063253.2827017-5-suraj.kandpal@intel.com
drivers/gpu/drm/i915/display/intel_display_types.h
drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c

index d8a3d4d6aedf85e187c1fed95f2800e8940824fd..6a82c6ade549b5294a9eec6290e9b1654dcbfa92 100644 (file)
@@ -413,6 +413,7 @@ struct intel_panel {
                union {
                        struct {
                                struct drm_edp_backlight_info info;
+                               bool luminance_control_support;
                        } vesa;
                        struct {
                                bool sdr_uses_aux;
index 09e82f24d0302039566a579022cd10d72c3e1b00..2599aa39b21df3b915e72ef824b751d313654295 100644 (file)
@@ -575,6 +575,15 @@ intel_dp_aux_supports_vesa_backlight(struct intel_connector *connector)
 {
        struct intel_display *display = to_intel_display(connector);
        struct intel_dp *intel_dp = intel_attached_dp(connector);
+       struct intel_panel *panel = &connector->panel;
+
+       if ((intel_dp->edp_dpcd[3] & DP_EDP_PANEL_LUMINANCE_CONTROL_CAPABLE)) {
+               drm_dbg_kms(display->drm,
+                           "[CONNECTOR:%d:%s] AUX Luminance Based Backlight Control Supported!\n",
+                           connector->base.base.id, connector->base.name);
+               panel->backlight.edp.vesa.luminance_control_support = true;
+               return true;
+       }
 
        if (drm_edp_backlight_supported(intel_dp->edp_dpcd)) {
                drm_dbg_kms(display->drm,