aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_panel.c
diff options
context:
space:
mode:
authorLucas De Marchi <lucas.demarchi@intel.com>2018-12-12 13:10:43 -0500
committerRodrigo Vivi <rodrigo.vivi@intel.com>2018-12-12 19:52:10 -0500
commitcf819eff907ab49205ece97c96baeb909fd36f4d (patch)
treea72b69e1d0c1a188db876edccafcf04612133132 /drivers/gpu/drm/i915/intel_panel.c
parent006900087727f675e9367eb3c3e054912ddbffdd (diff)
drm/i915: replace IS_GEN<N> with IS_GEN(..., N)
Define IS_GEN() similarly to our IS_GEN_RANGE(). but use gen instead of gen_mask to do the comparison. Now callers can pass then gen as a parameter, so we don't require one macro for each gen. The following spatch was used to convert the users of these macros: @@ expression e; @@ ( - IS_GEN2(e) + IS_GEN(e, 2) | - IS_GEN3(e) + IS_GEN(e, 3) | - IS_GEN4(e) + IS_GEN(e, 4) | - IS_GEN5(e) + IS_GEN(e, 5) | - IS_GEN6(e) + IS_GEN(e, 6) | - IS_GEN7(e) + IS_GEN(e, 7) | - IS_GEN8(e) + IS_GEN(e, 8) | - IS_GEN9(e) + IS_GEN(e, 9) | - IS_GEN10(e) + IS_GEN(e, 10) | - IS_GEN11(e) + IS_GEN(e, 11) ) v2: use IS_GEN rather than GT_GEN and compare to info.gen rather than using the bitmask Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20181212181044.15886-2-lucas.demarchi@intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/intel_panel.c')
-rw-r--r--drivers/gpu/drm/i915/intel_panel.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c
index e6cd7b55c018..ee3e0842d542 100644
--- a/drivers/gpu/drm/i915/intel_panel.c
+++ b/drivers/gpu/drm/i915/intel_panel.c
@@ -563,7 +563,7 @@ static void i9xx_set_backlight(const struct drm_connector_state *conn_state, u32
563 pci_write_config_byte(dev_priv->drm.pdev, LBPC, lbpc); 563 pci_write_config_byte(dev_priv->drm.pdev, LBPC, lbpc);
564 } 564 }
565 565
566 if (IS_GEN4(dev_priv)) { 566 if (IS_GEN(dev_priv, 4)) {
567 mask = BACKLIGHT_DUTY_CYCLE_MASK; 567 mask = BACKLIGHT_DUTY_CYCLE_MASK;
568 } else { 568 } else {
569 level <<= 1; 569 level <<= 1;
@@ -929,7 +929,7 @@ static void i9xx_enable_backlight(const struct intel_crtc_state *crtc_state,
929 * 855gm only, but checking for gen2 is safe, as 855gm is the only gen2 929 * 855gm only, but checking for gen2 is safe, as 855gm is the only gen2
930 * that has backlight. 930 * that has backlight.
931 */ 931 */
932 if (IS_GEN2(dev_priv)) 932 if (IS_GEN(dev_priv, 2))
933 I915_WRITE(BLC_HIST_CTL, BLM_HISTOGRAM_ENABLE); 933 I915_WRITE(BLC_HIST_CTL, BLM_HISTOGRAM_ENABLE);
934} 934}
935 935
@@ -1557,7 +1557,7 @@ static int i9xx_setup_backlight(struct intel_connector *connector, enum pipe unu
1557 1557
1558 ctl = I915_READ(BLC_PWM_CTL); 1558 ctl = I915_READ(BLC_PWM_CTL);
1559 1559
1560 if (IS_GEN2(dev_priv) || IS_I915GM(dev_priv) || IS_I945GM(dev_priv)) 1560 if (IS_GEN(dev_priv, 2) || IS_I915GM(dev_priv) || IS_I945GM(dev_priv))
1561 panel->backlight.combination_mode = ctl & BLM_LEGACY_MODE; 1561 panel->backlight.combination_mode = ctl & BLM_LEGACY_MODE;
1562 1562
1563 if (IS_PINEVIEW(dev_priv)) 1563 if (IS_PINEVIEW(dev_priv))
@@ -1886,7 +1886,7 @@ intel_panel_init_backlight_funcs(struct intel_panel *panel)
1886 panel->backlight.get = vlv_get_backlight; 1886 panel->backlight.get = vlv_get_backlight;
1887 panel->backlight.hz_to_pwm = vlv_hz_to_pwm; 1887 panel->backlight.hz_to_pwm = vlv_hz_to_pwm;
1888 } 1888 }
1889 } else if (IS_GEN4(dev_priv)) { 1889 } else if (IS_GEN(dev_priv, 4)) {
1890 panel->backlight.setup = i965_setup_backlight; 1890 panel->backlight.setup = i965_setup_backlight;
1891 panel->backlight.enable = i965_enable_backlight; 1891 panel->backlight.enable = i965_enable_backlight;
1892 panel->backlight.disable = i965_disable_backlight; 1892 panel->backlight.disable = i965_disable_backlight;