[Intel-gfx] [PATCH] drm/i915: drop ironlake_ prefix from edp panel/backlight functions
Jani Nikula
jani.nikula at intel.com
Fri Jan 17 15:10:08 CET 2014
On Fri, 17 Jan 2014, Daniel Vetter <daniel.vetter at ffwll.ch> wrote:
> They now also work on vlv, which has the regs somewhere else. And
> daring a glance into the looking glass it seems like this
> functionality will continue to work the same for the next few hardware
> platforms.
>
> So it's better to just remove that misleading prefix and have a bit
> shorter code for better readability.
>
> The only exceptions are the panel/backlight functions shared with
> intel_ddi.c, those get an intel_ prefix.
>
> While at it make the vdd_on/off functions static.
>
> And one straggler was missing the edp_ in the name, so make everything
> neatly OCD.
>
Reviewed-by: Jani Nikula <jani.nikula at intel.com>
> Cc: Paulo Zanoni <paulo.r.zanoni at intel.com>
> Cc: Jani Nikula <jani.nikula at intel.com>
> Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
> ---
> drivers/gpu/drm/i915/intel_ddi.c | 8 ++--
> drivers/gpu/drm/i915/intel_dp.c | 100 ++++++++++++++++++++-------------------
> drivers/gpu/drm/i915/intel_drv.h | 10 ++--
> 3 files changed, 59 insertions(+), 59 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
> index 74749c6f897e..9d2b7bcbbf58 100644
> --- a/drivers/gpu/drm/i915/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/intel_ddi.c
> @@ -1200,7 +1200,7 @@ static void intel_ddi_pre_enable(struct intel_encoder *intel_encoder)
>
> if (type == INTEL_OUTPUT_EDP) {
> struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
> - ironlake_edp_panel_on(intel_dp);
> + intel_edp_panel_on(intel_dp);
> }
>
> WARN_ON(intel_crtc->ddi_pll_sel == PORT_CLK_SEL_NONE);
> @@ -1245,7 +1245,7 @@ static void intel_ddi_post_disable(struct intel_encoder *intel_encoder)
> struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
>
> intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_OFF);
> - ironlake_edp_panel_off(intel_dp);
> + intel_edp_panel_off(intel_dp);
> }
>
> I915_WRITE(PORT_CLK_SEL(port), PORT_CLK_SEL_NONE);
> @@ -1280,7 +1280,7 @@ static void intel_enable_ddi(struct intel_encoder *intel_encoder)
> if (port == PORT_A)
> intel_dp_stop_link_train(intel_dp);
>
> - ironlake_edp_backlight_on(intel_dp);
> + intel_edp_backlight_on(intel_dp);
> intel_edp_psr_enable(intel_dp);
> }
>
> @@ -1313,7 +1313,7 @@ static void intel_disable_ddi(struct intel_encoder *intel_encoder)
> struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
>
> intel_edp_psr_disable(intel_dp);
> - ironlake_edp_backlight_off(intel_dp);
> + intel_edp_backlight_off(intel_dp);
> }
> }
>
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index 251d179ebedb..8b190aa51ec2 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -91,6 +91,8 @@ static struct intel_dp *intel_attached_dp(struct drm_connector *connector)
> }
>
> static void intel_dp_link_down(struct intel_dp *intel_dp);
> +static void edp_panel_vdd_on(struct intel_dp *intel_dp);
> +static void edp_panel_vdd_off(struct intel_dp *intel_dp, bool sync);
>
> static int
> intel_dp_max_link_bw(struct intel_dp *intel_dp)
> @@ -294,7 +296,7 @@ static u32 _pp_stat_reg(struct intel_dp *intel_dp)
> return VLV_PIPE_PP_STATUS(vlv_power_sequencer_pipe(intel_dp));
> }
>
> -static bool ironlake_edp_have_panel_power(struct intel_dp *intel_dp)
> +static bool edp_have_panel_power(struct intel_dp *intel_dp)
> {
> struct drm_device *dev = intel_dp_to_dev(intel_dp);
> struct drm_i915_private *dev_priv = dev->dev_private;
> @@ -302,7 +304,7 @@ static bool ironlake_edp_have_panel_power(struct intel_dp *intel_dp)
> return (I915_READ(_pp_stat_reg(intel_dp)) & PP_ON) != 0;
> }
>
> -static bool ironlake_edp_have_panel_vdd(struct intel_dp *intel_dp)
> +static bool edp_have_panel_vdd(struct intel_dp *intel_dp)
> {
> struct drm_device *dev = intel_dp_to_dev(intel_dp);
> struct drm_i915_private *dev_priv = dev->dev_private;
> @@ -319,7 +321,7 @@ intel_dp_check_edp(struct intel_dp *intel_dp)
> if (!is_edp(intel_dp))
> return;
>
> - if (!ironlake_edp_have_panel_power(intel_dp) && !ironlake_edp_have_panel_vdd(intel_dp)) {
> + if (!edp_have_panel_power(intel_dp) && !edp_have_panel_vdd(intel_dp)) {
> WARN(1, "eDP powered off while attempting aux channel communication.\n");
> DRM_DEBUG_KMS("Status 0x%08x Control 0x%08x\n",
> I915_READ(_pp_stat_reg(intel_dp)),
> @@ -629,7 +631,7 @@ intel_dp_i2c_aux_ch(struct i2c_adapter *adapter, int mode,
> int reply_bytes;
> int ret;
>
> - ironlake_edp_panel_vdd_on(intel_dp);
> + edp_panel_vdd_on(intel_dp);
> intel_dp_check_edp(intel_dp);
> /* Set up the command byte */
> if (mode & MODE_I2C_READ)
> @@ -732,7 +734,7 @@ intel_dp_i2c_aux_ch(struct i2c_adapter *adapter, int mode,
> ret = -EREMOTEIO;
>
> out:
> - ironlake_edp_panel_vdd_off(intel_dp, false);
> + edp_panel_vdd_off(intel_dp, false);
> return ret;
> }
>
> @@ -1016,7 +1018,7 @@ static void intel_dp_mode_set(struct intel_encoder *encoder)
> #define IDLE_CYCLE_MASK (PP_ON | 0 | PP_SEQUENCE_MASK | PP_CYCLE_DELAY_ACTIVE | PP_SEQUENCE_STATE_MASK)
> #define IDLE_CYCLE_VALUE (0 | 0 | PP_SEQUENCE_NONE | 0 | PP_SEQUENCE_STATE_OFF_IDLE)
>
> -static void ironlake_wait_panel_status(struct intel_dp *intel_dp,
> +static void wait_panel_status(struct intel_dp *intel_dp,
> u32 mask,
> u32 value)
> {
> @@ -1041,19 +1043,19 @@ static void ironlake_wait_panel_status(struct intel_dp *intel_dp,
> DRM_DEBUG_KMS("Wait complete\n");
> }
>
> -static void ironlake_wait_panel_on(struct intel_dp *intel_dp)
> +static void wait_panel_on(struct intel_dp *intel_dp)
> {
> DRM_DEBUG_KMS("Wait for panel power on\n");
> - ironlake_wait_panel_status(intel_dp, IDLE_ON_MASK, IDLE_ON_VALUE);
> + wait_panel_status(intel_dp, IDLE_ON_MASK, IDLE_ON_VALUE);
> }
>
> -static void ironlake_wait_panel_off(struct intel_dp *intel_dp)
> +static void wait_panel_off(struct intel_dp *intel_dp)
> {
> DRM_DEBUG_KMS("Wait for panel power off time\n");
> - ironlake_wait_panel_status(intel_dp, IDLE_OFF_MASK, IDLE_OFF_VALUE);
> + wait_panel_status(intel_dp, IDLE_OFF_MASK, IDLE_OFF_VALUE);
> }
>
> -static void ironlake_wait_panel_power_cycle(struct intel_dp *intel_dp)
> +static void wait_panel_power_cycle(struct intel_dp *intel_dp)
> {
> DRM_DEBUG_KMS("Wait for panel power cycle\n");
>
> @@ -1062,16 +1064,16 @@ static void ironlake_wait_panel_power_cycle(struct intel_dp *intel_dp)
> wait_remaining_ms_from_jiffies(intel_dp->last_power_cycle,
> intel_dp->panel_power_cycle_delay);
>
> - ironlake_wait_panel_status(intel_dp, IDLE_CYCLE_MASK, IDLE_CYCLE_VALUE);
> + wait_panel_status(intel_dp, IDLE_CYCLE_MASK, IDLE_CYCLE_VALUE);
> }
>
> -static void ironlake_wait_backlight_on(struct intel_dp *intel_dp)
> +static void wait_backlight_on(struct intel_dp *intel_dp)
> {
> wait_remaining_ms_from_jiffies(intel_dp->last_power_on,
> intel_dp->backlight_on_delay);
> }
>
> -static void ironlake_edp_wait_backlight_off(struct intel_dp *intel_dp)
> +static void edp_wait_backlight_off(struct intel_dp *intel_dp)
> {
> wait_remaining_ms_from_jiffies(intel_dp->last_backlight_off,
> intel_dp->backlight_off_delay);
> @@ -1093,7 +1095,7 @@ static u32 ironlake_get_pp_control(struct intel_dp *intel_dp)
> return control;
> }
>
> -void ironlake_edp_panel_vdd_on(struct intel_dp *intel_dp)
> +static void edp_panel_vdd_on(struct intel_dp *intel_dp)
> {
> struct drm_device *dev = intel_dp_to_dev(intel_dp);
> struct drm_i915_private *dev_priv = dev->dev_private;
> @@ -1108,15 +1110,15 @@ void ironlake_edp_panel_vdd_on(struct intel_dp *intel_dp)
>
> intel_dp->want_panel_vdd = true;
>
> - if (ironlake_edp_have_panel_vdd(intel_dp))
> + if (edp_have_panel_vdd(intel_dp))
> return;
>
> intel_runtime_pm_get(dev_priv);
>
> DRM_DEBUG_KMS("Turning eDP VDD on\n");
>
> - if (!ironlake_edp_have_panel_power(intel_dp))
> - ironlake_wait_panel_power_cycle(intel_dp);
> + if (!edp_have_panel_power(intel_dp))
> + wait_panel_power_cycle(intel_dp);
>
> pp = ironlake_get_pp_control(intel_dp);
> pp |= EDP_FORCE_VDD;
> @@ -1131,13 +1133,13 @@ void ironlake_edp_panel_vdd_on(struct intel_dp *intel_dp)
> /*
> * If the panel wasn't on, delay before accessing aux channel
> */
> - if (!ironlake_edp_have_panel_power(intel_dp)) {
> + if (!edp_have_panel_power(intel_dp)) {
> DRM_DEBUG_KMS("eDP was not running\n");
> msleep(intel_dp->panel_power_up_delay);
> }
> }
>
> -static void ironlake_panel_vdd_off_sync(struct intel_dp *intel_dp)
> +static void edp_panel_vdd_off_sync(struct intel_dp *intel_dp)
> {
> struct drm_device *dev = intel_dp_to_dev(intel_dp);
> struct drm_i915_private *dev_priv = dev->dev_private;
> @@ -1146,7 +1148,7 @@ static void ironlake_panel_vdd_off_sync(struct intel_dp *intel_dp)
>
> WARN_ON(!mutex_is_locked(&dev->mode_config.mutex));
>
> - if (!intel_dp->want_panel_vdd && ironlake_edp_have_panel_vdd(intel_dp)) {
> + if (!intel_dp->want_panel_vdd && edp_have_panel_vdd(intel_dp)) {
> DRM_DEBUG_KMS("Turning eDP VDD off\n");
>
> pp = ironlake_get_pp_control(intel_dp);
> @@ -1169,18 +1171,18 @@ static void ironlake_panel_vdd_off_sync(struct intel_dp *intel_dp)
> }
> }
>
> -static void ironlake_panel_vdd_work(struct work_struct *__work)
> +static void edp_panel_vdd_work(struct work_struct *__work)
> {
> struct intel_dp *intel_dp = container_of(to_delayed_work(__work),
> struct intel_dp, panel_vdd_work);
> struct drm_device *dev = intel_dp_to_dev(intel_dp);
>
> mutex_lock(&dev->mode_config.mutex);
> - ironlake_panel_vdd_off_sync(intel_dp);
> + edp_panel_vdd_off_sync(intel_dp);
> mutex_unlock(&dev->mode_config.mutex);
> }
>
> -void ironlake_edp_panel_vdd_off(struct intel_dp *intel_dp, bool sync)
> +static void edp_panel_vdd_off(struct intel_dp *intel_dp, bool sync)
> {
> if (!is_edp(intel_dp))
> return;
> @@ -1190,7 +1192,7 @@ void ironlake_edp_panel_vdd_off(struct intel_dp *intel_dp, bool sync)
> intel_dp->want_panel_vdd = false;
>
> if (sync) {
> - ironlake_panel_vdd_off_sync(intel_dp);
> + edp_panel_vdd_off_sync(intel_dp);
> } else {
> /*
> * Queue the timer to fire a long
> @@ -1202,7 +1204,7 @@ void ironlake_edp_panel_vdd_off(struct intel_dp *intel_dp, bool sync)
> }
> }
>
> -void ironlake_edp_panel_on(struct intel_dp *intel_dp)
> +void intel_edp_panel_on(struct intel_dp *intel_dp)
> {
> struct drm_device *dev = intel_dp_to_dev(intel_dp);
> struct drm_i915_private *dev_priv = dev->dev_private;
> @@ -1214,12 +1216,12 @@ void ironlake_edp_panel_on(struct intel_dp *intel_dp)
>
> DRM_DEBUG_KMS("Turn eDP power on\n");
>
> - if (ironlake_edp_have_panel_power(intel_dp)) {
> + if (edp_have_panel_power(intel_dp)) {
> DRM_DEBUG_KMS("eDP power already on\n");
> return;
> }
>
> - ironlake_wait_panel_power_cycle(intel_dp);
> + wait_panel_power_cycle(intel_dp);
>
> pp_ctrl_reg = _pp_ctrl_reg(intel_dp);
> pp = ironlake_get_pp_control(intel_dp);
> @@ -1237,7 +1239,7 @@ void ironlake_edp_panel_on(struct intel_dp *intel_dp)
> I915_WRITE(pp_ctrl_reg, pp);
> POSTING_READ(pp_ctrl_reg);
>
> - ironlake_wait_panel_on(intel_dp);
> + wait_panel_on(intel_dp);
> intel_dp->last_power_on = jiffies;
>
> if (IS_GEN5(dev)) {
> @@ -1247,7 +1249,7 @@ void ironlake_edp_panel_on(struct intel_dp *intel_dp)
> }
> }
>
> -void ironlake_edp_panel_off(struct intel_dp *intel_dp)
> +void intel_edp_panel_off(struct intel_dp *intel_dp)
> {
> struct drm_device *dev = intel_dp_to_dev(intel_dp);
> struct drm_i915_private *dev_priv = dev->dev_private;
> @@ -1259,7 +1261,7 @@ void ironlake_edp_panel_off(struct intel_dp *intel_dp)
>
> DRM_DEBUG_KMS("Turn eDP power off\n");
>
> - ironlake_edp_wait_backlight_off(intel_dp);
> + edp_wait_backlight_off(intel_dp);
>
> pp = ironlake_get_pp_control(intel_dp);
> /* We need to switch off panel power _and_ force vdd, for otherwise some
> @@ -1272,10 +1274,10 @@ void ironlake_edp_panel_off(struct intel_dp *intel_dp)
> POSTING_READ(pp_ctrl_reg);
>
> intel_dp->last_power_cycle = jiffies;
> - ironlake_wait_panel_off(intel_dp);
> + wait_panel_off(intel_dp);
> }
>
> -void ironlake_edp_backlight_on(struct intel_dp *intel_dp)
> +void intel_edp_backlight_on(struct intel_dp *intel_dp)
> {
> struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
> struct drm_device *dev = intel_dig_port->base.base.dev;
> @@ -1293,7 +1295,7 @@ void ironlake_edp_backlight_on(struct intel_dp *intel_dp)
> * link. So delay a bit to make sure the image is solid before
> * allowing it to appear.
> */
> - ironlake_wait_backlight_on(intel_dp);
> + wait_backlight_on(intel_dp);
> pp = ironlake_get_pp_control(intel_dp);
> pp |= EDP_BLC_ENABLE;
>
> @@ -1305,7 +1307,7 @@ void ironlake_edp_backlight_on(struct intel_dp *intel_dp)
> intel_panel_enable_backlight(intel_dp->attached_connector);
> }
>
> -void ironlake_edp_backlight_off(struct intel_dp *intel_dp)
> +void intel_edp_backlight_off(struct intel_dp *intel_dp)
> {
> struct drm_device *dev = intel_dp_to_dev(intel_dp);
> struct drm_i915_private *dev_priv = dev->dev_private;
> @@ -1797,9 +1799,9 @@ static void intel_disable_dp(struct intel_encoder *encoder)
>
> /* Make sure the panel is off before trying to change the mode. But also
> * ensure that we have vdd while we switch off the panel. */
> - ironlake_edp_backlight_off(intel_dp);
> + intel_edp_backlight_off(intel_dp);
> intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_OFF);
> - ironlake_edp_panel_off(intel_dp);
> + intel_edp_panel_off(intel_dp);
>
> /* cpu edp my only be disable _after_ the cpu pipe/plane is disabled. */
> if (!(port == PORT_A || IS_VALLEYVIEW(dev)))
> @@ -1829,11 +1831,11 @@ static void intel_enable_dp(struct intel_encoder *encoder)
> if (WARN_ON(dp_reg & DP_PORT_EN))
> return;
>
> - ironlake_edp_panel_vdd_on(intel_dp);
> + edp_panel_vdd_on(intel_dp);
> intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_ON);
> intel_dp_start_link_train(intel_dp);
> - ironlake_edp_panel_on(intel_dp);
> - ironlake_edp_panel_vdd_off(intel_dp, true);
> + intel_edp_panel_on(intel_dp);
> + edp_panel_vdd_off(intel_dp, true);
> intel_dp_complete_link_train(intel_dp);
> intel_dp_stop_link_train(intel_dp);
> }
> @@ -1843,14 +1845,14 @@ static void g4x_enable_dp(struct intel_encoder *encoder)
> struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base);
>
> intel_enable_dp(encoder);
> - ironlake_edp_backlight_on(intel_dp);
> + intel_edp_backlight_on(intel_dp);
> }
>
> static void vlv_enable_dp(struct intel_encoder *encoder)
> {
> struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base);
>
> - ironlake_edp_backlight_on(intel_dp);
> + intel_edp_backlight_on(intel_dp);
> }
>
> static void g4x_pre_enable_dp(struct intel_encoder *encoder)
> @@ -2853,7 +2855,7 @@ intel_dp_probe_oui(struct intel_dp *intel_dp)
> if (!(intel_dp->dpcd[DP_DOWN_STREAM_PORT_COUNT] & DP_OUI_SUPPORT))
> return;
>
> - ironlake_edp_panel_vdd_on(intel_dp);
> + edp_panel_vdd_on(intel_dp);
>
> if (intel_dp_aux_native_read_retry(intel_dp, DP_SINK_OUI, buf, 3))
> DRM_DEBUG_KMS("Sink OUI: %02hx%02hx%02hx\n",
> @@ -2863,7 +2865,7 @@ intel_dp_probe_oui(struct intel_dp *intel_dp)
> DRM_DEBUG_KMS("Branch OUI: %02hx%02hx%02hx\n",
> buf[0], buf[1], buf[2]);
>
> - ironlake_edp_panel_vdd_off(intel_dp, false);
> + edp_panel_vdd_off(intel_dp, false);
> }
>
> static bool
> @@ -3293,7 +3295,7 @@ void intel_dp_encoder_destroy(struct drm_encoder *encoder)
> if (is_edp(intel_dp)) {
> cancel_delayed_work_sync(&intel_dp->panel_vdd_work);
> mutex_lock(&dev->mode_config.mutex);
> - ironlake_panel_vdd_off_sync(intel_dp);
> + edp_panel_vdd_off_sync(intel_dp);
> mutex_unlock(&dev->mode_config.mutex);
> }
> kfree(intel_dig_port);
> @@ -3568,9 +3570,9 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp,
> return true;
>
> /* Cache DPCD and EDID for edp. */
> - ironlake_edp_panel_vdd_on(intel_dp);
> + edp_panel_vdd_on(intel_dp);
> has_dpcd = intel_dp_get_dpcd(intel_dp);
> - ironlake_edp_panel_vdd_off(intel_dp, false);
> + edp_panel_vdd_off(intel_dp, false);
>
> if (has_dpcd) {
> if (intel_dp->dpcd[DP_DPCD_REV] >= 0x11)
> @@ -3665,7 +3667,7 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
> connector->doublescan_allowed = 0;
>
> INIT_DELAYED_WORK(&intel_dp->panel_vdd_work,
> - ironlake_panel_vdd_work);
> + edp_panel_vdd_work);
>
> intel_connector_attach_encoder(intel_connector, intel_encoder);
> drm_sysfs_connector_add(connector);
> @@ -3731,7 +3733,7 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
> if (is_edp(intel_dp)) {
> cancel_delayed_work_sync(&intel_dp->panel_vdd_work);
> mutex_lock(&dev->mode_config.mutex);
> - ironlake_panel_vdd_off_sync(intel_dp);
> + edp_panel_vdd_off_sync(intel_dp);
> mutex_unlock(&dev->mode_config.mutex);
> }
> drm_sysfs_connector_remove(connector);
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index d3360b0905d0..2b72b1d6b847 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -729,12 +729,10 @@ void intel_dp_check_link_status(struct intel_dp *intel_dp);
> bool intel_dp_compute_config(struct intel_encoder *encoder,
> struct intel_crtc_config *pipe_config);
> bool intel_dp_is_edp(struct drm_device *dev, enum port port);
> -void ironlake_edp_backlight_on(struct intel_dp *intel_dp);
> -void ironlake_edp_backlight_off(struct intel_dp *intel_dp);
> -void ironlake_edp_panel_on(struct intel_dp *intel_dp);
> -void ironlake_edp_panel_off(struct intel_dp *intel_dp);
> -void ironlake_edp_panel_vdd_on(struct intel_dp *intel_dp);
> -void ironlake_edp_panel_vdd_off(struct intel_dp *intel_dp, bool sync);
> +void intel_edp_backlight_on(struct intel_dp *intel_dp);
> +void intel_edp_backlight_off(struct intel_dp *intel_dp);
> +void intel_edp_panel_on(struct intel_dp *intel_dp);
> +void intel_edp_panel_off(struct intel_dp *intel_dp);
> void intel_edp_psr_enable(struct intel_dp *intel_dp);
> void intel_edp_psr_disable(struct intel_dp *intel_dp);
> void intel_edp_psr_update(struct drm_device *dev);
> --
> 1.8.5.2
>
--
Jani Nikula, Intel Open Source Technology Center
More information about the Intel-gfx
mailing list