Skip to content

Commit 3d88460

Browse files
committed
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
2 parents 55aac6e + 697d3a2 commit 3d88460

File tree

8 files changed

+36
-18
lines changed

8 files changed

+36
-18
lines changed

drivers/gpu/drm/i915/i915_drv.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,8 @@ static void intel_detect_pch(struct drm_device *dev)
213213
} else if (id == INTEL_PCH_KBP_DEVICE_ID_TYPE) {
214214
dev_priv->pch_type = PCH_KBP;
215215
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));
217218
} else if ((id == INTEL_PCH_P2X_DEVICE_ID_TYPE) ||
218219
(id == INTEL_PCH_P3X_DEVICE_ID_TYPE) ||
219220
((id == INTEL_PCH_QEMU_DEVICE_ID_TYPE) &&
@@ -2427,6 +2428,7 @@ static int intel_runtime_resume(struct device *kdev)
24272428
* we can do is to hope that things will still work (and disable RPM).
24282429
*/
24292430
i915_gem_init_swizzling(dev_priv);
2431+
i915_gem_restore_fences(dev_priv);
24302432

24312433
intel_runtime_pm_enable_interrupts(dev_priv);
24322434

drivers/gpu/drm/i915/i915_gem.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2010,8 +2010,16 @@ void i915_gem_runtime_suspend(struct drm_i915_private *dev_priv)
20102010
for (i = 0; i < dev_priv->num_fence_regs; i++) {
20112011
struct drm_i915_fence_reg *reg = &dev_priv->fence_regs[i];
20122012

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+
*/
20152023

20162024
if (!reg->vma)
20172025
continue;
@@ -3478,7 +3486,7 @@ i915_gem_object_pin_to_display_plane(struct drm_i915_gem_object *obj,
34783486
vma->display_alignment = max_t(u64, vma->display_alignment, alignment);
34793487

34803488
/* 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) {
34823490
i915_gem_clflush_object(obj, true);
34833491
intel_fb_obj_flush(obj, false, ORIGIN_DIRTYFB);
34843492
}

drivers/gpu/drm/i915/i915_gem_execbuffer.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1181,14 +1181,14 @@ validate_exec_list(struct drm_device *dev,
11811181
if (exec[i].offset !=
11821182
gen8_canonical_addr(exec[i].offset & PAGE_MASK))
11831183
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);
11901184
}
11911185

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+
11921192
if (exec[i].alignment && !is_power_of_2(exec[i].alignment))
11931193
return -EINVAL;
11941194

drivers/gpu/drm/i915/i915_gem_internal.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,16 @@ i915_gem_object_get_pages_internal(struct drm_i915_gem_object *obj)
6666

6767
max_order = MAX_ORDER;
6868
#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+
}
7179
#endif
7280

7381
gfp = GFP_KERNEL | __GFP_HIGHMEM | __GFP_RECLAIMABLE;

drivers/gpu/drm/i915/intel_display.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4262,10 +4262,10 @@ static void page_flip_completed(struct intel_crtc *intel_crtc)
42624262
drm_crtc_vblank_put(&intel_crtc->base);
42634263

42644264
wake_up_all(&dev_priv->pending_flip_queue);
4265-
queue_work(dev_priv->wq, &work->unpin_work);
4266-
42674265
trace_i915_flip_complete(intel_crtc->plane,
42684266
work->pending_flip_obj);
4267+
4268+
queue_work(dev_priv->wq, &work->unpin_work);
42694269
}
42704270

42714271
static int intel_crtc_wait_for_pending_flips(struct drm_crtc *crtc)

drivers/gpu/drm/i915/intel_dpll_mgr.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1730,7 +1730,8 @@ bxt_get_dpll(struct intel_crtc *crtc,
17301730
return NULL;
17311731

17321732
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) &&
17341735
!bxt_ddi_dp_set_dpll_hw_state(clock, &dpll_hw_state))
17351736
return NULL;
17361737

drivers/gpu/drm/vc4/vc4_plane.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,7 @@ struct drm_plane *vc4_plane_init(struct drm_device *dev,
858858
}
859859
}
860860
plane = &vc4_plane->base;
861-
ret = drm_universal_plane_init(dev, plane, 0xff,
861+
ret = drm_universal_plane_init(dev, plane, 0,
862862
&vc4_plane_funcs,
863863
formats, num_formats,
864864
type, NULL);

drivers/gpu/drm/vmwgfx/vmwgfx_fb.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -481,8 +481,7 @@ static int vmw_fb_kms_framebuffer(struct fb_info *info)
481481
mode_cmd.height = var->yres;
482482
mode_cmd.pitches[0] = ((var->bits_per_pixel + 7) / 8) * mode_cmd.width;
483483
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);
486485

487486
cur_fb = par->set_fb;
488487
if (cur_fb && cur_fb->width == mode_cmd.width &&

0 commit comments

Comments
 (0)