Rev 2330 | Rev 2335 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2330 | Rev 2332 | ||
---|---|---|---|
Line -... | Line 5666... | ||
- | 5666 | ||
- | 5667 | ||
- | 5668 | ||
- | 5669 | ||
- | 5670 | ||
Line -... | Line 5671... | ||
- | 5671 | /** Sets the color ramps on behalf of RandR */ |
|
- | 5672 | void intel_crtc_fb_gamma_set(struct drm_crtc *crtc, u16 red, u16 green, |
|
- | 5673 | u16 blue, int regno) |
|
- | 5674 | { |
|
Line -... | Line 5675... | ||
- | 5675 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); |
|
- | 5676 | ||
- | 5677 | intel_crtc->lut_r[regno] = red >> 8; |
|
- | 5678 | intel_crtc->lut_g[regno] = green >> 8; |
|
Line -... | Line 5679... | ||
- | 5679 | intel_crtc->lut_b[regno] = blue >> 8; |
|
- | 5680 | } |
|
- | 5681 | ||
- | 5682 | void intel_crtc_fb_gamma_get(struct drm_crtc *crtc, u16 *red, u16 *green, |
|
Line 5666... | Line 5683... | ||
5666 | 5683 | u16 *blue, int regno) |
|
5667 | 5684 | { |
|
5668 | 5685 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); |
|
5669 | 5686 | ||
Line 7101... | Line 7118... | ||
7101 | /* Without this, mode sets may fail silently on FDI */ |
7118 | /* Without this, mode sets may fail silently on FDI */ |
7102 | for_each_pipe(pipe) |
7119 | for_each_pipe(pipe) |
7103 | I915_WRITE(TRANS_CHICKEN2(pipe), TRANS_AUTOTRAIN_GEN_STALL_DIS); |
7120 | I915_WRITE(TRANS_CHICKEN2(pipe), TRANS_AUTOTRAIN_GEN_STALL_DIS); |
7104 | } |
7121 | } |
Line -... | Line 7122... | ||
- | 7122 | ||
- | 7123 | static void ironlake_teardown_rc6(struct drm_device *dev) |
|
- | 7124 | { |
|
- | 7125 | struct drm_i915_private *dev_priv = dev->dev_private; |
|
- | 7126 | ||
- | 7127 | if (dev_priv->renderctx) { |
|
- | 7128 | // i915_gem_object_unpin(dev_priv->renderctx); |
|
- | 7129 | // drm_gem_object_unreference(&dev_priv->renderctx->base); |
|
- | 7130 | dev_priv->renderctx = NULL; |
|
- | 7131 | } |
|
- | 7132 | ||
- | 7133 | if (dev_priv->pwrctx) { |
|
- | 7134 | // i915_gem_object_unpin(dev_priv->pwrctx); |
|
- | 7135 | // drm_gem_object_unreference(&dev_priv->pwrctx->base); |
|
- | 7136 | dev_priv->pwrctx = NULL; |
|
- | 7137 | } |
|
- | 7138 | } |
|
Line -... | Line 7139... | ||
- | 7139 | ||
- | 7140 | ||
- | 7141 | ||
- | 7142 | ||
- | 7143 | ||
- | 7144 | ||
- | 7145 | ||
- | 7146 | static int ironlake_setup_rc6(struct drm_device *dev) |
|
- | 7147 | { |
|
- | 7148 | struct drm_i915_private *dev_priv = dev->dev_private; |
|
- | 7149 | ||
- | 7150 | if (dev_priv->renderctx == NULL) |
|
- | 7151 | // dev_priv->renderctx = intel_alloc_context_page(dev); |
|
- | 7152 | if (!dev_priv->renderctx) |
|
- | 7153 | return -ENOMEM; |
|
- | 7154 | ||
- | 7155 | if (dev_priv->pwrctx == NULL) |
|
- | 7156 | // dev_priv->pwrctx = intel_alloc_context_page(dev); |
|
- | 7157 | if (!dev_priv->pwrctx) { |
|
- | 7158 | ironlake_teardown_rc6(dev); |
|
- | 7159 | return -ENOMEM; |
|
- | 7160 | } |
|
- | 7161 | ||
- | 7162 | return 0; |
|
- | 7163 | } |
|
- | 7164 | ||
- | 7165 | void ironlake_enable_rc6(struct drm_device *dev) |
|
- | 7166 | { |
|
- | 7167 | struct drm_i915_private *dev_priv = dev->dev_private; |
|
- | 7168 | int ret; |
|
- | 7169 | ||
- | 7170 | /* rc6 disabled by default due to repeated reports of hanging during |
|
- | 7171 | * boot and resume. |
|
- | 7172 | */ |
|
- | 7173 | if (!i915_enable_rc6) |
|
- | 7174 | return; |
|
- | 7175 | ||
- | 7176 | mutex_lock(&dev->struct_mutex); |
|
- | 7177 | ret = ironlake_setup_rc6(dev); |
|
- | 7178 | if (ret) { |
|
- | 7179 | mutex_unlock(&dev->struct_mutex); |
|
- | 7180 | return; |
|
- | 7181 | } |
|
- | 7182 | ||
- | 7183 | /* |
|
- | 7184 | * GPU can automatically power down the render unit if given a page |
|
- | 7185 | * to save state. |
|
- | 7186 | */ |
|
- | 7187 | #if 0 |
|
- | 7188 | ret = BEGIN_LP_RING(6); |
|
- | 7189 | if (ret) { |
|
- | 7190 | ironlake_teardown_rc6(dev); |
|
- | 7191 | mutex_unlock(&dev->struct_mutex); |
|
- | 7192 | return; |
|
- | 7193 | } |
|
- | 7194 | ||
- | 7195 | OUT_RING(MI_SUSPEND_FLUSH | MI_SUSPEND_FLUSH_EN); |
|
- | 7196 | OUT_RING(MI_SET_CONTEXT); |
|
- | 7197 | OUT_RING(dev_priv->renderctx->gtt_offset | |
|
- | 7198 | MI_MM_SPACE_GTT | |
|
- | 7199 | MI_SAVE_EXT_STATE_EN | |
|
- | 7200 | MI_RESTORE_EXT_STATE_EN | |
|
- | 7201 | MI_RESTORE_INHIBIT); |
|
- | 7202 | OUT_RING(MI_SUSPEND_FLUSH); |
|
- | 7203 | OUT_RING(MI_NOOP); |
|
- | 7204 | OUT_RING(MI_FLUSH); |
|
- | 7205 | ADVANCE_LP_RING(); |
|
- | 7206 | ||
- | 7207 | /* |
|
- | 7208 | * Wait for the command parser to advance past MI_SET_CONTEXT. The HW |
|
- | 7209 | * does an implicit flush, combined with MI_FLUSH above, it should be |
|
- | 7210 | * safe to assume that renderctx is valid |
|
- | 7211 | */ |
|
- | 7212 | ret = intel_wait_ring_idle(LP_RING(dev_priv)); |
|
- | 7213 | if (ret) { |
|
- | 7214 | DRM_ERROR("failed to enable ironlake power power savings\n"); |
|
- | 7215 | ironlake_teardown_rc6(dev); |
|
- | 7216 | mutex_unlock(&dev->struct_mutex); |
|
- | 7217 | return; |
|
- | 7218 | } |
|
- | 7219 | #endif |
|
- | 7220 | ||
7105 | 7221 | I915_WRITE(PWRCTXA, dev_priv->pwrctx->gtt_offset | PWRCTX_EN); |
|
7106 | 7222 | I915_WRITE(RSTDBYCTL, I915_READ(RSTDBYCTL) & ~RCX_SW_EXIT); |
|
7107 | 7223 | mutex_unlock(&dev->struct_mutex); |
|
Line 7108... | Line 7224... | ||
7108 | 7224 | } |
|
Line 7436... | Line 7552... | ||
7436 | if (IS_GEN6(dev) || IS_GEN7(dev)) { |
7552 | if (IS_GEN6(dev) || IS_GEN7(dev)) { |
7437 | gen6_enable_rps(dev_priv); |
7553 | gen6_enable_rps(dev_priv); |
7438 | gen6_update_ring_freq(dev_priv); |
7554 | gen6_update_ring_freq(dev_priv); |
7439 | } |
7555 | } |
Line -... | Line 7556... | ||
- | 7556 | ||
- | 7557 | // INIT_WORK(&dev_priv->idle_work, intel_idle_update); |
|
- | 7558 | // setup_timer(&dev_priv->idle_timer, intel_gpu_idle_timer, |
|
- | 7559 | // (unsigned long)dev); |
|
- | 7560 | } |
|
- | 7561 | ||
- | 7562 | void intel_modeset_gem_init(struct drm_device *dev) |
|
- | 7563 | { |
|
- | 7564 | if (IS_IRONLAKE_M(dev)) |
|
- | 7565 | ironlake_enable_rc6(dev); |
|
- | 7566 | ||
7440 | 7567 | // intel_setup_overlay(dev); |
|
Line 7441... | Line 7568... | ||
7441 | } |
7568 | } |
7442 | 7569 |