Commit 920a14b2 authored by Tvrtko Ursulin's avatar Tvrtko Ursulin

drm/i915: Make IS_CHERRYVIEW only take dev_priv

Saves 864 bytes of .rodata strings and ~100 of .text.

v2: Add parantheses around dev_priv. (Ville Syrjala)
v3: Rebase.
Signed-off-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: default avatarDavid Weinehall <david.weinehall@linux.intel.com>
Acked-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: default avatarJani Nikula <jani.nikula@linux.intel.com>
Acked-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Acked-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
parent 9beb5fea
...@@ -424,7 +424,7 @@ intel_setup_mchbar(struct drm_device *dev) ...@@ -424,7 +424,7 @@ intel_setup_mchbar(struct drm_device *dev)
u32 temp; u32 temp;
bool enabled; bool enabled;
if (IS_VALLEYVIEW(dev) || IS_CHERRYVIEW(dev)) if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv))
return; return;
dev_priv->mchbar_need_disable = false; dev_priv->mchbar_need_disable = false;
......
...@@ -2656,7 +2656,7 @@ struct drm_i915_cmd_table { ...@@ -2656,7 +2656,7 @@ struct drm_i915_cmd_table {
INTEL_DEVID(dev_priv) == 0x0152 || \ INTEL_DEVID(dev_priv) == 0x0152 || \
INTEL_DEVID(dev_priv) == 0x015a) INTEL_DEVID(dev_priv) == 0x015a)
#define IS_VALLEYVIEW(dev) (INTEL_INFO(dev)->is_valleyview) #define IS_VALLEYVIEW(dev) (INTEL_INFO(dev)->is_valleyview)
#define IS_CHERRYVIEW(dev) (INTEL_INFO(dev)->is_cherryview) #define IS_CHERRYVIEW(dev_priv) ((dev_priv)->info.is_cherryview)
#define IS_HASWELL(dev_priv) ((dev_priv)->info.is_haswell) #define IS_HASWELL(dev_priv) ((dev_priv)->info.is_haswell)
#define IS_BROADWELL(dev_priv) ((dev_priv)->info.is_broadwell) #define IS_BROADWELL(dev_priv) ((dev_priv)->info.is_broadwell)
#define IS_SKYLAKE(dev_priv) ((dev_priv)->info.is_skylake) #define IS_SKYLAKE(dev_priv) ((dev_priv)->info.is_skylake)
...@@ -3847,11 +3847,11 @@ __raw_write(64, q) ...@@ -3847,11 +3847,11 @@ __raw_write(64, q)
#define INTEL_BROADCAST_RGB_FULL 1 #define INTEL_BROADCAST_RGB_FULL 1
#define INTEL_BROADCAST_RGB_LIMITED 2 #define INTEL_BROADCAST_RGB_LIMITED 2
static inline i915_reg_t i915_vgacntrl_reg(struct drm_device *dev) static inline i915_reg_t i915_vgacntrl_reg(struct drm_i915_private *dev_priv)
{ {
if (IS_VALLEYVIEW(dev) || IS_CHERRYVIEW(dev)) if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv))
return VLV_VGACNTRL; return VLV_VGACNTRL;
else if (INTEL_INFO(dev)->gen >= 5) else if (INTEL_GEN(dev_priv) >= 5)
return CPU_VGACNTRL; return CPU_VGACNTRL;
else else
return VGACNTRL; return VGACNTRL;
......
...@@ -2135,7 +2135,7 @@ static void gtt_write_workarounds(struct drm_device *dev) ...@@ -2135,7 +2135,7 @@ static void gtt_write_workarounds(struct drm_device *dev)
/* WaIncreaseDefaultTLBEntries:chv,bdw,skl,bxt */ /* WaIncreaseDefaultTLBEntries:chv,bdw,skl,bxt */
if (IS_BROADWELL(dev_priv)) if (IS_BROADWELL(dev_priv))
I915_WRITE(GEN8_L3_LRA_1_GPGPU, GEN8_L3_LRA_1_GPGPU_DEFAULT_VALUE_BDW); I915_WRITE(GEN8_L3_LRA_1_GPGPU, GEN8_L3_LRA_1_GPGPU_DEFAULT_VALUE_BDW);
else if (IS_CHERRYVIEW(dev)) else if (IS_CHERRYVIEW(dev_priv))
I915_WRITE(GEN8_L3_LRA_1_GPGPU, GEN8_L3_LRA_1_GPGPU_DEFAULT_VALUE_CHV); I915_WRITE(GEN8_L3_LRA_1_GPGPU, GEN8_L3_LRA_1_GPGPU_DEFAULT_VALUE_CHV);
else if (IS_SKYLAKE(dev_priv)) else if (IS_SKYLAKE(dev_priv))
I915_WRITE(GEN8_L3_LRA_1_GPGPU, GEN9_L3_LRA_1_GPGPU_DEFAULT_VALUE_SKL); I915_WRITE(GEN8_L3_LRA_1_GPGPU, GEN9_L3_LRA_1_GPGPU_DEFAULT_VALUE_SKL);
......
...@@ -435,8 +435,8 @@ static void ilk_audio_codec_enable(struct drm_connector *connector, ...@@ -435,8 +435,8 @@ static void ilk_audio_codec_enable(struct drm_connector *connector,
aud_config = IBX_AUD_CFG(pipe); aud_config = IBX_AUD_CFG(pipe);
aud_cntl_st = IBX_AUD_CNTL_ST(pipe); aud_cntl_st = IBX_AUD_CNTL_ST(pipe);
aud_cntrl_st2 = IBX_AUD_CNTL_ST2; aud_cntrl_st2 = IBX_AUD_CNTL_ST2;
} else if (IS_VALLEYVIEW(connector->dev) || } else if (IS_VALLEYVIEW(dev_priv) ||
IS_CHERRYVIEW(connector->dev)) { IS_CHERRYVIEW(dev_priv)) {
hdmiw_hdmiedid = VLV_HDMIW_HDMIEDID(pipe); hdmiw_hdmiedid = VLV_HDMIW_HDMIEDID(pipe);
aud_config = VLV_AUD_CFG(pipe); aud_config = VLV_AUD_CFG(pipe);
aud_cntl_st = VLV_AUD_CNTL_ST(pipe); aud_cntl_st = VLV_AUD_CNTL_ST(pipe);
......
...@@ -534,7 +534,7 @@ void intel_color_init(struct drm_crtc *crtc) ...@@ -534,7 +534,7 @@ void intel_color_init(struct drm_crtc *crtc)
drm_mode_crtc_set_gamma_size(crtc, 256); drm_mode_crtc_set_gamma_size(crtc, 256);
if (IS_CHERRYVIEW(dev)) { if (IS_CHERRYVIEW(dev_priv)) {
dev_priv->display.load_csc_matrix = cherryview_load_csc_matrix; dev_priv->display.load_csc_matrix = cherryview_load_csc_matrix;
dev_priv->display.load_luts = cherryview_load_luts; dev_priv->display.load_luts = cherryview_load_luts;
} else if (IS_HASWELL(dev_priv)) { } else if (IS_HASWELL(dev_priv)) {
......
This diff is collapsed.
...@@ -344,7 +344,7 @@ vlv_power_sequencer_kick(struct intel_dp *intel_dp) ...@@ -344,7 +344,7 @@ vlv_power_sequencer_kick(struct intel_dp *intel_dp)
DP |= DP_PORT_WIDTH(1); DP |= DP_PORT_WIDTH(1);
DP |= DP_LINK_TRAIN_PAT_1; DP |= DP_LINK_TRAIN_PAT_1;
if (IS_CHERRYVIEW(dev)) if (IS_CHERRYVIEW(dev_priv))
DP |= DP_PIPE_SELECT_CHV(pipe); DP |= DP_PIPE_SELECT_CHV(pipe);
else if (pipe == PIPE_B) else if (pipe == PIPE_B)
DP |= DP_PIPEB_SELECT; DP |= DP_PIPEB_SELECT;
...@@ -356,10 +356,10 @@ vlv_power_sequencer_kick(struct intel_dp *intel_dp) ...@@ -356,10 +356,10 @@ vlv_power_sequencer_kick(struct intel_dp *intel_dp)
* So enable temporarily it if it's not already enabled. * So enable temporarily it if it's not already enabled.
*/ */
if (!pll_enabled) { if (!pll_enabled) {
release_cl_override = IS_CHERRYVIEW(dev) && release_cl_override = IS_CHERRYVIEW(dev_priv) &&
!chv_phy_powergate_ch(dev_priv, phy, ch, true); !chv_phy_powergate_ch(dev_priv, phy, ch, true);
if (vlv_force_pll_on(dev, pipe, IS_CHERRYVIEW(dev) ? if (vlv_force_pll_on(dev, pipe, IS_CHERRYVIEW(dev_priv) ?
&chv_dpll[0].dpll : &vlv_dpll[0].dpll)) { &chv_dpll[0].dpll : &vlv_dpll[0].dpll)) {
DRM_ERROR("Failed to force on pll for pipe %c!\n", DRM_ERROR("Failed to force on pll for pipe %c!\n",
pipe_name(pipe)); pipe_name(pipe));
...@@ -570,7 +570,7 @@ void intel_power_sequencer_reset(struct drm_i915_private *dev_priv) ...@@ -570,7 +570,7 @@ void intel_power_sequencer_reset(struct drm_i915_private *dev_priv)
struct drm_device *dev = &dev_priv->drm; struct drm_device *dev = &dev_priv->drm;
struct intel_encoder *encoder; struct intel_encoder *encoder;
if (WARN_ON(!IS_VALLEYVIEW(dev) && !IS_CHERRYVIEW(dev) && if (WARN_ON(!IS_VALLEYVIEW(dev_priv) && !IS_CHERRYVIEW(dev_priv) &&
!IS_BROXTON(dev_priv))) !IS_BROXTON(dev_priv)))
return; return;
...@@ -664,7 +664,7 @@ static int edp_notify_handler(struct notifier_block *this, unsigned long code, ...@@ -664,7 +664,7 @@ static int edp_notify_handler(struct notifier_block *this, unsigned long code,
pps_lock(intel_dp); pps_lock(intel_dp);
if (IS_VALLEYVIEW(dev) || IS_CHERRYVIEW(dev)) { if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) {
enum pipe pipe = vlv_power_sequencer_pipe(intel_dp); enum pipe pipe = vlv_power_sequencer_pipe(intel_dp);
i915_reg_t pp_ctrl_reg, pp_div_reg; i915_reg_t pp_ctrl_reg, pp_div_reg;
u32 pp_div; u32 pp_div;
...@@ -692,7 +692,7 @@ static bool edp_have_panel_power(struct intel_dp *intel_dp) ...@@ -692,7 +692,7 @@ static bool edp_have_panel_power(struct intel_dp *intel_dp)
lockdep_assert_held(&dev_priv->pps_mutex); lockdep_assert_held(&dev_priv->pps_mutex);
if ((IS_VALLEYVIEW(dev) || IS_CHERRYVIEW(dev)) && if ((IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) &&
intel_dp->pps_pipe == INVALID_PIPE) intel_dp->pps_pipe == INVALID_PIPE)
return false; return false;
...@@ -706,7 +706,7 @@ static bool edp_have_panel_vdd(struct intel_dp *intel_dp) ...@@ -706,7 +706,7 @@ static bool edp_have_panel_vdd(struct intel_dp *intel_dp)
lockdep_assert_held(&dev_priv->pps_mutex); lockdep_assert_held(&dev_priv->pps_mutex);
if ((IS_VALLEYVIEW(dev) || IS_CHERRYVIEW(dev)) && if ((IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) &&
intel_dp->pps_pipe == INVALID_PIPE) intel_dp->pps_pipe == INVALID_PIPE)
return false; return false;
...@@ -1347,7 +1347,7 @@ intel_dp_set_clock(struct intel_encoder *encoder, ...@@ -1347,7 +1347,7 @@ intel_dp_set_clock(struct intel_encoder *encoder,
} else if (HAS_PCH_SPLIT(dev_priv)) { } else if (HAS_PCH_SPLIT(dev_priv)) {
divisor = pch_dpll; divisor = pch_dpll;
count = ARRAY_SIZE(pch_dpll); count = ARRAY_SIZE(pch_dpll);
} else if (IS_CHERRYVIEW(dev)) { } else if (IS_CHERRYVIEW(dev_priv)) {
divisor = chv_dpll; divisor = chv_dpll;
count = ARRAY_SIZE(chv_dpll); count = ARRAY_SIZE(chv_dpll);
} else if (IS_VALLEYVIEW(dev)) { } else if (IS_VALLEYVIEW(dev)) {
...@@ -1791,7 +1791,8 @@ static void intel_dp_prepare(struct intel_encoder *encoder, ...@@ -1791,7 +1791,8 @@ static void intel_dp_prepare(struct intel_encoder *encoder,
I915_WRITE(TRANS_DP_CTL(crtc->pipe), trans_dp); I915_WRITE(TRANS_DP_CTL(crtc->pipe), trans_dp);
} else { } else {
if (!HAS_PCH_SPLIT(dev_priv) && !IS_VALLEYVIEW(dev) && if (!HAS_PCH_SPLIT(dev_priv) && !IS_VALLEYVIEW(dev) &&
!IS_CHERRYVIEW(dev) && pipe_config->limited_color_range) !IS_CHERRYVIEW(dev_priv) &&
pipe_config->limited_color_range)
intel_dp->DP |= DP_COLOR_RANGE_16_235; intel_dp->DP |= DP_COLOR_RANGE_16_235;
if (adjusted_mode->flags & DRM_MODE_FLAG_PHSYNC) if (adjusted_mode->flags & DRM_MODE_FLAG_PHSYNC)
...@@ -1803,7 +1804,7 @@ static void intel_dp_prepare(struct intel_encoder *encoder, ...@@ -1803,7 +1804,7 @@ static void intel_dp_prepare(struct intel_encoder *encoder,
if (drm_dp_enhanced_frame_cap(intel_dp->dpcd)) if (drm_dp_enhanced_frame_cap(intel_dp->dpcd))
intel_dp->DP |= DP_ENHANCED_FRAMING; intel_dp->DP |= DP_ENHANCED_FRAMING;
if (IS_CHERRYVIEW(dev)) if (IS_CHERRYVIEW(dev_priv))
intel_dp->DP |= DP_PIPE_SELECT_CHV(crtc->pipe); intel_dp->DP |= DP_PIPE_SELECT_CHV(crtc->pipe);
else if (crtc->pipe == PIPE_B) else if (crtc->pipe == PIPE_B)
intel_dp->DP |= DP_PIPEB_SELECT; intel_dp->DP |= DP_PIPEB_SELECT;
...@@ -2459,7 +2460,7 @@ static bool intel_dp_get_hw_state(struct intel_encoder *encoder, ...@@ -2459,7 +2460,7 @@ static bool intel_dp_get_hw_state(struct intel_encoder *encoder,
DRM_DEBUG_KMS("No pipe for dp port 0x%x found\n", DRM_DEBUG_KMS("No pipe for dp port 0x%x found\n",
i915_mmio_reg_offset(intel_dp->output_reg)); i915_mmio_reg_offset(intel_dp->output_reg));
} else if (IS_CHERRYVIEW(dev)) { } else if (IS_CHERRYVIEW(dev_priv)) {
*pipe = DP_PORT_TO_PIPE_CHV(tmp); *pipe = DP_PORT_TO_PIPE_CHV(tmp);
} else { } else {
*pipe = PORT_TO_PIPE(tmp); *pipe = PORT_TO_PIPE(tmp);
...@@ -2681,7 +2682,7 @@ _intel_dp_set_link_train(struct intel_dp *intel_dp, ...@@ -2681,7 +2682,7 @@ _intel_dp_set_link_train(struct intel_dp *intel_dp,
} }
} else { } else {
if (IS_CHERRYVIEW(dev)) if (IS_CHERRYVIEW(dev_priv))
*DP &= ~DP_LINK_TRAIN_MASK_CHV; *DP &= ~DP_LINK_TRAIN_MASK_CHV;
else else
*DP &= ~DP_LINK_TRAIN_MASK; *DP &= ~DP_LINK_TRAIN_MASK;
...@@ -2697,7 +2698,7 @@ _intel_dp_set_link_train(struct intel_dp *intel_dp, ...@@ -2697,7 +2698,7 @@ _intel_dp_set_link_train(struct intel_dp *intel_dp,
*DP |= DP_LINK_TRAIN_PAT_2; *DP |= DP_LINK_TRAIN_PAT_2;
break; break;
case DP_TRAINING_PATTERN_3: case DP_TRAINING_PATTERN_3:
if (IS_CHERRYVIEW(dev)) { if (IS_CHERRYVIEW(dev_priv)) {
*DP |= DP_LINK_TRAIN_PAT_3_CHV; *DP |= DP_LINK_TRAIN_PAT_3_CHV;
} else { } else {
DRM_DEBUG_KMS("TPS3 not supported, using TPS2 instead\n"); DRM_DEBUG_KMS("TPS3 not supported, using TPS2 instead\n");
...@@ -2747,7 +2748,7 @@ static void intel_enable_dp(struct intel_encoder *encoder, ...@@ -2747,7 +2748,7 @@ static void intel_enable_dp(struct intel_encoder *encoder,
pps_lock(intel_dp); pps_lock(intel_dp);
if (IS_VALLEYVIEW(dev) || IS_CHERRYVIEW(dev)) if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv))
vlv_init_panel_power_sequencer(intel_dp); vlv_init_panel_power_sequencer(intel_dp);
intel_dp_enable_port(intel_dp, pipe_config); intel_dp_enable_port(intel_dp, pipe_config);
...@@ -2758,10 +2759,10 @@ static void intel_enable_dp(struct intel_encoder *encoder, ...@@ -2758,10 +2759,10 @@ static void intel_enable_dp(struct intel_encoder *encoder,
pps_unlock(intel_dp); pps_unlock(intel_dp);
if (IS_VALLEYVIEW(dev) || IS_CHERRYVIEW(dev)) { if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) {
unsigned int lane_mask = 0x0; unsigned int lane_mask = 0x0;
if (IS_CHERRYVIEW(dev)) if (IS_CHERRYVIEW(dev_priv))
lane_mask = intel_dp_unused_lane_mask(pipe_config->lane_count); lane_mask = intel_dp_unused_lane_mask(pipe_config->lane_count);
vlv_wait_port_ready(dev_priv, dp_to_dig_port(intel_dp), vlv_wait_port_ready(dev_priv, dp_to_dig_port(intel_dp),
...@@ -2987,7 +2988,7 @@ intel_dp_voltage_max(struct intel_dp *intel_dp) ...@@ -2987,7 +2988,7 @@ intel_dp_voltage_max(struct intel_dp *intel_dp)
if (dev_priv->vbt.edp.low_vswing && port == PORT_A) if (dev_priv->vbt.edp.low_vswing && port == PORT_A)
return DP_TRAIN_VOLTAGE_SWING_LEVEL_3; return DP_TRAIN_VOLTAGE_SWING_LEVEL_3;
return DP_TRAIN_VOLTAGE_SWING_LEVEL_2; return DP_TRAIN_VOLTAGE_SWING_LEVEL_2;
} else if (IS_VALLEYVIEW(dev) || IS_CHERRYVIEW(dev)) } else if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv))
return DP_TRAIN_VOLTAGE_SWING_LEVEL_3; return DP_TRAIN_VOLTAGE_SWING_LEVEL_3;
else if (IS_GEN7(dev) && port == PORT_A) else if (IS_GEN7(dev) && port == PORT_A)
return DP_TRAIN_VOLTAGE_SWING_LEVEL_2; return DP_TRAIN_VOLTAGE_SWING_LEVEL_2;
...@@ -3348,7 +3349,7 @@ intel_dp_set_signal_levels(struct intel_dp *intel_dp) ...@@ -3348,7 +3349,7 @@ intel_dp_set_signal_levels(struct intel_dp *intel_dp)
signal_levels = 0; signal_levels = 0;
else else
mask = DDI_BUF_EMP_MASK; mask = DDI_BUF_EMP_MASK;
} else if (IS_CHERRYVIEW(dev)) { } else if (IS_CHERRYVIEW(dev_priv)) {
signal_levels = chv_signal_levels(intel_dp); signal_levels = chv_signal_levels(intel_dp);
} else if (IS_VALLEYVIEW(dev)) { } else if (IS_VALLEYVIEW(dev)) {
signal_levels = vlv_signal_levels(intel_dp); signal_levels = vlv_signal_levels(intel_dp);
...@@ -3448,7 +3449,7 @@ intel_dp_link_down(struct intel_dp *intel_dp) ...@@ -3448,7 +3449,7 @@ intel_dp_link_down(struct intel_dp *intel_dp)
DP &= ~DP_LINK_TRAIN_MASK_CPT; DP &= ~DP_LINK_TRAIN_MASK_CPT;
DP |= DP_LINK_TRAIN_PAT_IDLE_CPT; DP |= DP_LINK_TRAIN_PAT_IDLE_CPT;
} else { } else {
if (IS_CHERRYVIEW(dev)) if (IS_CHERRYVIEW(dev_priv))
DP &= ~DP_LINK_TRAIN_MASK_CHV; DP &= ~DP_LINK_TRAIN_MASK_CHV;
else else
DP &= ~DP_LINK_TRAIN_MASK; DP &= ~DP_LINK_TRAIN_MASK;
...@@ -5085,7 +5086,7 @@ intel_dp_init_panel_power_sequencer_registers(struct drm_device *dev, ...@@ -5085,7 +5086,7 @@ intel_dp_init_panel_power_sequencer_registers(struct drm_device *dev,
/* Haswell doesn't have any port selection bits for the panel /* Haswell doesn't have any port selection bits for the panel
* power sequencer any more. */ * power sequencer any more. */
if (IS_VALLEYVIEW(dev) || IS_CHERRYVIEW(dev)) { if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) {
port_sel = PANEL_PORT_SELECT_VLV(port); port_sel = PANEL_PORT_SELECT_VLV(port);
} else if (HAS_PCH_IBX(dev_priv) || HAS_PCH_CPT(dev_priv)) { } else if (HAS_PCH_IBX(dev_priv) || HAS_PCH_CPT(dev_priv)) {
if (port == PORT_A) if (port == PORT_A)
...@@ -5114,7 +5115,9 @@ intel_dp_init_panel_power_sequencer_registers(struct drm_device *dev, ...@@ -5114,7 +5115,9 @@ intel_dp_init_panel_power_sequencer_registers(struct drm_device *dev,
static void intel_dp_pps_init(struct drm_device *dev, static void intel_dp_pps_init(struct drm_device *dev,
struct intel_dp *intel_dp) struct intel_dp *intel_dp)
{ {
if (IS_VALLEYVIEW(dev) || IS_CHERRYVIEW(dev)) { struct drm_i915_private *dev_priv = to_i915(dev);
if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) {
vlv_initial_power_sequencer_setup(intel_dp); vlv_initial_power_sequencer_setup(intel_dp);
} else { } else {
intel_dp_init_panel_power_sequencer(dev, intel_dp); intel_dp_init_panel_power_sequencer(dev, intel_dp);
...@@ -5584,7 +5587,7 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp, ...@@ -5584,7 +5587,7 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp,
} }
mutex_unlock(&dev->mode_config.mutex); mutex_unlock(&dev->mode_config.mutex);
if (IS_VALLEYVIEW(dev) || IS_CHERRYVIEW(dev)) { if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) {
intel_dp->edp_notifier.notifier_call = edp_notify_handler; intel_dp->edp_notifier.notifier_call = edp_notify_handler;
register_reboot_notifier(&intel_dp->edp_notifier); register_reboot_notifier(&intel_dp->edp_notifier);
...@@ -5593,7 +5596,7 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp, ...@@ -5593,7 +5596,7 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp,
* If the current pipe isn't valid, try the PPS pipe, and if that * If the current pipe isn't valid, try the PPS pipe, and if that
* fails just assume pipe A. * fails just assume pipe A.
*/ */
if (IS_CHERRYVIEW(dev)) if (IS_CHERRYVIEW(dev_priv))
pipe = DP_PORT_TO_PIPE_CHV(intel_dp->DP); pipe = DP_PORT_TO_PIPE_CHV(intel_dp->DP);
else else
pipe = PORT_TO_PIPE(intel_dp->DP); pipe = PORT_TO_PIPE(intel_dp->DP);
...@@ -5682,7 +5685,7 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port, ...@@ -5682,7 +5685,7 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
intel_encoder->type = INTEL_OUTPUT_EDP; intel_encoder->type = INTEL_OUTPUT_EDP;
/* eDP only on port B and/or C on vlv/chv */ /* eDP only on port B and/or C on vlv/chv */
if (WARN_ON((IS_VALLEYVIEW(dev) || IS_CHERRYVIEW(dev)) && if (WARN_ON((IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) &&
is_edp(intel_dp) && port != PORT_B && port != PORT_C)) is_edp(intel_dp) && port != PORT_B && port != PORT_C))
return false; return false;
...@@ -5792,7 +5795,7 @@ bool intel_dp_init(struct drm_device *dev, ...@@ -5792,7 +5795,7 @@ bool intel_dp_init(struct drm_device *dev,
intel_encoder->get_hw_state = intel_dp_get_hw_state; intel_encoder->get_hw_state = intel_dp_get_hw_state;
intel_encoder->get_config = intel_dp_get_config; intel_encoder->get_config = intel_dp_get_config;
intel_encoder->suspend = intel_dp_encoder_suspend; intel_encoder->suspend = intel_dp_encoder_suspend;
if (IS_CHERRYVIEW(dev)) { if (IS_CHERRYVIEW(dev_priv)) {
intel_encoder->pre_pll_enable = chv_dp_pre_pll_enable; intel_encoder->pre_pll_enable = chv_dp_pre_pll_enable;
intel_encoder->pre_enable = chv_pre_enable_dp; intel_encoder->pre_enable = chv_pre_enable_dp;
intel_encoder->enable = vlv_enable_dp; intel_encoder->enable = vlv_enable_dp;
...@@ -5815,7 +5818,7 @@ bool intel_dp_init(struct drm_device *dev, ...@@ -5815,7 +5818,7 @@ bool intel_dp_init(struct drm_device *dev,
intel_dig_port->max_lanes = 4; intel_dig_port->max_lanes = 4;
intel_encoder->type = INTEL_OUTPUT_DP; intel_encoder->type = INTEL_OUTPUT_DP;
if (IS_CHERRYVIEW(dev)) { if (IS_CHERRYVIEW(dev_priv)) {
if (port == PORT_D) if (port == PORT_D)
intel_encoder->crtc_mask = 1 << 2; intel_encoder->crtc_mask = 1 << 2;
else else
......
...@@ -740,7 +740,6 @@ static bool intel_dsi_get_hw_state(struct intel_encoder *encoder, ...@@ -740,7 +740,6 @@ static bool intel_dsi_get_hw_state(struct intel_encoder *encoder,
{ {
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
struct intel_dsi *intel_dsi = enc_to_intel_dsi(&encoder->base); struct intel_dsi *intel_dsi = enc_to_intel_dsi(&encoder->base);
struct drm_device *dev = encoder->base.dev;
enum intel_display_power_domain power_domain; enum intel_display_power_domain power_domain;
enum port port; enum port port;
bool active = false; bool active = false;
...@@ -770,7 +769,8 @@ static bool intel_dsi_get_hw_state(struct intel_encoder *encoder, ...@@ -770,7 +769,8 @@ static bool intel_dsi_get_hw_state(struct intel_encoder *encoder,
* bit in port C control register does not get set. As a * bit in port C control register does not get set. As a
* workaround, check pipe B conf instead. * workaround, check pipe B conf instead.
*/ */
if ((IS_VALLEYVIEW(dev) || IS_CHERRYVIEW(dev)) && port == PORT_C) if ((IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) &&
port == PORT_C)
enabled = I915_READ(PIPECONF(PIPE_B)) & PIPECONF_ENABLE; enabled = I915_READ(PIPECONF(PIPE_B)) & PIPECONF_ENABLE;
/* Try command mode if video mode not enabled */ /* Try command mode if video mode not enabled */
...@@ -1137,7 +1137,7 @@ static void intel_dsi_prepare(struct intel_encoder *intel_encoder, ...@@ -1137,7 +1137,7 @@ static void intel_dsi_prepare(struct intel_encoder *intel_encoder,
} }
for_each_dsi_port(port, intel_dsi->ports) { for_each_dsi_port(port, intel_dsi->ports) {
if (IS_VALLEYVIEW(dev) || IS_CHERRYVIEW(dev)) { if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) {
/* /*
* escape clock divider, 20MHz, shared for A and C. * escape clock divider, 20MHz, shared for A and C.
* device ready must be off when doing this! txclkesc? * device ready must be off when doing this! txclkesc?
...@@ -1449,7 +1449,7 @@ void intel_dsi_init(struct drm_device *dev) ...@@ -1449,7 +1449,7 @@ void intel_dsi_init(struct drm_device *dev)
if (!intel_bios_is_dsi_present(dev_priv, &port)) if (!intel_bios_is_dsi_present(dev_priv, &port))
return; return;
if (IS_VALLEYVIEW(dev) || IS_CHERRYVIEW(dev)) { if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) {
dev_priv->mipi_mmio_base = VLV_MIPI_BASE; dev_priv->mipi_mmio_base = VLV_MIPI_BASE;
} else if (IS_BROXTON(dev_priv)) { } else if (IS_BROXTON(dev_priv)) {
dev_priv->mipi_mmio_base = BXT_MIPI_BASE; dev_priv->mipi_mmio_base = BXT_MIPI_BASE;
......
...@@ -881,7 +881,7 @@ static void intel_hdmi_prepare(struct intel_encoder *encoder) ...@@ -881,7 +881,7 @@ static void intel_hdmi_prepare(struct intel_encoder *encoder)
if (HAS_PCH_CPT(dev_priv)) if (HAS_PCH_CPT(dev_priv))
hdmi_val |= SDVO_PIPE_SEL_CPT(crtc->pipe); hdmi_val |= SDVO_PIPE_SEL_CPT(crtc->pipe);
else if (IS_CHERRYVIEW(dev)) else if (IS_CHERRYVIEW(dev_priv))
hdmi_val |= SDVO_PIPE_SEL_CHV(crtc->pipe); hdmi_val |= SDVO_PIPE_SEL_CHV(crtc->pipe);
else else
hdmi_val |= SDVO_PIPE_SEL(crtc->pipe); hdmi_val |= SDVO_PIPE_SEL(crtc->pipe);
...@@ -913,7 +913,7 @@ static bool intel_hdmi_get_hw_state(struct intel_encoder *encoder, ...@@ -913,7 +913,7 @@ static bool intel_hdmi_get_hw_state(struct intel_encoder *encoder,
if (HAS_PCH_CPT(dev_priv)) if (HAS_PCH_CPT(dev_priv))
*pipe = PORT_TO_PIPE_CPT(tmp); *pipe = PORT_TO_PIPE_CPT(tmp);
else if (IS_CHERRYVIEW(dev)) else if (IS_CHERRYVIEW(dev_priv))
*pipe = SDVO_PORT_TO_PIPE_CHV(tmp); *pipe = SDVO_PORT_TO_PIPE_CHV(tmp);
else else
*pipe = PORT_TO_PIPE(tmp); *pipe = PORT_TO_PIPE(tmp);
...@@ -1885,7 +1885,7 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port, ...@@ -1885,7 +1885,7 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
BUG(); BUG();
} }
if (IS_VALLEYVIEW(dev) || IS_CHERRYVIEW(dev)) { if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) {
intel_hdmi->write_infoframe = vlv_write_infoframe; intel_hdmi->write_infoframe = vlv_write_infoframe;
intel_hdmi->set_infoframes = vlv_set_infoframes; intel_hdmi->set_infoframes = vlv_set_infoframes;
intel_hdmi->infoframe_enabled = vlv_infoframe_enabled; intel_hdmi->infoframe_enabled = vlv_infoframe_enabled;
...@@ -1959,7 +1959,7 @@ void intel_hdmi_init(struct drm_device *dev, ...@@ -1959,7 +1959,7 @@ void intel_hdmi_init(struct drm_device *dev,
} }
intel_encoder->get_hw_state = intel_hdmi_get_hw_state; intel_encoder->get_hw_state = intel_hdmi_get_hw_state;
intel_encoder->get_config = intel_hdmi_get_config; intel_encoder->get_config = intel_hdmi_get_config;
if (IS_CHERRYVIEW(dev)) { if (IS_CHERRYVIEW(dev_priv)) {
intel_encoder->pre_pll_enable = chv_hdmi_pre_pll_enable; intel_encoder->pre_pll_enable = chv_hdmi_pre_pll_enable;
intel_encoder->pre_enable = chv_hdmi_pre_enable; intel_encoder->pre_enable = chv_hdmi_pre_enable;
intel_encoder->enable = vlv_enable_hdmi; intel_encoder->enable = vlv_enable_hdmi;
...@@ -1982,7 +1982,7 @@ void intel_hdmi_init(struct drm_device *dev, ...@@ -1982,7 +1982,7 @@ void intel_hdmi_init(struct drm_device *dev,
intel_encoder->type = INTEL_OUTPUT_HDMI; intel_encoder->type = INTEL_OUTPUT_HDMI;
intel_encoder->port = port; intel_encoder->port = port;
if (IS_CHERRYVIEW(dev)) { if (IS_CHERRYVIEW(dev_priv)) {
if (port == PORT_D) if (port == PORT_D)
intel_encoder->crtc_mask = 1 << 2; intel_encoder->crtc_mask = 1 << 2;
else else
......
...@@ -635,7 +635,7 @@ int intel_setup_gmbus(struct drm_device *dev) ...@@ -635,7 +635,7 @@ int intel_setup_gmbus(struct drm_device *dev)
if (HAS_PCH_NOP(dev_priv)) if (HAS_PCH_NOP(dev_priv))
return 0; return 0;
if (IS_VALLEYVIEW(dev) || IS_CHERRYVIEW(dev)) if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv))
dev_priv->gpio_mmio_base = VLV_DISPLAY_BASE; dev_priv->gpio_mmio_base = VLV_DISPLAY_BASE;
else if (!HAS_GMCH_DISPLAY(dev_priv)) else if (!HAS_GMCH_DISPLAY(dev_priv))
dev_priv->gpio_mmio_base = dev_priv->gpio_mmio_base =
......
...@@ -322,7 +322,7 @@ void intel_set_memory_cxsr(struct drm_i915_private *dev_priv, bool enable) ...@@ -322,7 +322,7 @@ void intel_set_memory_cxsr(struct drm_i915_private *dev_priv, bool enable)
struct drm_device *dev = &dev_priv->drm; struct drm_device *dev = &dev_priv->drm;
u32 val; u32 val;
if (IS_VALLEYVIEW(dev) || IS_CHERRYVIEW(dev)) { if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) {
I915_WRITE(FW_BLC_SELF_VLV, enable ? FW_CSPWRDWNEN : 0); I915_WRITE(FW_BLC_SELF_VLV, enable ? FW_CSPWRDWNEN : 0);
POSTING_READ(FW_BLC_SELF_VLV); POSTING_READ(FW_BLC_SELF_VLV);
dev_priv->wm.vlv.cxsr = enable; dev_priv->wm.vlv.cxsr = enable;
...@@ -7768,7 +7768,7 @@ void intel_init_pm(struct drm_device *dev) ...@@ -7768,7 +7768,7 @@ void intel_init_pm(struct drm_device *dev)
DRM_DEBUG_KMS("Failed to read display plane latency. " DRM_DEBUG_KMS("Failed to read display plane latency. "
"Disable CxSR\n"); "Disable CxSR\n");
} }
} else if (IS_CHERRYVIEW(dev)) { } else if (IS_CHERRYVIEW(dev_priv)) {
vlv_setup_wm_latency(dev); vlv_setup_wm_latency(dev);
dev_priv->display.update_wm = vlv_update_wm; dev_priv->display.update_wm = vlv_update_wm;
} else if (IS_VALLEYVIEW(dev)) { } else if (IS_VALLEYVIEW(dev)) {
......
...@@ -354,7 +354,7 @@ static bool intel_psr_match_conditions(struct intel_dp *intel_dp) ...@@ -354,7 +354,7 @@ static bool intel_psr_match_conditions(struct intel_dp *intel_dp)
return false; return false;
} }
if ((IS_VALLEYVIEW(dev) || IS_CHERRYVIEW(dev)) && if ((IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) &&
!dev_priv->psr.link_standby) { !dev_priv->psr.link_standby) {
DRM_ERROR("PSR condition failed: Link off requested but not supported on this platform\n"); DRM_ERROR("PSR condition failed: Link off requested but not supported on this platform\n");
return false; return false;
...@@ -837,7 +837,7 @@ void intel_psr_init(struct drm_device *dev) ...@@ -837,7 +837,7 @@ void intel_psr_init(struct drm_device *dev)
if (IS_HASWELL(dev_priv) || IS_BROADWELL(dev_priv)) if (IS_HASWELL(dev_priv) || IS_BROADWELL(dev_priv))
/* HSW and BDW require workarounds that we don't implement. */ /* HSW and BDW require workarounds that we don't implement. */
dev_priv->psr.link_standby = false; dev_priv->psr.link_standby = false;
else if (IS_VALLEYVIEW(dev) || IS_CHERRYVIEW(dev)) else if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv))
/* On VLV and CHV only standby mode is supported. */ /* On VLV and CHV only standby mode is supported. */
dev_priv->psr.link_standby = true; dev_priv->psr.link_standby = true;
else else
......
...@@ -2598,7 +2598,7 @@ void intel_power_domains_init_hw(struct drm_i915_private *dev_priv, bool resume) ...@@ -2598,7 +2598,7 @@ void intel_power_domains_init_hw(struct drm_i915_private *dev_priv, bool resume)
skl_display_core_init(dev_priv, resume); skl_display_core_init(dev_priv, resume);
} else if (IS_BROXTON(dev_priv)) { } else if (IS_BROXTON(dev_priv)) {
bxt_display_core_init(dev_priv, resume); bxt_display_core_init(dev_priv, resume);
} else if (IS_CHERRYVIEW(dev)) { } else if (IS_CHERRYVIEW(dev_priv)) {
mutex_lock(&power_domains->lock); mutex_lock(&power_domains->lock);
chv_phy_control_init(dev_priv); chv_phy_control_init(dev_priv);
mutex_unlock(&power_domains->lock); mutex_unlock(&power_domains->lock);
......
...@@ -450,7 +450,7 @@ vlv_update_plane(struct drm_plane *dplane, ...@@ -450,7 +450,7 @@ vlv_update_plane(struct drm_plane *dplane,
if (key->flags & I915_SET_COLORKEY_SOURCE) if (key->flags & I915_SET_COLORKEY_SOURCE)
sprctl |= SP_SOURCE_KEY; sprctl |= SP_SOURCE_KEY;
if (IS_CHERRYVIEW(dev) && pipe == PIPE_B) if (IS_CHERRYVIEW(dev_priv) && pipe == PIPE_B)
chv_update_csc(intel_plane, fb->pixel_format); chv_update_csc(intel_plane, fb->pixel_format);
I915_WRITE(SPSTRIDE(pipe, plane), fb->pitches[0]); I915_WRITE(SPSTRIDE(pipe, plane), fb->pitches[0]);
...@@ -944,6 +944,7 @@ intel_check_sprite_plane(struct drm_plane *plane, ...@@ -944,6 +944,7 @@ intel_check_sprite_plane(struct drm_plane *plane,
int intel_sprite_set_colorkey(struct drm_device *dev, void *data, int intel_sprite_set_colorkey(struct drm_device *dev, void *data,
struct drm_file *file_priv) struct drm_file *file_priv)
{ {
struct drm_i915_private *dev_priv = to_i915(dev);
struct drm_intel_sprite_colorkey *set = data; struct drm_intel_sprite_colorkey *set = data;
struct drm_plane *plane; struct drm_plane *plane;
struct drm_plane_state *plane_state; struct drm_plane_state *plane_state;
...@@ -955,7 +956,7 @@ int intel_sprite_set_colorkey(struct drm_device *dev, void *data, ...@@ -955,7 +956,7 @@ int intel_sprite_set_colorkey(struct drm_device *dev, void *data,
if ((set->flags & (I915_SET_COLORKEY_DESTINATION | I915_SET_COLORKEY_SOURCE)) == (I915_SET_COLORKEY_DESTINATION | I915_SET_COLORKEY_SOURCE)) if ((set->flags & (I915_SET_COLORKEY_DESTINATION | I915_SET_COLORKEY_SOURCE)) == (I915_SET_COLORKEY_DESTINATION | I915_SET_COLORKEY_SOURCE))
return -EINVAL; return -EINVAL;
if ((IS_VALLEYVIEW(dev) || IS_CHERRYVIEW(dev)) && if ((IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) &&
set->flags & I915_SET_COLORKEY_DESTINATION) set->flags & I915_SET_COLORKEY_DESTINATION)
return -EINVAL; return -EINVAL;
...@@ -1042,6 +1043,7 @@ static uint32_t skl_plane_formats[] = { ...@@ -1042,6 +1043,7 @@ static uint32_t skl_plane_formats[] = {
int int
intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane) intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane)
{ {
struct drm_i915_private *dev_priv = to_i915(dev);
struct intel_plane *intel_plane = NULL; struct intel_plane *intel_plane = NULL;
struct intel_plane_state *state = NULL; struct intel_plane_state *state = NULL;
unsigned long possible_crtcs; unsigned long possible_crtcs;
...@@ -1084,7 +1086,7 @@ intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane) ...@@ -1084,7 +1086,7 @@ intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane)
case 7: case 7:
case 8: case 8:
if (IS_IVYBRIDGE(to_i915(dev))) { if (IS_IVYBRIDGE(dev_priv)) {
intel_plane->can_scale = true; intel_plane->can_scale = true;
intel_plane->max_downscale = 2; intel_plane->max_downscale = 2;
} else { } else {
...@@ -1092,7 +1094,7 @@ intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane) ...@@ -1092,7 +1094,7 @@ intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane)
intel_plane->max_downscale = 1; intel_plane->max_downscale = 1;
} }
if (IS_VALLEYVIEW(dev) || IS_CHERRYVIEW(dev)) { if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) {
intel_plane->update_plane = vlv_update_plane; intel_plane->update_plane = vlv_update_plane;
intel_plane->disable_plane = vlv_disable_plane; intel_plane->disable_plane = vlv_disable_plane;
......
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