Commit 8e9c9848 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Polish drrs type enum

Make the drrs type enum less convoluted.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220310004802.16310-7-ville.syrjala@linux.intel.comReviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
parent 1fa7bb12
...@@ -257,16 +257,16 @@ parse_panel_options(struct drm_i915_private *i915, ...@@ -257,16 +257,16 @@ parse_panel_options(struct drm_i915_private *i915,
*/ */
switch (drrs_mode) { switch (drrs_mode) {
case 0: case 0:
i915->vbt.drrs_type = STATIC_DRRS_SUPPORT; i915->vbt.drrs_type = DRRS_TYPE_STATIC;
drm_dbg_kms(&i915->drm, "DRRS supported mode is static\n"); drm_dbg_kms(&i915->drm, "DRRS supported mode is static\n");
break; break;
case 2: case 2:
i915->vbt.drrs_type = SEAMLESS_DRRS_SUPPORT; i915->vbt.drrs_type = DRRS_TYPE_SEAMLESS;
drm_dbg_kms(&i915->drm, drm_dbg_kms(&i915->drm,
"DRRS supported mode is seamless\n"); "DRRS supported mode is seamless\n");
break; break;
default: default:
i915->vbt.drrs_type = DRRS_NOT_SUPPORTED; i915->vbt.drrs_type = DRRS_TYPE_NONE;
drm_dbg_kms(&i915->drm, drm_dbg_kms(&i915->drm,
"DRRS not supported (VBT input)\n"); "DRRS not supported (VBT input)\n");
break; break;
...@@ -740,7 +740,7 @@ parse_driver_features(struct drm_i915_private *i915, ...@@ -740,7 +740,7 @@ parse_driver_features(struct drm_i915_private *i915,
* driver->drrs_enabled=false * driver->drrs_enabled=false
*/ */
if (!driver->drrs_enabled) if (!driver->drrs_enabled)
i915->vbt.drrs_type = DRRS_NOT_SUPPORTED; i915->vbt.drrs_type = DRRS_TYPE_NONE;
i915->vbt.psr.enable = driver->psr_enabled; i915->vbt.psr.enable = driver->psr_enabled;
} }
...@@ -769,7 +769,7 @@ parse_power_conservation_features(struct drm_i915_private *i915, ...@@ -769,7 +769,7 @@ parse_power_conservation_features(struct drm_i915_private *i915,
* power->drrs & BIT(panel_type)=false * power->drrs & BIT(panel_type)=false
*/ */
if (!(power->drrs & BIT(panel_type))) if (!(power->drrs & BIT(panel_type)))
i915->vbt.drrs_type = DRRS_NOT_SUPPORTED; i915->vbt.drrs_type = DRRS_TYPE_NONE;
if (bdb->version >= 232) if (bdb->version >= 232)
i915->vbt.edp.hobl = power->hobl & BIT(panel_type); i915->vbt.edp.hobl = power->hobl & BIT(panel_type);
......
...@@ -1163,7 +1163,7 @@ static void drrs_status_per_crtc(struct seq_file *m, ...@@ -1163,7 +1163,7 @@ static void drrs_status_per_crtc(struct seq_file *m,
seq_printf(m, "%s:\n", connector->name); seq_printf(m, "%s:\n", connector->name);
if (connector->connector_type == DRM_MODE_CONNECTOR_eDP && if (connector->connector_type == DRM_MODE_CONNECTOR_eDP &&
drrs->type == SEAMLESS_DRRS_SUPPORT) drrs->type == DRRS_TYPE_SEAMLESS)
supported = true; supported = true;
seq_printf(m, "\tDRRS Supported: %s\n", str_yes_no(supported)); seq_printf(m, "\tDRRS Supported: %s\n", str_yes_no(supported));
......
...@@ -65,7 +65,7 @@ static bool can_enable_drrs(struct intel_connector *connector, ...@@ -65,7 +65,7 @@ static bool can_enable_drrs(struct intel_connector *connector,
return false; return false;
return connector->panel.downclock_mode && return connector->panel.downclock_mode &&
i915->drrs.type == SEAMLESS_DRRS_SUPPORT; i915->drrs.type == DRRS_TYPE_SEAMLESS;
} }
void void
...@@ -155,7 +155,7 @@ static void intel_drrs_set_state(struct drm_i915_private *dev_priv, ...@@ -155,7 +155,7 @@ static void intel_drrs_set_state(struct drm_i915_private *dev_priv,
return; return;
} }
if (dev_priv->drrs.type != SEAMLESS_DRRS_SUPPORT) { if (dev_priv->drrs.type != DRRS_TYPE_SEAMLESS) {
drm_dbg_kms(&dev_priv->drm, "Only Seamless DRRS supported.\n"); drm_dbg_kms(&dev_priv->drm, "Only Seamless DRRS supported.\n");
return; return;
} }
...@@ -274,7 +274,7 @@ intel_drrs_update(struct intel_dp *intel_dp, ...@@ -274,7 +274,7 @@ intel_drrs_update(struct intel_dp *intel_dp,
{ {
struct drm_i915_private *dev_priv = dp_to_i915(intel_dp); struct drm_i915_private *dev_priv = dp_to_i915(intel_dp);
if (dev_priv->drrs.type != SEAMLESS_DRRS_SUPPORT) if (dev_priv->drrs.type != DRRS_TYPE_SEAMLESS)
return; return;
mutex_lock(&dev_priv->drrs.mutex); mutex_lock(&dev_priv->drrs.mutex);
...@@ -329,7 +329,7 @@ static void intel_drrs_frontbuffer_update(struct drm_i915_private *dev_priv, ...@@ -329,7 +329,7 @@ static void intel_drrs_frontbuffer_update(struct drm_i915_private *dev_priv,
struct drm_crtc *crtc; struct drm_crtc *crtc;
enum pipe pipe; enum pipe pipe;
if (dev_priv->drrs.type != SEAMLESS_DRRS_SUPPORT) if (dev_priv->drrs.type != DRRS_TYPE_SEAMLESS)
return; return;
cancel_delayed_work(&dev_priv->drrs.work); cancel_delayed_work(&dev_priv->drrs.work);
...@@ -449,7 +449,7 @@ intel_drrs_init(struct intel_connector *connector, ...@@ -449,7 +449,7 @@ intel_drrs_init(struct intel_connector *connector,
return NULL; return NULL;
} }
if (dev_priv->vbt.drrs_type != SEAMLESS_DRRS_SUPPORT) { if (dev_priv->vbt.drrs_type != DRRS_TYPE_SEAMLESS) {
drm_dbg_kms(&dev_priv->drm, drm_dbg_kms(&dev_priv->drm,
"[CONNECTOR:%d:%s] DRRS not supported according to VBT\n", "[CONNECTOR:%d:%s] DRRS not supported according to VBT\n",
connector->base.base.id, connector->base.name); connector->base.base.id, connector->base.name);
......
...@@ -207,10 +207,10 @@ enum drrs_refresh_rate_type { ...@@ -207,10 +207,10 @@ enum drrs_refresh_rate_type {
DRRS_MAX_RR, /* RR count */ DRRS_MAX_RR, /* RR count */
}; };
enum drrs_support_type { enum drrs_type {
DRRS_NOT_SUPPORTED = 0, DRRS_TYPE_NONE,
STATIC_DRRS_SUPPORT = 1, DRRS_TYPE_STATIC,
SEAMLESS_DRRS_SUPPORT = 2 DRRS_TYPE_SEAMLESS,
}; };
struct i915_drrs { struct i915_drrs {
...@@ -219,7 +219,7 @@ struct i915_drrs { ...@@ -219,7 +219,7 @@ struct i915_drrs {
struct intel_dp *dp; struct intel_dp *dp;
unsigned busy_frontbuffer_bits; unsigned busy_frontbuffer_bits;
enum drrs_refresh_rate_type refresh_rate_type; enum drrs_refresh_rate_type refresh_rate_type;
enum drrs_support_type type; enum drrs_type type;
}; };
#define QUIRK_LVDS_SSC_DISABLE (1<<1) #define QUIRK_LVDS_SSC_DISABLE (1<<1)
...@@ -349,7 +349,7 @@ struct intel_vbt_data { ...@@ -349,7 +349,7 @@ struct intel_vbt_data {
bool override_afc_startup; bool override_afc_startup;
u8 override_afc_startup_val; u8 override_afc_startup_val;
enum drrs_support_type drrs_type; enum drrs_type drrs_type;
struct { struct {
int rate; int rate;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment