drm/i915: Setup final panel drrs_type already during init
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 3 Oct 2022 11:32:49 +0000 (14:32 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 4 Oct 2022 14:48:19 +0000 (17:48 +0300)
Now that we track the VBT drrs type per-panel we can move the
has_drrs_modes() check to the panel init rather than doing it
for every intel_panel_drrs_type() call.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221003113249.16213-7-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/display/intel_panel.c

index d18c56cf957d45bd106b6f8b34209eff9bc39832..2b4b359b8342b42da30bde583be2adcb1ac8889a 100644 (file)
@@ -165,9 +165,6 @@ static bool has_drrs_modes(struct intel_connector *connector)
 
 enum drrs_type intel_panel_drrs_type(struct intel_connector *connector)
 {
-       if (!has_drrs_modes(connector))
-               return DRRS_TYPE_NONE;
-
        return connector->panel.vbt.drrs_type;
 }
 
@@ -668,6 +665,9 @@ int intel_panel_init(struct intel_connector *connector)
 
        intel_backlight_init_funcs(panel);
 
+       if (!has_drrs_modes(connector))
+               connector->panel.vbt.drrs_type = DRRS_TYPE_NONE;
+
        drm_dbg_kms(connector->base.dev,
                    "[CONNECTOR:%d:%s] DRRS type: %s\n",
                    connector->base.base.id, connector->base.name,