mirror of
https://github.com/torvalds/linux.git
synced 2026-05-26 08:02:27 +02:00
drm/i915: Parse VRR capability from VBT
VBT seems to have an extra flag for VRR vs. not. Let's consult that for eDP panels. Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20220531191844.11313-2-ville.syrjala@linux.intel.com
This commit is contained in:
parent
04514c1467
commit
fba99b1ab7
|
|
@ -1292,6 +1292,8 @@ parse_power_conservation_features(struct drm_i915_private *i915,
|
|||
const struct bdb_lfp_power *power;
|
||||
u8 panel_type = panel->vbt.panel_type;
|
||||
|
||||
panel->vbt.vrr = true; /* matches Windows behaviour */
|
||||
|
||||
if (i915->vbt.version < 228)
|
||||
return;
|
||||
|
||||
|
|
@ -1312,6 +1314,9 @@ parse_power_conservation_features(struct drm_i915_private *i915,
|
|||
|
||||
if (i915->vbt.version >= 232)
|
||||
panel->vbt.edp.hobl = power->hobl & BIT(panel_type);
|
||||
|
||||
if (i915->vbt.version >= 233)
|
||||
panel->vbt.vrr = power->vrr_feature_enabled & BIT(panel_type);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
|
|
@ -294,6 +294,8 @@ struct intel_vbt_panel_data {
|
|||
unsigned int lvds_dither:1;
|
||||
unsigned int bios_lvds_val; /* initial [PCH_]LVDS reg val in VBIOS */
|
||||
|
||||
bool vrr;
|
||||
|
||||
u8 seamless_drrs_min_refresh_rate;
|
||||
enum drrs_type drrs_type;
|
||||
|
||||
|
|
|
|||
|
|
@ -15,19 +15,29 @@ bool intel_vrr_is_capable(struct intel_connector *connector)
|
|||
struct drm_i915_private *i915 = to_i915(connector->base.dev);
|
||||
struct intel_dp *intel_dp;
|
||||
|
||||
if (connector->base.connector_type != DRM_MODE_CONNECTOR_eDP &&
|
||||
connector->base.connector_type != DRM_MODE_CONNECTOR_DisplayPort)
|
||||
return false;
|
||||
|
||||
intel_dp = intel_attached_dp(connector);
|
||||
/*
|
||||
* DP Sink is capable of VRR video timings if
|
||||
* Ignore MSA bit is set in DPCD.
|
||||
* EDID monitor range also should be atleast 10 for reasonable
|
||||
* Adaptive Sync or Variable Refresh Rate end user experience.
|
||||
*/
|
||||
switch (connector->base.connector_type) {
|
||||
case DRM_MODE_CONNECTOR_eDP:
|
||||
if (!connector->panel.vbt.vrr)
|
||||
return false;
|
||||
fallthrough;
|
||||
case DRM_MODE_CONNECTOR_DisplayPort:
|
||||
intel_dp = intel_attached_dp(connector);
|
||||
|
||||
if (!drm_dp_sink_can_do_video_without_timing_msa(intel_dp->dpcd))
|
||||
return false;
|
||||
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
return HAS_VRR(i915) &&
|
||||
drm_dp_sink_can_do_video_without_timing_msa(intel_dp->dpcd) &&
|
||||
info->monitor_range.max_vfreq - info->monitor_range.min_vfreq > 10;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user