OSDN Git Service

drm/i915: Nuke dev_priv->drrs.type
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 11 Mar 2022 17:24:17 +0000 (19:24 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 14 Mar 2022 22:13:31 +0000 (00:13 +0200)
When we found a downclock mode dev_priv->drrs.type is just a
straight copy of dev_priv->vbt.drrs_type. And in case we
couldn't find a downclock mode can_enable_drrs() won't let
us enable DRRS anyway so the minor distinction between the
two is irrelevant. So let's just nuke dev_priv->drrs.type
and consult the VBT version directly.

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

index e511500..2a6fd15 100644 (file)
@@ -1156,7 +1156,7 @@ static void drrs_status_per_crtc(struct seq_file *m,
                seq_printf(m, "%s:\n", connector->name);
 
                if (connector->connector_type == DRM_MODE_CONNECTOR_eDP &&
-                   drrs->type == DRRS_TYPE_SEAMLESS)
+                   dev_priv->vbt.drrs_type == DRRS_TYPE_SEAMLESS)
                        supported = true;
 
                seq_printf(m, "\tDRRS Supported: %s\n", str_yes_no(supported));
index c97b5de..4afbc90 100644 (file)
@@ -65,7 +65,7 @@ static bool can_enable_drrs(struct intel_connector *connector,
                return false;
 
        return connector->panel.downclock_mode &&
-               i915->drrs.type == DRRS_TYPE_SEAMLESS;
+               i915->vbt.drrs_type == DRRS_TYPE_SEAMLESS;
 }
 
 void
@@ -154,7 +154,7 @@ static void intel_drrs_set_state(struct drm_i915_private *dev_priv,
                return;
        }
 
-       if (dev_priv->drrs.type != DRRS_TYPE_SEAMLESS) {
+       if (dev_priv->vbt.drrs_type != DRRS_TYPE_SEAMLESS) {
                drm_dbg_kms(&dev_priv->drm, "Only Seamless DRRS supported.\n");
                return;
        }
@@ -269,7 +269,7 @@ intel_drrs_update(struct intel_dp *intel_dp,
 {
        struct drm_i915_private *dev_priv = dp_to_i915(intel_dp);
 
-       if (dev_priv->drrs.type != DRRS_TYPE_SEAMLESS)
+       if (dev_priv->vbt.drrs_type != DRRS_TYPE_SEAMLESS)
                return;
 
        mutex_lock(&dev_priv->drrs.mutex);
@@ -325,7 +325,7 @@ static void intel_drrs_frontbuffer_update(struct drm_i915_private *dev_priv,
        struct drm_crtc *crtc;
        enum pipe pipe;
 
-       if (dev_priv->drrs.type != DRRS_TYPE_SEAMLESS)
+       if (dev_priv->vbt.drrs_type != DRRS_TYPE_SEAMLESS)
                return;
 
        cancel_delayed_work(&dev_priv->drrs.work);
@@ -460,8 +460,6 @@ intel_drrs_init(struct intel_connector *connector,
                return NULL;
        }
 
-       dev_priv->drrs.type = dev_priv->vbt.drrs_type;
-
        dev_priv->drrs.refresh_rate = DRRS_REFRESH_RATE_HIGH;
        drm_dbg_kms(&dev_priv->drm,
                    "[CONNECTOR:%d:%s] seamless DRRS supported\n",
index bd9bff2..643e05b 100644 (file)
@@ -213,7 +213,6 @@ struct i915_drrs {
        struct intel_dp *dp;
        unsigned busy_frontbuffer_bits;
        enum drrs_refresh_rate refresh_rate;
-       enum drrs_type type;
 };
 
 #define QUIRK_LVDS_SSC_DISABLE (1<<1)