|
97 | 97 |
|
98 | 98 | #define INTEL_EDP_BRIGHTNESS_OPTIMIZATION_1 0x359
|
99 | 99 |
|
| 100 | +enum intel_dp_aux_backlight_modparam { |
| 101 | + INTEL_DP_AUX_BACKLIGHT_AUTO = -1, |
| 102 | + INTEL_DP_AUX_BACKLIGHT_OFF = 0, |
| 103 | + INTEL_DP_AUX_BACKLIGHT_ON = 1, |
| 104 | + INTEL_DP_AUX_BACKLIGHT_FORCE_VESA = 2, |
| 105 | + INTEL_DP_AUX_BACKLIGHT_FORCE_INTEL = 3, |
| 106 | +}; |
| 107 | + |
100 | 108 | /* Intel EDP backlight callbacks */
|
101 | 109 | static bool
|
102 | 110 | intel_dp_aux_supports_hdr_backlight(struct intel_connector *connector)
|
@@ -126,6 +134,24 @@ intel_dp_aux_supports_hdr_backlight(struct intel_connector *connector)
|
126 | 134 | return false;
|
127 | 135 | }
|
128 | 136 |
|
| 137 | + /* |
| 138 | + * If we don't have HDR static metadata there is no way to |
| 139 | + * runtime detect used range for nits based control. For now |
| 140 | + * do not use Intel proprietary eDP backlight control if we |
| 141 | + * don't have this data in panel EDID. In case we find panel |
| 142 | + * which supports only nits based control, but doesn't provide |
| 143 | + * HDR static metadata we need to start maintaining table of |
| 144 | + * ranges for such panels. |
| 145 | + */ |
| 146 | + if (i915->params.enable_dpcd_backlight != INTEL_DP_AUX_BACKLIGHT_FORCE_INTEL && |
| 147 | + !(connector->base.hdr_sink_metadata.hdmi_type1.metadata_type & |
| 148 | + BIT(HDMI_STATIC_METADATA_TYPE1))) { |
| 149 | + drm_info(&i915->drm, |
| 150 | + "Panel is missing HDR static metadata. Possible support for Intel HDR backlight interface is not used. If your backlight controls don't work try booting with i915.enable_dpcd_backlight=%d. needs this, please file a _new_ bug report on drm/i915, see " FDO_BUG_URL " for details.\n", |
| 151 | + INTEL_DP_AUX_BACKLIGHT_FORCE_INTEL); |
| 152 | + return false; |
| 153 | + } |
| 154 | + |
129 | 155 | panel->backlight.edp.intel.sdr_uses_aux =
|
130 | 156 | tcon_cap[2] & INTEL_EDP_SDR_TCON_BRIGHTNESS_AUX_CAP;
|
131 | 157 |
|
@@ -413,14 +439,6 @@ static const struct intel_panel_bl_funcs intel_dp_vesa_bl_funcs = {
|
413 | 439 | .get = intel_dp_aux_vesa_get_backlight,
|
414 | 440 | };
|
415 | 441 |
|
416 |
| -enum intel_dp_aux_backlight_modparam { |
417 |
| - INTEL_DP_AUX_BACKLIGHT_AUTO = -1, |
418 |
| - INTEL_DP_AUX_BACKLIGHT_OFF = 0, |
419 |
| - INTEL_DP_AUX_BACKLIGHT_ON = 1, |
420 |
| - INTEL_DP_AUX_BACKLIGHT_FORCE_VESA = 2, |
421 |
| - INTEL_DP_AUX_BACKLIGHT_FORCE_INTEL = 3, |
422 |
| -}; |
423 |
| - |
424 | 442 | int intel_dp_aux_init_backlight_funcs(struct intel_connector *connector)
|
425 | 443 | {
|
426 | 444 | struct drm_device *dev = connector->base.dev;
|
|
0 commit comments