diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-02-09 20:46:30 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-02-09 20:46:30 -0500 |
commit | 3d88460dbd285e7f32437b530d5bb7cb916142fa (patch) | |
tree | 3cc4f479bb3813bb4804f5ed4d52a493003c9fa5 | |
parent | 55aac6ef53e114c28170ee3f79065cfa8ca9cf3f (diff) | |
parent | 697d3a21615672b2bf7724a65755799260325dda (diff) |
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
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 14 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_execbuffer.c | 12 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_internal.c | 12 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_dpll_mgr.c | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/vc4/vc4_plane.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/vmwgfx/vmwgfx_fb.c | 3 |
8 files changed, 36 insertions, 18 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index b2c4a0b8a627..728ca3ea74d2 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c | |||
@@ -213,7 +213,8 @@ static void intel_detect_pch(struct drm_device *dev) | |||
213 | } else if (id == INTEL_PCH_KBP_DEVICE_ID_TYPE) { | 213 | } else if (id == INTEL_PCH_KBP_DEVICE_ID_TYPE) { |
214 | dev_priv->pch_type = PCH_KBP; | 214 | dev_priv->pch_type = PCH_KBP; |
215 | DRM_DEBUG_KMS("Found KabyPoint PCH\n"); | 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 | } else if ((id == INTEL_PCH_P2X_DEVICE_ID_TYPE) || | 218 | } else if ((id == INTEL_PCH_P2X_DEVICE_ID_TYPE) || |
218 | (id == INTEL_PCH_P3X_DEVICE_ID_TYPE) || | 219 | (id == INTEL_PCH_P3X_DEVICE_ID_TYPE) || |
219 | ((id == INTEL_PCH_QEMU_DEVICE_ID_TYPE) && | 220 | ((id == INTEL_PCH_QEMU_DEVICE_ID_TYPE) && |
@@ -2427,6 +2428,7 @@ static int intel_runtime_resume(struct device *kdev) | |||
2427 | * we can do is to hope that things will still work (and disable RPM). | 2428 | * we can do is to hope that things will still work (and disable RPM). |
2428 | */ | 2429 | */ |
2429 | i915_gem_init_swizzling(dev_priv); | 2430 | i915_gem_init_swizzling(dev_priv); |
2431 | i915_gem_restore_fences(dev_priv); | ||
2430 | 2432 | ||
2431 | intel_runtime_pm_enable_interrupts(dev_priv); | 2433 | intel_runtime_pm_enable_interrupts(dev_priv); |
2432 | 2434 | ||
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 4b23a7814713..24b5b046754b 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -2010,8 +2010,16 @@ void i915_gem_runtime_suspend(struct drm_i915_private *dev_priv) | |||
2010 | for (i = 0; i < dev_priv->num_fence_regs; i++) { | 2010 | for (i = 0; i < dev_priv->num_fence_regs; i++) { |
2011 | struct drm_i915_fence_reg *reg = &dev_priv->fence_regs[i]; | 2011 | struct drm_i915_fence_reg *reg = &dev_priv->fence_regs[i]; |
2012 | 2012 | ||
2013 | if (WARN_ON(reg->pin_count)) | 2013 | /* Ideally we want to assert that the fence register is not |
2014 | continue; | 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 | if (!reg->vma) | 2024 | if (!reg->vma) |
2017 | continue; | 2025 | continue; |
@@ -3478,7 +3486,7 @@ i915_gem_object_pin_to_display_plane(struct drm_i915_gem_object *obj, | |||
3478 | vma->display_alignment = max_t(u64, vma->display_alignment, alignment); | 3486 | vma->display_alignment = max_t(u64, vma->display_alignment, alignment); |
3479 | 3487 | ||
3480 | /* Treat this as an end-of-frame, like intel_user_framebuffer_dirty() */ | 3488 | /* Treat this as an end-of-frame, like intel_user_framebuffer_dirty() */ |
3481 | if (obj->cache_dirty) { | 3489 | if (obj->cache_dirty || obj->base.write_domain == I915_GEM_DOMAIN_CPU) { |
3482 | i915_gem_clflush_object(obj, true); | 3490 | i915_gem_clflush_object(obj, true); |
3483 | intel_fb_obj_flush(obj, false, ORIGIN_DIRTYFB); | 3491 | intel_fb_obj_flush(obj, false, ORIGIN_DIRTYFB); |
3484 | } | 3492 | } |
diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c index 097d9d8c2315..b8b877c91b0a 100644 --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c | |||
@@ -1181,14 +1181,14 @@ validate_exec_list(struct drm_device *dev, | |||
1181 | if (exec[i].offset != | 1181 | if (exec[i].offset != |
1182 | gen8_canonical_addr(exec[i].offset & PAGE_MASK)) | 1182 | gen8_canonical_addr(exec[i].offset & PAGE_MASK)) |
1183 | return -EINVAL; | 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 | } |
1191 | 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 | |||
1192 | if (exec[i].alignment && !is_power_of_2(exec[i].alignment)) | 1192 | if (exec[i].alignment && !is_power_of_2(exec[i].alignment)) |
1193 | return -EINVAL; | 1193 | return -EINVAL; |
1194 | 1194 | ||
diff --git a/drivers/gpu/drm/i915/i915_gem_internal.c b/drivers/gpu/drm/i915/i915_gem_internal.c index 4b3ff3e5b911..d09c74973cb3 100644 --- a/drivers/gpu/drm/i915/i915_gem_internal.c +++ b/drivers/gpu/drm/i915/i915_gem_internal.c | |||
@@ -66,8 +66,16 @@ i915_gem_object_get_pages_internal(struct drm_i915_gem_object *obj) | |||
66 | 66 | ||
67 | max_order = MAX_ORDER; | 67 | max_order = MAX_ORDER; |
68 | #ifdef CONFIG_SWIOTLB | 68 | #ifdef CONFIG_SWIOTLB |
69 | if (swiotlb_nr_tbl()) /* minimum max swiotlb size is IO_TLB_SEGSIZE */ | 69 | if (swiotlb_nr_tbl()) { |
70 | max_order = min(max_order, ilog2(IO_TLB_SEGPAGES)); | 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 | #endif | 79 | #endif |
72 | 80 | ||
73 | gfp = GFP_KERNEL | __GFP_HIGHMEM | __GFP_RECLAIMABLE; | 81 | gfp = GFP_KERNEL | __GFP_HIGHMEM | __GFP_RECLAIMABLE; |
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index f1e4a21d4664..891c86aef99d 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -4262,10 +4262,10 @@ static void page_flip_completed(struct intel_crtc *intel_crtc) | |||
4262 | drm_crtc_vblank_put(&intel_crtc->base); | 4262 | drm_crtc_vblank_put(&intel_crtc->base); |
4263 | 4263 | ||
4264 | wake_up_all(&dev_priv->pending_flip_queue); | 4264 | wake_up_all(&dev_priv->pending_flip_queue); |
4265 | queue_work(dev_priv->wq, &work->unpin_work); | ||
4266 | |||
4267 | trace_i915_flip_complete(intel_crtc->plane, | 4265 | trace_i915_flip_complete(intel_crtc->plane, |
4268 | work->pending_flip_obj); | 4266 | work->pending_flip_obj); |
4267 | |||
4268 | queue_work(dev_priv->wq, &work->unpin_work); | ||
4269 | } | 4269 | } |
4270 | 4270 | ||
4271 | static int intel_crtc_wait_for_pending_flips(struct drm_crtc *crtc) | 4271 | static int intel_crtc_wait_for_pending_flips(struct drm_crtc *crtc) |
diff --git a/drivers/gpu/drm/i915/intel_dpll_mgr.c b/drivers/gpu/drm/i915/intel_dpll_mgr.c index 58a756f2f224..a2f0e070d38d 100644 --- a/drivers/gpu/drm/i915/intel_dpll_mgr.c +++ b/drivers/gpu/drm/i915/intel_dpll_mgr.c | |||
@@ -1730,7 +1730,8 @@ bxt_get_dpll(struct intel_crtc *crtc, | |||
1730 | return NULL; | 1730 | return NULL; |
1731 | 1731 | ||
1732 | if ((encoder->type == INTEL_OUTPUT_DP || | 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 | !bxt_ddi_dp_set_dpll_hw_state(clock, &dpll_hw_state)) | 1735 | !bxt_ddi_dp_set_dpll_hw_state(clock, &dpll_hw_state)) |
1735 | return NULL; | 1736 | return NULL; |
1736 | 1737 | ||
diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c index 881bf489478b..686cdd3c86f2 100644 --- a/drivers/gpu/drm/vc4/vc4_plane.c +++ b/drivers/gpu/drm/vc4/vc4_plane.c | |||
@@ -858,7 +858,7 @@ struct drm_plane *vc4_plane_init(struct drm_device *dev, | |||
858 | } | 858 | } |
859 | } | 859 | } |
860 | plane = &vc4_plane->base; | 860 | plane = &vc4_plane->base; |
861 | ret = drm_universal_plane_init(dev, plane, 0xff, | 861 | ret = drm_universal_plane_init(dev, plane, 0, |
862 | &vc4_plane_funcs, | 862 | &vc4_plane_funcs, |
863 | formats, num_formats, | 863 | formats, num_formats, |
864 | type, NULL); | 864 | type, NULL); |
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c index 723fd763da8e..7a96798b9c0a 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c | |||
@@ -481,8 +481,7 @@ static int vmw_fb_kms_framebuffer(struct fb_info *info) | |||
481 | mode_cmd.height = var->yres; | 481 | mode_cmd.height = var->yres; |
482 | mode_cmd.pitches[0] = ((var->bits_per_pixel + 7) / 8) * mode_cmd.width; | 482 | mode_cmd.pitches[0] = ((var->bits_per_pixel + 7) / 8) * mode_cmd.width; |
483 | mode_cmd.pixel_format = | 483 | mode_cmd.pixel_format = |
484 | drm_mode_legacy_fb_format(var->bits_per_pixel, | 484 | drm_mode_legacy_fb_format(var->bits_per_pixel, depth); |
485 | ((var->bits_per_pixel + 7) / 8) * mode_cmd.width); | ||
486 | 485 | ||
487 | cur_fb = par->set_fb; | 486 | cur_fb = par->set_fb; |
488 | if (cur_fb && cur_fb->width == mode_cmd.width && | 487 | if (cur_fb && cur_fb->width == mode_cmd.width && |