Commit 85b17e6e authored by Jani Nikula's avatar Jani Nikula

drm/i915: clean up virtual PCH special case handling

Use intel_pch_type() also for mapping the no PCH case (PCH id 0) to
PCH_NONE to simplify code.

Also make sure that intel_pch_type() knows all the PCH ids returned by
intel_virt_detect_pch(). Loudly fail if this isn't the case; this
shouldn't happen anyway.

Cc: Colin Xu <Colin.Xu@intel.com>
Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Tested-by: default avatarColin Xu <Colin.Xu@intel.com>
Reviewed-by: default avatarColin Xu <Colin.Xu@intel.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180608123330.31003-4-jani.nikula@intel.com
parent b8bf31d8
...@@ -284,13 +284,12 @@ static void intel_detect_pch(struct drm_i915_private *dev_priv) ...@@ -284,13 +284,12 @@ static void intel_detect_pch(struct drm_i915_private *dev_priv)
} else if (intel_is_virt_pch(id, pch->subsystem_vendor, } else if (intel_is_virt_pch(id, pch->subsystem_vendor,
pch->subsystem_device)) { pch->subsystem_device)) {
id = intel_virt_detect_pch(dev_priv); id = intel_virt_detect_pch(dev_priv);
if (id) { pch_type = intel_pch_type(dev_priv, id);
pch_type = intel_pch_type(dev_priv, id);
if (WARN_ON(pch_type == PCH_NONE)) /* Sanity check virtual PCH id */
pch_type = PCH_NOP; if (WARN_ON(id && pch_type == PCH_NONE))
} else { id = 0;
pch_type = PCH_NONE;
}
dev_priv->pch_type = pch_type; dev_priv->pch_type = pch_type;
dev_priv->pch_id = id; dev_priv->pch_id = id;
break; break;
......
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