Commit 4be73780 authored by Daniel Vetter's avatar Daniel Vetter

drm/i915: drop ironlake_ prefix from edp panel/backlight functions

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.

Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent dce56b3c
...@@ -1200,7 +1200,7 @@ static void intel_ddi_pre_enable(struct intel_encoder *intel_encoder) ...@@ -1200,7 +1200,7 @@ static void intel_ddi_pre_enable(struct intel_encoder *intel_encoder)
if (type == INTEL_OUTPUT_EDP) { if (type == INTEL_OUTPUT_EDP) {
struct intel_dp *intel_dp = enc_to_intel_dp(encoder); 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); WARN_ON(intel_crtc->ddi_pll_sel == PORT_CLK_SEL_NONE);
...@@ -1244,7 +1244,7 @@ static void intel_ddi_post_disable(struct intel_encoder *intel_encoder) ...@@ -1244,7 +1244,7 @@ static void intel_ddi_post_disable(struct intel_encoder *intel_encoder)
if (type == INTEL_OUTPUT_DISPLAYPORT || type == INTEL_OUTPUT_EDP) { if (type == INTEL_OUTPUT_DISPLAYPORT || type == INTEL_OUTPUT_EDP) {
struct intel_dp *intel_dp = enc_to_intel_dp(encoder); struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_OFF); 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); I915_WRITE(PORT_CLK_SEL(port), PORT_CLK_SEL_NONE);
...@@ -1279,7 +1279,7 @@ static void intel_enable_ddi(struct intel_encoder *intel_encoder) ...@@ -1279,7 +1279,7 @@ static void intel_enable_ddi(struct intel_encoder *intel_encoder)
if (port == PORT_A) if (port == PORT_A)
intel_dp_stop_link_train(intel_dp); 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); intel_edp_psr_enable(intel_dp);
} }
...@@ -1312,7 +1312,7 @@ static void intel_disable_ddi(struct intel_encoder *intel_encoder) ...@@ -1312,7 +1312,7 @@ static void intel_disable_ddi(struct intel_encoder *intel_encoder)
struct intel_dp *intel_dp = enc_to_intel_dp(encoder); struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
intel_edp_psr_disable(intel_dp); intel_edp_psr_disable(intel_dp);
ironlake_edp_backlight_off(intel_dp); intel_edp_backlight_off(intel_dp);
} }
} }
......
...@@ -91,6 +91,8 @@ static struct intel_dp *intel_attached_dp(struct drm_connector *connector) ...@@ -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 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 static int
intel_dp_max_link_bw(struct intel_dp *intel_dp) intel_dp_max_link_bw(struct intel_dp *intel_dp)
...@@ -294,7 +296,7 @@ static u32 _pp_stat_reg(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)); 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_device *dev = intel_dp_to_dev(intel_dp);
struct drm_i915_private *dev_priv = dev->dev_private; 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) ...@@ -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; 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_device *dev = intel_dp_to_dev(intel_dp);
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
...@@ -319,7 +321,7 @@ intel_dp_check_edp(struct intel_dp *intel_dp) ...@@ -319,7 +321,7 @@ intel_dp_check_edp(struct intel_dp *intel_dp)
if (!is_edp(intel_dp)) if (!is_edp(intel_dp))
return; 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"); WARN(1, "eDP powered off while attempting aux channel communication.\n");
DRM_DEBUG_KMS("Status 0x%08x Control 0x%08x\n", DRM_DEBUG_KMS("Status 0x%08x Control 0x%08x\n",
I915_READ(_pp_stat_reg(intel_dp)), I915_READ(_pp_stat_reg(intel_dp)),
...@@ -630,7 +632,7 @@ intel_dp_i2c_aux_ch(struct i2c_adapter *adapter, int mode, ...@@ -630,7 +632,7 @@ intel_dp_i2c_aux_ch(struct i2c_adapter *adapter, int mode,
int reply_bytes; int reply_bytes;
int ret; int ret;
ironlake_edp_panel_vdd_on(intel_dp); edp_panel_vdd_on(intel_dp);
intel_dp_check_edp(intel_dp); intel_dp_check_edp(intel_dp);
/* Set up the command byte */ /* Set up the command byte */
if (mode & MODE_I2C_READ) if (mode & MODE_I2C_READ)
...@@ -733,7 +735,7 @@ intel_dp_i2c_aux_ch(struct i2c_adapter *adapter, int mode, ...@@ -733,7 +735,7 @@ intel_dp_i2c_aux_ch(struct i2c_adapter *adapter, int mode,
ret = -EREMOTEIO; ret = -EREMOTEIO;
out: out:
ironlake_edp_panel_vdd_off(intel_dp, false); edp_panel_vdd_off(intel_dp, false);
return ret; return ret;
} }
...@@ -1017,7 +1019,7 @@ static void intel_dp_mode_set(struct intel_encoder *encoder) ...@@ -1017,7 +1019,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_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) #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 mask,
u32 value) u32 value)
{ {
...@@ -1042,19 +1044,19 @@ static void ironlake_wait_panel_status(struct intel_dp *intel_dp, ...@@ -1042,19 +1044,19 @@ static void ironlake_wait_panel_status(struct intel_dp *intel_dp,
DRM_DEBUG_KMS("Wait complete\n"); 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"); 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"); 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"); DRM_DEBUG_KMS("Wait for panel power cycle\n");
...@@ -1063,16 +1065,16 @@ static void ironlake_wait_panel_power_cycle(struct intel_dp *intel_dp) ...@@ -1063,16 +1065,16 @@ static void ironlake_wait_panel_power_cycle(struct intel_dp *intel_dp)
wait_remaining_ms_from_jiffies(intel_dp->last_power_cycle, wait_remaining_ms_from_jiffies(intel_dp->last_power_cycle,
intel_dp->panel_power_cycle_delay); 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, wait_remaining_ms_from_jiffies(intel_dp->last_power_on,
intel_dp->backlight_on_delay); 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, wait_remaining_ms_from_jiffies(intel_dp->last_backlight_off,
intel_dp->backlight_off_delay); intel_dp->backlight_off_delay);
...@@ -1094,7 +1096,7 @@ static u32 ironlake_get_pp_control(struct intel_dp *intel_dp) ...@@ -1094,7 +1096,7 @@ static u32 ironlake_get_pp_control(struct intel_dp *intel_dp)
return control; 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_device *dev = intel_dp_to_dev(intel_dp);
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
...@@ -1109,15 +1111,15 @@ void ironlake_edp_panel_vdd_on(struct intel_dp *intel_dp) ...@@ -1109,15 +1111,15 @@ void ironlake_edp_panel_vdd_on(struct intel_dp *intel_dp)
intel_dp->want_panel_vdd = true; intel_dp->want_panel_vdd = true;
if (ironlake_edp_have_panel_vdd(intel_dp)) if (edp_have_panel_vdd(intel_dp))
return; return;
intel_runtime_pm_get(dev_priv); intel_runtime_pm_get(dev_priv);
DRM_DEBUG_KMS("Turning eDP VDD on\n"); DRM_DEBUG_KMS("Turning eDP VDD on\n");
if (!ironlake_edp_have_panel_power(intel_dp)) if (!edp_have_panel_power(intel_dp))
ironlake_wait_panel_power_cycle(intel_dp); wait_panel_power_cycle(intel_dp);
pp = ironlake_get_pp_control(intel_dp); pp = ironlake_get_pp_control(intel_dp);
pp |= EDP_FORCE_VDD; pp |= EDP_FORCE_VDD;
...@@ -1132,13 +1134,13 @@ void ironlake_edp_panel_vdd_on(struct intel_dp *intel_dp) ...@@ -1132,13 +1134,13 @@ void ironlake_edp_panel_vdd_on(struct intel_dp *intel_dp)
/* /*
* If the panel wasn't on, delay before accessing aux channel * 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"); DRM_DEBUG_KMS("eDP was not running\n");
msleep(intel_dp->panel_power_up_delay); 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_device *dev = intel_dp_to_dev(intel_dp);
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
...@@ -1147,7 +1149,7 @@ static void ironlake_panel_vdd_off_sync(struct intel_dp *intel_dp) ...@@ -1147,7 +1149,7 @@ static void ironlake_panel_vdd_off_sync(struct intel_dp *intel_dp)
WARN_ON(!mutex_is_locked(&dev->mode_config.mutex)); 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"); DRM_DEBUG_KMS("Turning eDP VDD off\n");
pp = ironlake_get_pp_control(intel_dp); pp = ironlake_get_pp_control(intel_dp);
...@@ -1170,18 +1172,18 @@ static void ironlake_panel_vdd_off_sync(struct intel_dp *intel_dp) ...@@ -1170,18 +1172,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 *intel_dp = container_of(to_delayed_work(__work),
struct intel_dp, panel_vdd_work); struct intel_dp, panel_vdd_work);
struct drm_device *dev = intel_dp_to_dev(intel_dp); struct drm_device *dev = intel_dp_to_dev(intel_dp);
mutex_lock(&dev->mode_config.mutex); 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); 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)) if (!is_edp(intel_dp))
return; return;
...@@ -1191,7 +1193,7 @@ void ironlake_edp_panel_vdd_off(struct intel_dp *intel_dp, bool sync) ...@@ -1191,7 +1193,7 @@ void ironlake_edp_panel_vdd_off(struct intel_dp *intel_dp, bool sync)
intel_dp->want_panel_vdd = false; intel_dp->want_panel_vdd = false;
if (sync) { if (sync) {
ironlake_panel_vdd_off_sync(intel_dp); edp_panel_vdd_off_sync(intel_dp);
} else { } else {
/* /*
* Queue the timer to fire a long * Queue the timer to fire a long
...@@ -1203,7 +1205,7 @@ void ironlake_edp_panel_vdd_off(struct intel_dp *intel_dp, bool sync) ...@@ -1203,7 +1205,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_device *dev = intel_dp_to_dev(intel_dp);
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
...@@ -1215,12 +1217,12 @@ void ironlake_edp_panel_on(struct intel_dp *intel_dp) ...@@ -1215,12 +1217,12 @@ void ironlake_edp_panel_on(struct intel_dp *intel_dp)
DRM_DEBUG_KMS("Turn eDP power on\n"); 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"); DRM_DEBUG_KMS("eDP power already on\n");
return; return;
} }
ironlake_wait_panel_power_cycle(intel_dp); wait_panel_power_cycle(intel_dp);
pp_ctrl_reg = _pp_ctrl_reg(intel_dp); pp_ctrl_reg = _pp_ctrl_reg(intel_dp);
pp = ironlake_get_pp_control(intel_dp); pp = ironlake_get_pp_control(intel_dp);
...@@ -1238,7 +1240,7 @@ void ironlake_edp_panel_on(struct intel_dp *intel_dp) ...@@ -1238,7 +1240,7 @@ void ironlake_edp_panel_on(struct intel_dp *intel_dp)
I915_WRITE(pp_ctrl_reg, pp); I915_WRITE(pp_ctrl_reg, pp);
POSTING_READ(pp_ctrl_reg); POSTING_READ(pp_ctrl_reg);
ironlake_wait_panel_on(intel_dp); wait_panel_on(intel_dp);
intel_dp->last_power_on = jiffies; intel_dp->last_power_on = jiffies;
if (IS_GEN5(dev)) { if (IS_GEN5(dev)) {
...@@ -1248,7 +1250,7 @@ void ironlake_edp_panel_on(struct intel_dp *intel_dp) ...@@ -1248,7 +1250,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_device *dev = intel_dp_to_dev(intel_dp);
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
...@@ -1260,7 +1262,7 @@ void ironlake_edp_panel_off(struct intel_dp *intel_dp) ...@@ -1260,7 +1262,7 @@ void ironlake_edp_panel_off(struct intel_dp *intel_dp)
DRM_DEBUG_KMS("Turn eDP power off\n"); 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); pp = ironlake_get_pp_control(intel_dp);
/* We need to switch off panel power _and_ force vdd, for otherwise some /* We need to switch off panel power _and_ force vdd, for otherwise some
...@@ -1273,10 +1275,10 @@ void ironlake_edp_panel_off(struct intel_dp *intel_dp) ...@@ -1273,10 +1275,10 @@ void ironlake_edp_panel_off(struct intel_dp *intel_dp)
POSTING_READ(pp_ctrl_reg); POSTING_READ(pp_ctrl_reg);
intel_dp->last_power_cycle = jiffies; 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 intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
struct drm_device *dev = intel_dig_port->base.base.dev; struct drm_device *dev = intel_dig_port->base.base.dev;
...@@ -1294,7 +1296,7 @@ void ironlake_edp_backlight_on(struct intel_dp *intel_dp) ...@@ -1294,7 +1296,7 @@ void ironlake_edp_backlight_on(struct intel_dp *intel_dp)
* link. So delay a bit to make sure the image is solid before * link. So delay a bit to make sure the image is solid before
* allowing it to appear. * allowing it to appear.
*/ */
ironlake_wait_backlight_on(intel_dp); wait_backlight_on(intel_dp);
pp = ironlake_get_pp_control(intel_dp); pp = ironlake_get_pp_control(intel_dp);
pp |= EDP_BLC_ENABLE; pp |= EDP_BLC_ENABLE;
...@@ -1306,7 +1308,7 @@ void ironlake_edp_backlight_on(struct intel_dp *intel_dp) ...@@ -1306,7 +1308,7 @@ void ironlake_edp_backlight_on(struct intel_dp *intel_dp)
intel_panel_enable_backlight(intel_dp->attached_connector); 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_device *dev = intel_dp_to_dev(intel_dp);
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
...@@ -1798,9 +1800,9 @@ static void intel_disable_dp(struct intel_encoder *encoder) ...@@ -1798,9 +1800,9 @@ static void intel_disable_dp(struct intel_encoder *encoder)
/* Make sure the panel is off before trying to change the mode. But also /* 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. */ * 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); 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. */ /* cpu edp my only be disable _after_ the cpu pipe/plane is disabled. */
if (!(port == PORT_A || IS_VALLEYVIEW(dev))) if (!(port == PORT_A || IS_VALLEYVIEW(dev)))
...@@ -1830,11 +1832,11 @@ static void intel_enable_dp(struct intel_encoder *encoder) ...@@ -1830,11 +1832,11 @@ static void intel_enable_dp(struct intel_encoder *encoder)
if (WARN_ON(dp_reg & DP_PORT_EN)) if (WARN_ON(dp_reg & DP_PORT_EN))
return; 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_sink_dpms(intel_dp, DRM_MODE_DPMS_ON);
intel_dp_start_link_train(intel_dp); intel_dp_start_link_train(intel_dp);
ironlake_edp_panel_on(intel_dp); intel_edp_panel_on(intel_dp);
ironlake_edp_panel_vdd_off(intel_dp, true); edp_panel_vdd_off(intel_dp, true);
intel_dp_complete_link_train(intel_dp); intel_dp_complete_link_train(intel_dp);
intel_dp_stop_link_train(intel_dp); intel_dp_stop_link_train(intel_dp);
} }
...@@ -1844,14 +1846,14 @@ static void g4x_enable_dp(struct intel_encoder *encoder) ...@@ -1844,14 +1846,14 @@ static void g4x_enable_dp(struct intel_encoder *encoder)
struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base); struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base);
intel_enable_dp(encoder); 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) static void vlv_enable_dp(struct intel_encoder *encoder)
{ {
struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base); 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) static void g4x_pre_enable_dp(struct intel_encoder *encoder)
...@@ -2853,7 +2855,7 @@ intel_dp_probe_oui(struct intel_dp *intel_dp) ...@@ -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)) if (!(intel_dp->dpcd[DP_DOWN_STREAM_PORT_COUNT] & DP_OUI_SUPPORT))
return; 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)) if (intel_dp_aux_native_read_retry(intel_dp, DP_SINK_OUI, buf, 3))
DRM_DEBUG_KMS("Sink OUI: %02hx%02hx%02hx\n", DRM_DEBUG_KMS("Sink OUI: %02hx%02hx%02hx\n",
...@@ -2863,7 +2865,7 @@ intel_dp_probe_oui(struct intel_dp *intel_dp) ...@@ -2863,7 +2865,7 @@ intel_dp_probe_oui(struct intel_dp *intel_dp)
DRM_DEBUG_KMS("Branch OUI: %02hx%02hx%02hx\n", DRM_DEBUG_KMS("Branch OUI: %02hx%02hx%02hx\n",
buf[0], buf[1], buf[2]); buf[0], buf[1], buf[2]);
ironlake_edp_panel_vdd_off(intel_dp, false); edp_panel_vdd_off(intel_dp, false);
} }
static bool static bool
...@@ -3307,7 +3309,7 @@ void intel_dp_encoder_destroy(struct drm_encoder *encoder) ...@@ -3307,7 +3309,7 @@ void intel_dp_encoder_destroy(struct drm_encoder *encoder)
if (is_edp(intel_dp)) { if (is_edp(intel_dp)) {
cancel_delayed_work_sync(&intel_dp->panel_vdd_work); cancel_delayed_work_sync(&intel_dp->panel_vdd_work);
mutex_lock(&dev->mode_config.mutex); 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); mutex_unlock(&dev->mode_config.mutex);
} }
kfree(intel_dig_port); kfree(intel_dig_port);
...@@ -3582,9 +3584,9 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp, ...@@ -3582,9 +3584,9 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp,
return true; return true;
/* Cache DPCD and EDID for edp. */ /* 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); 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 (has_dpcd) {
if (intel_dp->dpcd[DP_DPCD_REV] >= 0x11) if (intel_dp->dpcd[DP_DPCD_REV] >= 0x11)
...@@ -3679,7 +3681,7 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port, ...@@ -3679,7 +3681,7 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
connector->doublescan_allowed = 0; connector->doublescan_allowed = 0;
INIT_DELAYED_WORK(&intel_dp->panel_vdd_work, INIT_DELAYED_WORK(&intel_dp->panel_vdd_work,
ironlake_panel_vdd_work); edp_panel_vdd_work);
intel_connector_attach_encoder(intel_connector, intel_encoder); intel_connector_attach_encoder(intel_connector, intel_encoder);
drm_sysfs_connector_add(connector); drm_sysfs_connector_add(connector);
...@@ -3745,7 +3747,7 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port, ...@@ -3745,7 +3747,7 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
if (is_edp(intel_dp)) { if (is_edp(intel_dp)) {
cancel_delayed_work_sync(&intel_dp->panel_vdd_work); cancel_delayed_work_sync(&intel_dp->panel_vdd_work);
mutex_lock(&dev->mode_config.mutex); 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); mutex_unlock(&dev->mode_config.mutex);
} }
drm_sysfs_connector_remove(connector); drm_sysfs_connector_remove(connector);
......
...@@ -730,12 +730,10 @@ void intel_dp_check_link_status(struct intel_dp *intel_dp); ...@@ -730,12 +730,10 @@ void intel_dp_check_link_status(struct intel_dp *intel_dp);
bool intel_dp_compute_config(struct intel_encoder *encoder, bool intel_dp_compute_config(struct intel_encoder *encoder,
struct intel_crtc_config *pipe_config); struct intel_crtc_config *pipe_config);
bool intel_dp_is_edp(struct drm_device *dev, enum port port); bool intel_dp_is_edp(struct drm_device *dev, enum port port);
void ironlake_edp_backlight_on(struct intel_dp *intel_dp); void intel_edp_backlight_on(struct intel_dp *intel_dp);
void ironlake_edp_backlight_off(struct intel_dp *intel_dp); void intel_edp_backlight_off(struct intel_dp *intel_dp);
void ironlake_edp_panel_on(struct intel_dp *intel_dp); void intel_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);
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_psr_enable(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_disable(struct intel_dp *intel_dp);
void intel_edp_psr_update(struct drm_device *dev); void intel_edp_psr_update(struct drm_device *dev);
......
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