Most of the conditional code for ICELAKE also applies to ELKHARTLAKE
so use IS_GEN(dev_priv, 11) even for PM and Workarounds for now.
v2: - Rename commit (Jose)
    - Include a wm workaround (Jose and Lucas)
    - Include display core init (Jose and Lucas)
v3: Add a missing case of gen greater-than 11 (Jose)
Cc: José Roberto de Souza <jose.souza@intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Bob Paauwe <bob.j.paauwe@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190412180920.22347-1-rodrigo.vivi@intel.com
                                memset(&wm->wm[level], 0, sizeof(wm->wm[level]));
 
                        /*
-                        * Wa_1408961008:icl
+                        * Wa_1408961008:icl, ehl
                         * Underruns with WM1+ disabled
                         */
-                       if (IS_ICELAKE(dev_priv) &&
+                       if (IS_GEN(dev_priv, 11) &&
                            level == 1 && wm->wm[0].plane_en) {
                                wm->wm[level].plane_res_b = wm->wm[0].plane_res_b;
                                wm->wm[level].plane_res_l = wm->wm[0].plane_res_l;
  */
 void intel_init_clock_gating_hooks(struct drm_i915_private *dev_priv)
 {
-       if (IS_ICELAKE(dev_priv))
+       if (IS_GEN(dev_priv, 11))
                dev_priv->display.init_clock_gating = icl_init_clock_gating;
        else if (IS_CANNONLAKE(dev_priv))
                dev_priv->display.init_clock_gating = cnl_init_clock_gating;
 
         * The enabling order will be from lower to higher indexed wells,
         * the disabling order is reversed.
         */
-       if (IS_ICELAKE(dev_priv)) {
+       if (IS_GEN(dev_priv, 11)) {
                err = set_power_wells(power_domains, icl_power_wells);
        } else if (IS_CANNONLAKE(dev_priv)) {
                err = set_power_wells(power_domains, cnl_power_wells);
 
        power_domains->initializing = true;
 
-       if (IS_ICELAKE(i915)) {
+       if (INTEL_GEN(i915) >= 11) {
                icl_display_core_init(i915, resume);
        } else if (IS_CANNONLAKE(i915)) {
                cnl_display_core_init(i915, resume);
                intel_power_domains_verify_state(i915);
        }
 
-       if (IS_ICELAKE(i915))
+       if (INTEL_GEN(i915) >= 11)
                icl_display_core_uninit(i915);
        else if (IS_CANNONLAKE(i915))
                cnl_display_core_uninit(i915);
 
 
        wa_init_start(wal, "context");
 
-       if (IS_ICELAKE(i915))
+       if (IS_GEN(i915, 11))
                icl_ctx_workarounds_init(engine);
        else if (IS_CANNONLAKE(i915))
                cnl_ctx_workarounds_init(engine);
 static void
 gt_init_workarounds(struct drm_i915_private *i915, struct i915_wa_list *wal)
 {
-       if (IS_ICELAKE(i915))
+       if (IS_GEN(i915, 11))
                icl_gt_workarounds_init(i915, wal);
        else if (IS_CANNONLAKE(i915))
                cnl_gt_workarounds_init(i915, wal);
 
        wa_init_start(w, "whitelist");
 
-       if (IS_ICELAKE(i915))
+       if (IS_GEN(i915, 11))
                icl_whitelist_build(w);
        else if (IS_CANNONLAKE(i915))
                cnl_whitelist_build(w);
 {
        struct drm_i915_private *i915 = engine->i915;
 
-       if (IS_ICELAKE(i915)) {
+       if (IS_GEN(i915, 11)) {
                /* This is not an Wa. Enable for better image quality */
                wa_masked_en(wal,
                             _3D_CHICKEN3,