Merge tag 'drm-fixes-for-v4.10-rc8' of git://people.freedesktop.org/~airlied/linux

Pull drm fixes from Dave Airlie:
"This should be the final set of drm fixes for 4.10: one vmwgfx boot
fix, one vc4 fix, and a few i915 fixes:

* tag 'drm-fixes-for-v4.10-rc8' of git://people.freedesktop.org/~airlied/linux:
drm: vc4: adapt to new behaviour of drm_crtc.c
drm/i915: Always convert incoming exec offsets to non-canonical
drm/i915: Remove overzealous fence warn on runtime suspend
drm/i915/bxt: Add MST support when do DPLL calculation
drm/i915: don't warn about Skylake CPU - KabyPoint PCH combo
drm/i915: fix i915 running as dom0 under Xen
drm/i915: Flush untouched framebuffers before display on !llc
drm/i915: fix use-after-free in page_flip_completed()
drm/vmwgfx: Fix depth input into drm_mode_legacy_fb_format

+3 -1
drivers/gpu/drm/i915/i915_drv.c
··· 213 213 } else if (id == INTEL_PCH_KBP_DEVICE_ID_TYPE) { 214 214 dev_priv->pch_type = PCH_KBP; 215 215 DRM_DEBUG_KMS("Found KabyPoint PCH\n"); 216 - WARN_ON(!IS_KABYLAKE(dev_priv)); 216 + WARN_ON(!IS_SKYLAKE(dev_priv) && 217 + !IS_KABYLAKE(dev_priv)); 217 218 } else if ((id == INTEL_PCH_P2X_DEVICE_ID_TYPE) || 218 219 (id == INTEL_PCH_P3X_DEVICE_ID_TYPE) || 219 220 ((id == INTEL_PCH_QEMU_DEVICE_ID_TYPE) && ··· 2428 2427 * we can do is to hope that things will still work (and disable RPM). 2429 2428 */ 2430 2429 i915_gem_init_swizzling(dev_priv); 2430 + i915_gem_restore_fences(dev_priv); 2431 2431 2432 2432 intel_runtime_pm_enable_interrupts(dev_priv); 2433 2433
+11 -3
drivers/gpu/drm/i915/i915_gem.c
··· 2010 2010 for (i = 0; i < dev_priv->num_fence_regs; i++) { 2011 2011 struct drm_i915_fence_reg *reg = &dev_priv->fence_regs[i]; 2012 2012 2013 - if (WARN_ON(reg->pin_count)) 2014 - continue; 2013 + /* Ideally we want to assert that the fence register is not 2014 + * live at this point (i.e. that no piece of code will be 2015 + * trying to write through fence + GTT, as that both violates 2016 + * our tracking of activity and associated locking/barriers, 2017 + * but also is illegal given that the hw is powered down). 2018 + * 2019 + * Previously we used reg->pin_count as a "liveness" indicator. 2020 + * That is not sufficient, and we need a more fine-grained 2021 + * tool if we want to have a sanity check here. 2022 + */ 2015 2023 2016 2024 if (!reg->vma) 2017 2025 continue; ··· 3486 3478 vma->display_alignment = max_t(u64, vma->display_alignment, alignment); 3487 3479 3488 3480 /* Treat this as an end-of-frame, like intel_user_framebuffer_dirty() */ 3489 - if (obj->cache_dirty) { 3481 + if (obj->cache_dirty || obj->base.write_domain == I915_GEM_DOMAIN_CPU) { 3490 3482 i915_gem_clflush_object(obj, true); 3491 3483 intel_fb_obj_flush(obj, false, ORIGIN_DIRTYFB); 3492 3484 }
+6 -6
drivers/gpu/drm/i915/i915_gem_execbuffer.c
··· 1181 1181 if (exec[i].offset != 1182 1182 gen8_canonical_addr(exec[i].offset & PAGE_MASK)) 1183 1183 return -EINVAL; 1184 - 1185 - /* From drm_mm perspective address space is continuous, 1186 - * so from this point we're always using non-canonical 1187 - * form internally. 1188 - */ 1189 - exec[i].offset = gen8_noncanonical_addr(exec[i].offset); 1190 1184 } 1185 + 1186 + /* From drm_mm perspective address space is continuous, 1187 + * so from this point we're always using non-canonical 1188 + * form internally. 1189 + */ 1190 + exec[i].offset = gen8_noncanonical_addr(exec[i].offset); 1191 1191 1192 1192 if (exec[i].alignment && !is_power_of_2(exec[i].alignment)) 1193 1193 return -EINVAL;
+10 -2
drivers/gpu/drm/i915/i915_gem_internal.c
··· 66 66 67 67 max_order = MAX_ORDER; 68 68 #ifdef CONFIG_SWIOTLB 69 - if (swiotlb_nr_tbl()) /* minimum max swiotlb size is IO_TLB_SEGSIZE */ 70 - max_order = min(max_order, ilog2(IO_TLB_SEGPAGES)); 69 + if (swiotlb_nr_tbl()) { 70 + unsigned int max_segment; 71 + 72 + max_segment = swiotlb_max_segment(); 73 + if (max_segment) { 74 + max_segment = max_t(unsigned int, max_segment, 75 + PAGE_SIZE) >> PAGE_SHIFT; 76 + max_order = min(max_order, ilog2(max_segment)); 77 + } 78 + } 71 79 #endif 72 80 73 81 gfp = GFP_KERNEL | __GFP_HIGHMEM | __GFP_RECLAIMABLE;
+2 -2
drivers/gpu/drm/i915/intel_display.c
··· 4262 4262 drm_crtc_vblank_put(&intel_crtc->base); 4263 4263 4264 4264 wake_up_all(&dev_priv->pending_flip_queue); 4265 - queue_work(dev_priv->wq, &work->unpin_work); 4266 - 4267 4265 trace_i915_flip_complete(intel_crtc->plane, 4268 4266 work->pending_flip_obj); 4267 + 4268 + queue_work(dev_priv->wq, &work->unpin_work); 4269 4269 } 4270 4270 4271 4271 static int intel_crtc_wait_for_pending_flips(struct drm_crtc *crtc)
+2 -1
drivers/gpu/drm/i915/intel_dpll_mgr.c
··· 1730 1730 return NULL; 1731 1731 1732 1732 if ((encoder->type == INTEL_OUTPUT_DP || 1733 - encoder->type == INTEL_OUTPUT_EDP) && 1733 + encoder->type == INTEL_OUTPUT_EDP || 1734 + encoder->type == INTEL_OUTPUT_DP_MST) && 1734 1735 !bxt_ddi_dp_set_dpll_hw_state(clock, &dpll_hw_state)) 1735 1736 return NULL; 1736 1737
+1 -1
drivers/gpu/drm/vc4/vc4_plane.c
··· 858 858 } 859 859 } 860 860 plane = &vc4_plane->base; 861 - ret = drm_universal_plane_init(dev, plane, 0xff, 861 + ret = drm_universal_plane_init(dev, plane, 0, 862 862 &vc4_plane_funcs, 863 863 formats, num_formats, 864 864 type, NULL);
+1 -2
drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
··· 481 481 mode_cmd.height = var->yres; 482 482 mode_cmd.pitches[0] = ((var->bits_per_pixel + 7) / 8) * mode_cmd.width; 483 483 mode_cmd.pixel_format = 484 - drm_mode_legacy_fb_format(var->bits_per_pixel, 485 - ((var->bits_per_pixel + 7) / 8) * mode_cmd.width); 484 + drm_mode_legacy_fb_format(var->bits_per_pixel, depth); 486 485 487 486 cur_fb = par->set_fb; 488 487 if (cur_fb && cur_fb->width == mode_cmd.width &&