diff options
author | Keith Packard <keithp@keithp.com> | 2011-09-29 19:33:01 -0400 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2011-10-12 12:37:38 -0400 |
commit | 05ce1a4961cffd7b0c8d4b70a7c9fa341368bc48 (patch) | |
tree | d9b47e77bf1fa59e2fe12716ac433034d92cfda5 /drivers/gpu/drm/i915 | |
parent | bd9431597153925b000e810ceadf599b5aa6ad90 (diff) |
drm/i915: Restrict ILK-specific eDP power hack to ILK
This eliminates a fairly long delay when power sequencing newer
hardware
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915')
-rw-r--r-- | drivers/gpu/drm/i915/intel_dp.c | 56 |
1 files changed, 34 insertions, 22 deletions
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index e880a04c722f..f5303e18e791 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
@@ -992,10 +992,12 @@ static void ironlake_edp_panel_on (struct intel_dp *intel_dp) | |||
992 | pp &= ~PANEL_UNLOCK_MASK; | 992 | pp &= ~PANEL_UNLOCK_MASK; |
993 | pp |= PANEL_UNLOCK_REGS; | 993 | pp |= PANEL_UNLOCK_REGS; |
994 | 994 | ||
995 | /* ILK workaround: disable reset around power sequence */ | 995 | if (IS_GEN5(dev)) { |
996 | pp &= ~PANEL_POWER_RESET; | 996 | /* ILK workaround: disable reset around power sequence */ |
997 | I915_WRITE(PCH_PP_CONTROL, pp); | 997 | pp &= ~PANEL_POWER_RESET; |
998 | POSTING_READ(PCH_PP_CONTROL); | 998 | I915_WRITE(PCH_PP_CONTROL, pp); |
999 | POSTING_READ(PCH_PP_CONTROL); | ||
1000 | } | ||
999 | 1001 | ||
1000 | pp |= POWER_TARGET_ON; | 1002 | pp |= POWER_TARGET_ON; |
1001 | I915_WRITE(PCH_PP_CONTROL, pp); | 1003 | I915_WRITE(PCH_PP_CONTROL, pp); |
@@ -1006,9 +1008,11 @@ static void ironlake_edp_panel_on (struct intel_dp *intel_dp) | |||
1006 | DRM_ERROR("panel on wait timed out: 0x%08x\n", | 1008 | DRM_ERROR("panel on wait timed out: 0x%08x\n", |
1007 | I915_READ(PCH_PP_STATUS)); | 1009 | I915_READ(PCH_PP_STATUS)); |
1008 | 1010 | ||
1009 | pp |= PANEL_POWER_RESET; /* restore panel reset bit */ | 1011 | if (IS_GEN5(dev)) { |
1010 | I915_WRITE(PCH_PP_CONTROL, pp); | 1012 | pp |= PANEL_POWER_RESET; /* restore panel reset bit */ |
1011 | POSTING_READ(PCH_PP_CONTROL); | 1013 | I915_WRITE(PCH_PP_CONTROL, pp); |
1014 | POSTING_READ(PCH_PP_CONTROL); | ||
1015 | } | ||
1012 | } | 1016 | } |
1013 | 1017 | ||
1014 | static void ironlake_edp_panel_off(struct drm_encoder *encoder) | 1018 | static void ironlake_edp_panel_off(struct drm_encoder *encoder) |
@@ -1025,24 +1029,32 @@ static void ironlake_edp_panel_off(struct drm_encoder *encoder) | |||
1025 | pp &= ~PANEL_UNLOCK_MASK; | 1029 | pp &= ~PANEL_UNLOCK_MASK; |
1026 | pp |= PANEL_UNLOCK_REGS; | 1030 | pp |= PANEL_UNLOCK_REGS; |
1027 | 1031 | ||
1028 | /* ILK workaround: disable reset around power sequence */ | 1032 | if (IS_GEN5(dev)) { |
1029 | pp &= ~PANEL_POWER_RESET; | 1033 | /* ILK workaround: disable reset around power sequence */ |
1030 | I915_WRITE(PCH_PP_CONTROL, pp); | 1034 | pp &= ~PANEL_POWER_RESET; |
1031 | POSTING_READ(PCH_PP_CONTROL); | 1035 | I915_WRITE(PCH_PP_CONTROL, pp); |
1036 | POSTING_READ(PCH_PP_CONTROL); | ||
1037 | } | ||
1032 | 1038 | ||
1033 | pp &= ~POWER_TARGET_ON; | 1039 | intel_dp->panel_off_jiffies = jiffies; |
1034 | I915_WRITE(PCH_PP_CONTROL, pp); | ||
1035 | POSTING_READ(PCH_PP_CONTROL); | ||
1036 | msleep(intel_dp->panel_power_cycle_delay); | ||
1037 | 1040 | ||
1038 | if (wait_for((I915_READ(PCH_PP_STATUS) & idle_off_mask) == 0, 5000)) | 1041 | if (IS_GEN5(dev)) { |
1039 | DRM_ERROR("panel off wait timed out: 0x%08x\n", | 1042 | pp &= ~POWER_TARGET_ON; |
1040 | I915_READ(PCH_PP_STATUS)); | 1043 | I915_WRITE(PCH_PP_CONTROL, pp); |
1044 | POSTING_READ(PCH_PP_CONTROL); | ||
1045 | pp &= ~POWER_TARGET_ON; | ||
1046 | I915_WRITE(PCH_PP_CONTROL, pp); | ||
1047 | POSTING_READ(PCH_PP_CONTROL); | ||
1048 | msleep(intel_dp->panel_power_cycle_delay); | ||
1041 | 1049 | ||
1042 | pp |= PANEL_POWER_RESET; /* restore panel reset bit */ | 1050 | if (wait_for((I915_READ(PCH_PP_STATUS) & idle_off_mask) == 0, 5000)) |
1043 | I915_WRITE(PCH_PP_CONTROL, pp); | 1051 | DRM_ERROR("panel off wait timed out: 0x%08x\n", |
1044 | POSTING_READ(PCH_PP_CONTROL); | 1052 | I915_READ(PCH_PP_STATUS)); |
1045 | intel_dp->panel_off_jiffies = jiffies; | 1053 | |
1054 | pp |= PANEL_POWER_RESET; /* restore panel reset bit */ | ||
1055 | I915_WRITE(PCH_PP_CONTROL, pp); | ||
1056 | POSTING_READ(PCH_PP_CONTROL); | ||
1057 | } | ||
1046 | } | 1058 | } |
1047 | 1059 | ||
1048 | static void ironlake_edp_backlight_on (struct intel_dp *intel_dp) | 1060 | static void ironlake_edp_backlight_on (struct intel_dp *intel_dp) |