- Fix for fastboot DSI panel boot time flicker regression, also fixes Bugzilla #108225 - Fix Bugzilla #101269 to avoid GPU hangs on Sandybridge machines - Avoid GPU hang on error capture on Broxton with Vt-d enabled - Avoid missing GPU relocations on Pineview and Bearlake (Gen3)
Unified · Split
| @@ -1268,7 +1268,7 @@ relocate_entry(struct i915_vma *vma, · 1267 unmodified lines | ||
| 1268 | 1268 | else if (gen >= 4) |
| 1269 | 1269 | len = 4; |
| 1270 | 1270 | else |
| 1271 | − len = 3; | |
| 1271 | + len = 6; | |
| 1272 | 1272 | |
| 1273 | 1273 | batch = reloc_gpu(eb, vma, len); |
| 1274 | 1274 | if (IS_ERR(batch)) |
| @@ -1309,6 +1309,11 @@ relocate_entry(struct i915_vma *vma, · 34 unmodified lines | ||
| 1309 | 1309 | *batch++ = MI_STORE_DWORD_IMM | MI_MEM_VIRTUAL; |
| 1310 | 1310 | *batch++ = addr; |
| 1311 | 1311 | *batch++ = target_offset; |
| 1312 | + | |
| 1313 | + /* And again for good measure (blb/pnv) */ | |
| 1314 | + *batch++ = MI_STORE_DWORD_IMM | MI_MEM_VIRTUAL; | |
| 1315 | + *batch++ = addr; | |
| 1316 | + *batch++ = target_offset; | |
| 1312 | 1317 | } |
| 1313 | 1318 | |
| 1314 | 1319 | goto out; |
| @@ -3413,6 +3413,11 @@ static int gen8_gmch_probe(struct i915_ggtt *ggtt) · 3412 unmodified lines | ||
| 3413 | 3413 | ggtt->vm.insert_page = bxt_vtd_ggtt_insert_page__BKL; |
| 3414 | 3414 | if (ggtt->vm.clear_range != nop_clear_range) |
| 3415 | 3415 | ggtt->vm.clear_range = bxt_vtd_ggtt_clear_range__BKL; |
| 3416 | + | |
| 3417 | + /* Prevent recursively calling stop_machine() and deadlocks. */ | |
| 3418 | + dev_info(dev_priv->drm.dev, | |
| 3419 | + "Disabling error capture for VT-d workaround\n"); | |
| 3420 | + i915_disable_error_state(dev_priv, -ENODEV); | |
| 3416 | 3421 | } |
| 3417 | 3422 | |
| 3418 | 3423 | ggtt->invalidate = gen6_ggtt_invalidate; |
| @@ -648,6 +648,9 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m, · 647 unmodified lines | ||
| 648 | 648 | return 0; |
| 649 | 649 | } |
| 650 | 650 | |
| 651 | + if (IS_ERR(error)) | |
| 652 | + return PTR_ERR(error); | |
| 653 | + | |
| 651 | 654 | if (*error->error_msg) |
| 652 | 655 | err_printf(m, "%s\n", error->error_msg); |
| 653 | 656 | err_printf(m, "Kernel: " UTS_RELEASE "\n"); |
| @@ -1859,6 +1862,7 @@ void i915_capture_error_state(struct drm_i915_private *i915, · 1205 unmodified lines | ||
| 1859 | 1862 | error = i915_capture_gpu_state(i915); |
| 1860 | 1863 | if (!error) { |
| 1861 | 1864 | DRM_DEBUG_DRIVER("out of memory, not capturing error state\n"); |
| 1865 | + i915_disable_error_state(i915, -ENOMEM); | |
| 1862 | 1866 | return; |
| 1863 | 1867 | } |
| 1864 | 1868 | |
| @@ -1914,5 +1918,14 @@ void i915_reset_error_state(struct drm_i915_private *i915) · 49 unmodified lines | ||
| 1914 | 1918 | i915->gpu_error.first_error = NULL; |
| 1915 | 1919 | spin_unlock_irq(&i915->gpu_error.lock); |
| 1916 | 1920 | |
| 1917 | − i915_gpu_state_put(error); | |
| 1921 | + if (!IS_ERR(error)) | |
| 1922 | + i915_gpu_state_put(error); | |
| 1923 | +} | |
| 1924 | + | |
| 1925 | +void i915_disable_error_state(struct drm_i915_private *i915, int err) | |
| 1926 | +{ | |
| 1927 | + spin_lock_irq(&i915->gpu_error.lock); | |
| 1928 | + if (!i915->gpu_error.first_error) | |
| 1929 | + i915->gpu_error.first_error = ERR_PTR(err); | |
| 1930 | + spin_unlock_irq(&i915->gpu_error.lock); | |
| 1918 | 1931 | } |
| @@ -343,6 +343,7 @@ static inline void i915_gpu_state_put(struct i915_gpu_state *gpu) · 342 unmodified lines | ||
| 343 | 343 | |
| 344 | 344 | struct i915_gpu_state *i915_first_error_state(struct drm_i915_private *i915); |
| 345 | 345 | void i915_reset_error_state(struct drm_i915_private *i915); |
| 346 | +void i915_disable_error_state(struct drm_i915_private *i915, int err); | |
| 346 | 347 | |
| 347 | 348 | #else |
| 348 | 349 | |
| @@ -355,13 +356,18 @@ static inline void i915_capture_error_state(struct drm_i915_private *dev_priv, · 6 unmodified lines | ||
| 355 | 356 | static inline struct i915_gpu_state * |
| 356 | 357 | i915_first_error_state(struct drm_i915_private *i915) |
| 357 | 358 | { |
| 358 | − return NULL; | |
| 359 | + return ERR_PTR(-ENODEV); | |
| 359 | 360 | } |
| 360 | 361 | |
| 361 | 362 | static inline void i915_reset_error_state(struct drm_i915_private *i915) |
| 362 | 363 | { |
| 363 | 364 | } |
| 364 | 365 | |
| 366 | +static inline void i915_disable_error_state(struct drm_i915_private *i915, | |
| 367 | + int err) | |
| 368 | +{ | |
| 369 | +} | |
| 370 | + | |
| 365 | 371 | #endif /* IS_ENABLED(CONFIG_DRM_I915_CAPTURE_ERROR) */ |
| 366 | 372 | |
| 367 | 373 | #endif /* _I915_GPU_ERROR_H_ */ |
| @@ -2890,6 +2890,7 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc, · 2889 unmodified lines | ||
| 2890 | 2890 | return; |
| 2891 | 2891 | |
| 2892 | 2892 | valid_fb: |
| 2893 | + intel_state->base.rotation = plane_config->rotation; | |
| 2893 | 2894 | intel_fill_fb_ggtt_view(&intel_state->view, fb, |
| 2894 | 2895 | intel_state->base.rotation); |
| 2895 | 2896 | intel_state->color_plane[0].stride = |
| @@ -7882,8 +7883,15 @@ i9xx_get_initial_plane_config(struct intel_crtc *crtc, · 4986 unmodified lines | ||
| 7882 | 7883 | plane_config->tiling = I915_TILING_X; |
| 7883 | 7884 | fb->modifier = I915_FORMAT_MOD_X_TILED; |
| 7884 | 7885 | } |
| 7886 | + | |
| 7887 | + if (val & DISPPLANE_ROTATE_180) | |
| 7888 | + plane_config->rotation = DRM_MODE_ROTATE_180; | |
| 7885 | 7889 | } |
| 7886 | 7890 | |
| 7891 | + if (IS_CHERRYVIEW(dev_priv) && pipe == PIPE_B && | |
| 7892 | + val & DISPPLANE_MIRROR) | |
| 7893 | + plane_config->rotation |= DRM_MODE_REFLECT_X; | |
| 7894 | + | |
| 7887 | 7895 | pixel_format = val & DISPPLANE_PIXFORMAT_MASK; |
| 7888 | 7896 | fourcc = i9xx_format_to_fourcc(pixel_format); |
| 7889 | 7897 | fb->format = drm_format_info(fourcc); |
| @@ -8952,6 +8960,29 @@ skylake_get_initial_plane_config(struct intel_crtc *crtc, · 1062 unmodified lines | ||
| 8952 | 8960 | goto error; |
| 8953 | 8961 | } |
| 8954 | 8962 | |
| 8963 | + /* | |
| 8964 | + * DRM_MODE_ROTATE_ is counter clockwise to stay compatible with Xrandr | |
| 8965 | + * while i915 HW rotation is clockwise, thats why this swapping. | |
| 8966 | + */ | |
| 8967 | + switch (val & PLANE_CTL_ROTATE_MASK) { | |
| 8968 | + case PLANE_CTL_ROTATE_0: | |
| 8969 | + plane_config->rotation = DRM_MODE_ROTATE_0; | |
| 8970 | + break; | |
| 8971 | + case PLANE_CTL_ROTATE_90: | |
| 8972 | + plane_config->rotation = DRM_MODE_ROTATE_270; | |
| 8973 | + break; | |
| 8974 | + case PLANE_CTL_ROTATE_180: | |
| 8975 | + plane_config->rotation = DRM_MODE_ROTATE_180; | |
| 8976 | + break; | |
| 8977 | + case PLANE_CTL_ROTATE_270: | |
| 8978 | + plane_config->rotation = DRM_MODE_ROTATE_90; | |
| 8979 | + break; | |
| 8980 | + } | |
| 8981 | + | |
| 8982 | + if (INTEL_GEN(dev_priv) >= 10 && | |
| 8983 | + val & PLANE_CTL_FLIP_HORIZONTAL) | |
| 8984 | + plane_config->rotation |= DRM_MODE_REFLECT_X; | |
| 8985 | + | |
| 8955 | 8986 | base = I915_READ(PLANE_SURF(pipe, plane_id)) & 0xfffff000; |
| 8956 | 8987 | plane_config->base = base; |
| 8957 | 8988 | |
| @@ -15267,6 +15298,14 @@ retry: · 6309 unmodified lines | ||
| 15267 | 15298 | ret = drm_atomic_add_affected_planes(state, crtc); |
| 15268 | 15299 | if (ret) |
| 15269 | 15300 | goto out; |
| 15301 | + | |
| 15302 | + /* | |
| 15303 | + * FIXME hack to force a LUT update to avoid the | |
| 15304 | + * plane update forcing the pipe gamma on without | |
| 15305 | + * having a proper LUT loaded. Remove once we | |
| 15306 | + * have readout for pipe gamma enable. | |
| 15307 | + */ | |
| 15308 | + crtc_state->color_mgmt_changed = true; | |
| 15270 | 15309 | } |
| 15271 | 15310 | } |
| 15272 | 15311 | |
| @@ -547,6 +547,7 @@ struct intel_initial_plane_config { · 546 unmodified lines | ||
| 547 | 547 | unsigned int tiling; |
| 548 | 548 | int size; |
| 549 | 549 | u32 base; |
| 550 | + u8 rotation; | |
| 550 | 551 | }; |
| 551 | 552 | |
| 552 | 553 | #define SKL_MIN_SRC_W 8 |
| @@ -2493,6 +2493,9 @@ static uint32_t ilk_compute_pri_wm(const struct intel_crtc_state *cstate, · 2492 unmodified lines | ||
| 2493 | 2493 | uint32_t method1, method2; |
| 2494 | 2494 | int cpp; |
| 2495 | 2495 | |
| 2496 | + if (mem_value == 0) | |
| 2497 | + return U32_MAX; | |
| 2498 | + | |
| 2496 | 2499 | if (!intel_wm_plane_visible(cstate, pstate)) |
| 2497 | 2500 | return 0; |
| 2498 | 2501 | |
| @@ -2522,6 +2525,9 @@ static uint32_t ilk_compute_spr_wm(const struct intel_crtc_state *cstate, · 23 unmodified lines | ||
| 2522 | 2525 | uint32_t method1, method2; |
| 2523 | 2526 | int cpp; |
| 2524 | 2527 | |
| 2528 | + if (mem_value == 0) | |
| 2529 | + return U32_MAX; | |
| 2530 | + | |
| 2525 | 2531 | if (!intel_wm_plane_visible(cstate, pstate)) |
| 2526 | 2532 | return 0; |
| 2527 | 2533 | |
| @@ -2545,6 +2551,9 @@ static uint32_t ilk_compute_cur_wm(const struct intel_crtc_state *cstate, · 17 unmodified lines | ||
| 2545 | 2551 | { |
| 2546 | 2552 | int cpp; |
| 2547 | 2553 | |
| 2554 | + if (mem_value == 0) | |
| 2555 | + return U32_MAX; | |
| 2556 | + | |
| 2548 | 2557 | if (!intel_wm_plane_visible(cstate, pstate)) |
| 2549 | 2558 | return 0; |
| 2550 | 2559 | |
| @@ -3008,6 +3017,34 @@ static void snb_wm_latency_quirk(struct drm_i915_private *dev_priv) · 457 unmodified lines | ||
| 3008 | 3017 | intel_print_wm_latency(dev_priv, "Cursor", dev_priv->wm.cur_latency); |
| 3009 | 3018 | } |
| 3010 | 3019 | |
| 3020 | +static void snb_wm_lp3_irq_quirk(struct drm_i915_private *dev_priv) | |
| 3021 | +{ | |
| 3022 | + /* | |
| 3023 | + * On some SNB machines (Thinkpad X220 Tablet at least) | |
| 3024 | + * LP3 usage can cause vblank interrupts to be lost. | |
| 3025 | + * The DEIIR bit will go high but it looks like the CPU | |
| 3026 | + * never gets interrupted. | |
| 3027 | + * | |
| 3028 | + * It's not clear whether other interrupt source could | |
| 3029 | + * be affected or if this is somehow limited to vblank | |
| 3030 | + * interrupts only. To play it safe we disable LP3 | |
| 3031 | + * watermarks entirely. | |
| 3032 | + */ | |
| 3033 | + if (dev_priv->wm.pri_latency[3] == 0 && | |
| 3034 | + dev_priv->wm.spr_latency[3] == 0 && | |
| 3035 | + dev_priv->wm.cur_latency[3] == 0) | |
| 3036 | + return; | |
| 3037 | + | |
| 3038 | + dev_priv->wm.pri_latency[3] = 0; | |
| 3039 | + dev_priv->wm.spr_latency[3] = 0; | |
| 3040 | + dev_priv->wm.cur_latency[3] = 0; | |
| 3041 | + | |
| 3042 | + DRM_DEBUG_KMS("LP3 watermarks disabled due to potential for lost interrupts\n"); | |
| 3043 | + intel_print_wm_latency(dev_priv, "Primary", dev_priv->wm.pri_latency); | |
| 3044 | + intel_print_wm_latency(dev_priv, "Sprite", dev_priv->wm.spr_latency); | |
| 3045 | + intel_print_wm_latency(dev_priv, "Cursor", dev_priv->wm.cur_latency); | |
| 3046 | +} | |
| 3047 | + | |
| 3011 | 3048 | static void ilk_setup_wm_latency(struct drm_i915_private *dev_priv) |
| 3012 | 3049 | { |
| 3013 | 3050 | intel_read_wm_latency(dev_priv, dev_priv->wm.pri_latency); |
| @@ -3024,8 +3061,10 @@ static void ilk_setup_wm_latency(struct drm_i915_private *dev_priv) · 10 unmodified lines | ||
| 3024 | 3061 | intel_print_wm_latency(dev_priv, "Sprite", dev_priv->wm.spr_latency); |
| 3025 | 3062 | intel_print_wm_latency(dev_priv, "Cursor", dev_priv->wm.cur_latency); |
| 3026 | 3063 | |
| 3027 | − if (IS_GEN6(dev_priv)) | |
| 3064 | + if (IS_GEN6(dev_priv)) { | |
| 3028 | 3065 | snb_wm_latency_quirk(dev_priv); |
| 3066 | + snb_wm_lp3_irq_quirk(dev_priv); | |
| 3067 | + } | |
| 3029 | 3068 | } |
| 3030 | 3069 | |
| 3031 | 3070 | static void skl_setup_wm_latency(struct drm_i915_private *dev_priv) |