Rev 6320 | Rev 6935 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6320 | Rev 6660 | ||
---|---|---|---|
Line 2948... | Line 2948... | ||
2948 | MISSING_CASE(fb_modifier); |
2948 | MISSING_CASE(fb_modifier); |
2949 | return 64; |
2949 | return 64; |
2950 | } |
2950 | } |
2951 | } |
2951 | } |
Line 2952... | Line 2952... | ||
2952 | 2952 | ||
2953 | unsigned long intel_plane_obj_offset(struct intel_plane *intel_plane, |
2953 | u32 intel_plane_obj_offset(struct intel_plane *intel_plane, |
2954 | struct drm_i915_gem_object *obj, |
2954 | struct drm_i915_gem_object *obj, |
2955 | unsigned int plane) |
2955 | unsigned int plane) |
2956 | { |
2956 | { |
2957 | const struct i915_ggtt_view *view = &i915_ggtt_view_normal; |
2957 | const struct i915_ggtt_view *view = &i915_ggtt_view_normal; |
2958 | struct i915_vma *vma; |
2958 | struct i915_vma *vma; |
Line 2959... | Line 2959... | ||
2959 | unsigned char *offset; |
2959 | u64 offset; |
2960 | 2960 | ||
Line 2961... | Line 2961... | ||
2961 | if (intel_rotation_90_or_270(intel_plane->base.state->rotation)) |
2961 | if (intel_rotation_90_or_270(intel_plane->base.state->rotation)) |
2962 | view = &i915_ggtt_view_rotated; |
2962 | view = &i915_ggtt_view_rotated; |
2963 | 2963 | ||
2964 | vma = i915_gem_obj_to_ggtt_view(obj, view); |
2964 | vma = i915_gem_obj_to_ggtt_view(obj, view); |
Line 2965... | Line 2965... | ||
2965 | if (WARN(!vma, "ggtt vma for display object not found! (view=%u)\n", |
2965 | if (WARN(!vma, "ggtt vma for display object not found! (view=%u)\n", |
Line 2966... | Line 2966... | ||
2966 | view->type)) |
2966 | view->type)) |
2967 | return -1; |
2967 | return -1; |
2968 | 2968 | ||
2969 | offset = (unsigned char *)vma->node.start; |
2969 | offset = vma->node.start; |
Line -... | Line 2970... | ||
- | 2970 | ||
- | 2971 | if (plane == 1) { |
|
2970 | 2972 | offset += vma->ggtt_view.rotation_info.uv_start_page * |
|
2971 | if (plane == 1) { |
2973 | PAGE_SIZE; |
Line 2972... | Line 2974... | ||
2972 | offset += vma->ggtt_view.rotation_info.uv_start_page * |
2974 | } |
2973 | PAGE_SIZE; |
2975 | |
2974 | } |
2976 | WARN_ON(upper_32_bits(offset)); |
Line 3097... | Line 3099... | ||
3097 | int pipe = intel_crtc->pipe; |
3099 | int pipe = intel_crtc->pipe; |
3098 | u32 plane_ctl, stride_div, stride; |
3100 | u32 plane_ctl, stride_div, stride; |
3099 | u32 tile_height, plane_offset, plane_size; |
3101 | u32 tile_height, plane_offset, plane_size; |
3100 | unsigned int rotation; |
3102 | unsigned int rotation; |
3101 | int x_offset, y_offset; |
3103 | int x_offset, y_offset; |
3102 | unsigned long surf_addr; |
3104 | u32 surf_addr; |
3103 | struct intel_crtc_state *crtc_state = intel_crtc->config; |
3105 | struct intel_crtc_state *crtc_state = intel_crtc->config; |
3104 | struct intel_plane_state *plane_state; |
3106 | struct intel_plane_state *plane_state; |
3105 | int src_x = 0, src_y = 0, src_w = 0, src_h = 0; |
3107 | int src_x = 0, src_y = 0, src_w = 0, src_h = 0; |
3106 | int dst_x = 0, dst_y = 0, dst_w = 0, dst_h = 0; |
3108 | int dst_x = 0, dst_y = 0, dst_w = 0, dst_h = 0; |
3107 | int scaler_id = -1; |
3109 | int scaler_id = -1; |
Line 4445... | Line 4447... | ||
4445 | 4447 | ||
4446 | DRM_DEBUG_KMS("Updating scaler for [CRTC:%i] scaler_user index %u.%u\n", |
4448 | DRM_DEBUG_KMS("Updating scaler for [CRTC:%i] scaler_user index %u.%u\n", |
Line 4447... | Line 4449... | ||
4447 | intel_crtc->base.base.id, intel_crtc->pipe, SKL_CRTC_INDEX); |
4449 | intel_crtc->base.base.id, intel_crtc->pipe, SKL_CRTC_INDEX); |
4448 | 4450 | ||
4449 | return skl_update_scaler(state, !state->base.active, SKL_CRTC_INDEX, |
4451 | return skl_update_scaler(state, !state->base.active, SKL_CRTC_INDEX, |
4450 | &state->scaler_state.scaler_id, DRM_ROTATE_0, |
4452 | &state->scaler_state.scaler_id, BIT(DRM_ROTATE_0), |
4451 | state->pipe_src_w, state->pipe_src_h, |
4453 | state->pipe_src_w, state->pipe_src_h, |
Line 4452... | Line 4454... | ||
4452 | adjusted_mode->crtc_hdisplay, adjusted_mode->crtc_vdisplay); |
4454 | adjusted_mode->crtc_hdisplay, adjusted_mode->crtc_vdisplay); |
Line 8226... | Line 8228... | ||
8226 | 8228 | ||
8227 | static void ironlake_init_pch_refclk(struct drm_device *dev) |
8229 | static void ironlake_init_pch_refclk(struct drm_device *dev) |
8228 | { |
8230 | { |
8229 | struct drm_i915_private *dev_priv = dev->dev_private; |
8231 | struct drm_i915_private *dev_priv = dev->dev_private; |
- | 8232 | struct intel_encoder *encoder; |
|
8230 | struct intel_encoder *encoder; |
8233 | int i; |
8231 | u32 val, final; |
8234 | u32 val, final; |
8232 | bool has_lvds = false; |
8235 | bool has_lvds = false; |
8233 | bool has_cpu_edp = false; |
8236 | bool has_cpu_edp = false; |
8234 | bool has_panel = false; |
8237 | bool has_panel = false; |
8235 | bool has_ck505 = false; |
8238 | bool has_ck505 = false; |
- | 8239 | bool can_ssc = false; |
|
Line 8236... | Line 8240... | ||
8236 | bool can_ssc = false; |
8240 | bool using_ssc_source = false; |
8237 | 8241 | ||
8238 | /* We need to take the global config into account */ |
8242 | /* We need to take the global config into account */ |
8239 | for_each_intel_encoder(dev, encoder) { |
8243 | for_each_intel_encoder(dev, encoder) { |
Line 8258... | Line 8262... | ||
8258 | } else { |
8262 | } else { |
8259 | has_ck505 = false; |
8263 | has_ck505 = false; |
8260 | can_ssc = true; |
8264 | can_ssc = true; |
8261 | } |
8265 | } |
Line -... | Line 8266... | ||
- | 8266 | ||
- | 8267 | /* Check if any DPLLs are using the SSC source */ |
|
- | 8268 | for (i = 0; i < dev_priv->num_shared_dpll; i++) { |
|
- | 8269 | u32 temp = I915_READ(PCH_DPLL(i)); |
|
- | 8270 | ||
- | 8271 | if (!(temp & DPLL_VCO_ENABLE)) |
|
- | 8272 | continue; |
|
- | 8273 | ||
- | 8274 | if ((temp & PLL_REF_INPUT_MASK) == |
|
- | 8275 | PLLB_REF_INPUT_SPREADSPECTRUMIN) { |
|
- | 8276 | using_ssc_source = true; |
|
- | 8277 | break; |
|
- | 8278 | } |
|
- | 8279 | } |
|
8262 | 8280 | ||
8263 | DRM_DEBUG_KMS("has_panel %d has_lvds %d has_ck505 %d\n", |
8281 | DRM_DEBUG_KMS("has_panel %d has_lvds %d has_ck505 %d using_ssc_source %d\n", |
Line 8264... | Line 8282... | ||
8264 | has_panel, has_lvds, has_ck505); |
8282 | has_panel, has_lvds, has_ck505, using_ssc_source); |
8265 | 8283 | ||
8266 | /* Ironlake: try to setup display ref clock before DPLL |
8284 | /* Ironlake: try to setup display ref clock before DPLL |
8267 | * enabling. This is only under driver's control after |
8285 | * enabling. This is only under driver's control after |
Line 8296... | Line 8314... | ||
8296 | final |= DREF_CPU_SOURCE_OUTPUT_DOWNSPREAD; |
8314 | final |= DREF_CPU_SOURCE_OUTPUT_DOWNSPREAD; |
8297 | else |
8315 | else |
8298 | final |= DREF_CPU_SOURCE_OUTPUT_NONSPREAD; |
8316 | final |= DREF_CPU_SOURCE_OUTPUT_NONSPREAD; |
8299 | } else |
8317 | } else |
8300 | final |= DREF_CPU_SOURCE_OUTPUT_DISABLE; |
8318 | final |= DREF_CPU_SOURCE_OUTPUT_DISABLE; |
8301 | } else { |
8319 | } else if (using_ssc_source) { |
8302 | final |= DREF_SSC_SOURCE_DISABLE; |
8320 | final |= DREF_SSC_SOURCE_ENABLE; |
8303 | final |= DREF_CPU_SOURCE_OUTPUT_DISABLE; |
8321 | final |= DREF_SSC1_ENABLE; |
8304 | } |
8322 | } |
Line 8305... | Line 8323... | ||
8305 | 8323 | ||
8306 | if (final == val) |
8324 | if (final == val) |
Line 8344... | Line 8362... | ||
8344 | 8362 | ||
8345 | I915_WRITE(PCH_DREF_CONTROL, val); |
8363 | I915_WRITE(PCH_DREF_CONTROL, val); |
8346 | POSTING_READ(PCH_DREF_CONTROL); |
8364 | POSTING_READ(PCH_DREF_CONTROL); |
8347 | udelay(200); |
8365 | udelay(200); |
8348 | } else { |
8366 | } else { |
Line 8349... | Line 8367... | ||
8349 | DRM_DEBUG_KMS("Disabling SSC entirely\n"); |
8367 | DRM_DEBUG_KMS("Disabling CPU source output\n"); |
Line 8350... | Line 8368... | ||
8350 | 8368 | ||
8351 | val &= ~DREF_CPU_SOURCE_OUTPUT_MASK; |
8369 | val &= ~DREF_CPU_SOURCE_OUTPUT_MASK; |
Line 8352... | Line 8370... | ||
8352 | 8370 | ||
8353 | /* Turn off CPU output */ |
8371 | /* Turn off CPU output */ |
8354 | val |= DREF_CPU_SOURCE_OUTPUT_DISABLE; |
8372 | val |= DREF_CPU_SOURCE_OUTPUT_DISABLE; |
Line -... | Line 8373... | ||
- | 8373 | ||
- | 8374 | I915_WRITE(PCH_DREF_CONTROL, val); |
|
- | 8375 | POSTING_READ(PCH_DREF_CONTROL); |
|
8355 | 8376 | udelay(200); |
|
8356 | I915_WRITE(PCH_DREF_CONTROL, val); |
8377 | |
8357 | POSTING_READ(PCH_DREF_CONTROL); |
8378 | if (!using_ssc_source) { |
Line 8358... | Line 8379... | ||
8358 | udelay(200); |
8379 | DRM_DEBUG_KMS("Disabling SSC source\n"); |
Line 8366... | Line 8387... | ||
8366 | 8387 | ||
8367 | I915_WRITE(PCH_DREF_CONTROL, val); |
8388 | I915_WRITE(PCH_DREF_CONTROL, val); |
8368 | POSTING_READ(PCH_DREF_CONTROL); |
8389 | POSTING_READ(PCH_DREF_CONTROL); |
8369 | udelay(200); |
8390 | udelay(200); |
- | 8391 | } |
|
Line 8370... | Line 8392... | ||
8370 | } |
8392 | } |
8371 | 8393 | ||
Line 8372... | Line 8394... | ||
8372 | BUG_ON(val != final); |
8394 | BUG_ON(val != final); |
Line 9667... | Line 9689... | ||
9667 | 9689 | ||
9668 | mutex_lock(&dev_priv->rps.hw_lock); |
9690 | mutex_lock(&dev_priv->rps.hw_lock); |
9669 | sandybridge_pcode_write(dev_priv, HSW_PCODE_DE_WRITE_FREQ_REQ, data); |
9691 | sandybridge_pcode_write(dev_priv, HSW_PCODE_DE_WRITE_FREQ_REQ, data); |
Line -... | Line 9692... | ||
- | 9692 | mutex_unlock(&dev_priv->rps.hw_lock); |
|
- | 9693 | ||
9670 | mutex_unlock(&dev_priv->rps.hw_lock); |
9694 | I915_WRITE(CDCLK_FREQ, DIV_ROUND_CLOSEST(cdclk, 1000) - 1); |
Line 9671... | Line 9695... | ||
9671 | 9695 | ||
9672 | intel_update_cdclk(dev); |
9696 | intel_update_cdclk(dev); |
9673 | 9697 | ||
Line 11926... | Line 11950... | ||
11926 | DRM_DEBUG_KMS("clamping display bpp (was %d) to EDID reported max of %d\n", |
11950 | DRM_DEBUG_KMS("clamping display bpp (was %d) to EDID reported max of %d\n", |
11927 | bpp, connector->base.display_info.bpc*3); |
11951 | bpp, connector->base.display_info.bpc*3); |
11928 | pipe_config->pipe_bpp = connector->base.display_info.bpc*3; |
11952 | pipe_config->pipe_bpp = connector->base.display_info.bpc*3; |
11929 | } |
11953 | } |
Line 11930... | Line 11954... | ||
11930 | 11954 | ||
11931 | /* Clamp bpp to default limit on screens without EDID 1.4 */ |
11955 | /* Clamp bpp to 8 on screens without EDID 1.4 */ |
11932 | if (connector->base.display_info.bpc == 0) { |
- | |
11933 | int type = connector->base.connector_type; |
- | |
11934 | int clamp_bpp = 24; |
- | |
11935 | - | ||
11936 | /* Fall back to 18 bpp when DP sink capability is unknown. */ |
- | |
11937 | if (type == DRM_MODE_CONNECTOR_DisplayPort || |
- | |
11938 | type == DRM_MODE_CONNECTOR_eDP) |
- | |
11939 | clamp_bpp = 18; |
- | |
11940 | - | ||
11941 | if (bpp > clamp_bpp) { |
11956 | if (connector->base.display_info.bpc == 0 && bpp > 24) { |
11942 | DRM_DEBUG_KMS("clamping display bpp (was %d) to default limit of %d\n", |
11957 | DRM_DEBUG_KMS("clamping display bpp (was %d) to default limit of 24\n", |
11943 | bpp, clamp_bpp); |
11958 | bpp); |
11944 | pipe_config->pipe_bpp = clamp_bpp; |
- | |
11945 | } |
11959 | pipe_config->pipe_bpp = 24; |
11946 | } |
11960 | } |
Line 11947... | Line 11961... | ||
11947 | } |
11961 | } |
11948 | 11962 | ||
Line 14144... | Line 14158... | ||
14144 | intel_dp_init(dev, PCH_DP_C, PORT_C); |
14158 | intel_dp_init(dev, PCH_DP_C, PORT_C); |
Line 14145... | Line 14159... | ||
14145 | 14159 | ||
14146 | if (I915_READ(PCH_DP_D) & DP_DETECTED) |
14160 | if (I915_READ(PCH_DP_D) & DP_DETECTED) |
14147 | intel_dp_init(dev, PCH_DP_D, PORT_D); |
14161 | intel_dp_init(dev, PCH_DP_D, PORT_D); |
- | 14162 | } else if (IS_VALLEYVIEW(dev)) { |
|
- | 14163 | bool has_edp, has_port; |
|
14148 | } else if (IS_VALLEYVIEW(dev)) { |
14164 | |
14149 | /* |
14165 | /* |
14150 | * The DP_DETECTED bit is the latched state of the DDC |
14166 | * The DP_DETECTED bit is the latched state of the DDC |
14151 | * SDA pin at boot. However since eDP doesn't require DDC |
14167 | * SDA pin at boot. However since eDP doesn't require DDC |
14152 | * (no way to plug in a DP->HDMI dongle) the DDC pins for |
14168 | * (no way to plug in a DP->HDMI dongle) the DDC pins for |
14153 | * eDP ports may have been muxed to an alternate function. |
14169 | * eDP ports may have been muxed to an alternate function. |
14154 | * Thus we can't rely on the DP_DETECTED bit alone to detect |
14170 | * Thus we can't rely on the DP_DETECTED bit alone to detect |
14155 | * eDP ports. Consult the VBT as well as DP_DETECTED to |
14171 | * eDP ports. Consult the VBT as well as DP_DETECTED to |
- | 14172 | * detect eDP ports. |
|
- | 14173 | * |
|
- | 14174 | * Sadly the straps seem to be missing sometimes even for HDMI |
|
- | 14175 | * ports (eg. on Voyo V3 - CHT x7-Z8700), so check both strap |
|
- | 14176 | * and VBT for the presence of the port. Additionally we can't |
|
- | 14177 | * trust the port type the VBT declares as we've seen at least |
|
14156 | * detect eDP ports. |
14178 | * HDMI ports that the VBT claim are DP or eDP. |
- | 14179 | */ |
|
- | 14180 | has_edp = intel_dp_is_edp(dev, PORT_B); |
|
14157 | */ |
14181 | has_port = intel_bios_is_port_present(dev_priv, PORT_B); |
14158 | if (I915_READ(VLV_HDMIB) & SDVO_DETECTED && |
14182 | if (I915_READ(VLV_DP_B) & DP_DETECTED || has_port) |
- | 14183 | has_edp &= intel_dp_init(dev, VLV_DP_B, PORT_B); |
|
14159 | !intel_dp_is_edp(dev, PORT_B)) |
14184 | if ((I915_READ(VLV_HDMIB) & SDVO_DETECTED || has_port) && !has_edp) |
14160 | intel_hdmi_init(dev, VLV_HDMIB, PORT_B); |
- | |
14161 | if (I915_READ(VLV_DP_B) & DP_DETECTED || |
- | |
14162 | intel_dp_is_edp(dev, PORT_B)) |
- | |
Line -... | Line 14185... | ||
- | 14185 | intel_hdmi_init(dev, VLV_HDMIB, PORT_B); |
|
- | 14186 | ||
14163 | intel_dp_init(dev, VLV_DP_B, PORT_B); |
14187 | has_edp = intel_dp_is_edp(dev, PORT_C); |
14164 | 14188 | has_port = intel_bios_is_port_present(dev_priv, PORT_C); |
|
- | 14189 | if (I915_READ(VLV_DP_C) & DP_DETECTED || has_port) |
|
14165 | if (I915_READ(VLV_HDMIC) & SDVO_DETECTED && |
14190 | has_edp &= intel_dp_init(dev, VLV_DP_C, PORT_C); |
14166 | !intel_dp_is_edp(dev, PORT_C)) |
- | |
14167 | intel_hdmi_init(dev, VLV_HDMIC, PORT_C); |
- | |
14168 | if (I915_READ(VLV_DP_C) & DP_DETECTED || |
- | |
Line 14169... | Line 14191... | ||
14169 | intel_dp_is_edp(dev, PORT_C)) |
14191 | if ((I915_READ(VLV_HDMIC) & SDVO_DETECTED || has_port) && !has_edp) |
- | 14192 | intel_hdmi_init(dev, VLV_HDMIC, PORT_C); |
|
14170 | intel_dp_init(dev, VLV_DP_C, PORT_C); |
14193 | |
14171 | 14194 | if (IS_CHERRYVIEW(dev)) { |
|
- | 14195 | /* |
|
14172 | if (IS_CHERRYVIEW(dev)) { |
14196 | * eDP not supported on port D, |
14173 | /* eDP not supported on port D, so don't check VBT */ |
14197 | * so no need to worry about it |
14174 | if (I915_READ(CHV_HDMID) & SDVO_DETECTED) |
14198 | */ |
- | 14199 | has_port = intel_bios_is_port_present(dev_priv, PORT_D); |
|
- | 14200 | if (I915_READ(CHV_DP_D) & DP_DETECTED || has_port) |
|
14175 | intel_hdmi_init(dev, CHV_HDMID, PORT_D); |
14201 | intel_dp_init(dev, CHV_DP_D, PORT_D); |
Line 14176... | Line 14202... | ||
14176 | if (I915_READ(CHV_DP_D) & DP_DETECTED) |
14202 | if (I915_READ(CHV_HDMID) & SDVO_DETECTED || has_port) |
14177 | intel_dp_init(dev, CHV_DP_D, PORT_D); |
14203 | intel_hdmi_init(dev, CHV_HDMID, PORT_D); |
14178 | } |
14204 | } |