Skip to content

Commit 7d95565

Browse files
committed
Merge tag 'drm-intel-next-fixes-2017-09-07' of git://anongit.freedesktop.org/git/drm-intel
Pull i916 drm fixes from Rodrigo Vivi: "Since Dave is on paternity leave we are sending drm/i915 fixes for v4.14-rc1 directly to you as he had asked us to do. The most critical ones are the GPU reset fix for gen2-4 and GVT fix for a regression that is blocking gvt init to work on your tree. The rest is general fixes for patches coming from drm-next" Acked-by: Dave Airlie <airlied@redhat.com> * tag 'drm-intel-next-fixes-2017-09-07' of git://anongit.freedesktop.org/git/drm-intel: drm/i915: Re-enable GTT following a device reset drm/i915: Annotate user relocs with __user drm/i915: Silence sparse by using gfp_t drm/i915: Add __rcu to radix tree slot pointer drm/i915: Fix the missing PPAT cache attributes on CNL drm/i915/gvt: Remove one duplicated MMIO drm/i915: Fix enum pipe vs. enum transcoder for the PCH transcoder drm/i915: Make i2c lock ops static drm/i915: Make i9xx_load_ycbcr_conversion_matrix() static drm/i915/edp: Increase T12 panel delay to 900 ms to fix DP AUX CH timeouts drm/i915: Ignore duplicate VMA stored within the per-object handle LUT drm/i915: Skip fence alignemnt check for the CCS plane drm/i915: Treat fb->offsets[] as a raw byte offset instead of a linear offset drm/i915: Always wake the device to flush the GTT drm/i915: Recreate vmapping even when the object is pinned drm/i915: Quietly cancel FBC activation if CRTC is turned off before worker
2 parents 5f9cc57 + 426ca2c commit 7d95565

16 files changed

Lines changed: 130 additions & 85 deletions

‎drivers/gpu/drm/i915/gvt/handlers.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2659,7 +2659,6 @@ static int init_skl_mmio_info(struct intel_gvt *gvt)
26592659
MMIO_D(HSW_PWR_WELL_CTL_BIOS(SKL_DISP_PW_MISC_IO), D_SKL_PLUS);
26602660
MMIO_DH(HSW_PWR_WELL_CTL_DRIVER(SKL_DISP_PW_MISC_IO), D_SKL_PLUS, NULL,
26612661
skl_power_well_ctl_write);
2662-
MMIO_DH(GEN6_PCODE_MAILBOX, D_SKL_PLUS, NULL, mailbox_write);
26632662

26642663
MMIO_D(0xa210, D_SKL_PLUS);
26652664
MMIO_D(GEN9_MEDIA_PG_IDLE_HYSTERESIS, D_SKL_PLUS);

‎drivers/gpu/drm/i915/i915_cmd_parser.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,7 @@ static u32 *copy_batch(struct drm_i915_gem_object *dst_obj,
10731073
goto unpin_src;
10741074
}
10751075

1076-
dst = i915_gem_object_pin_map(dst_obj, I915_MAP_WB);
1076+
dst = i915_gem_object_pin_map(dst_obj, I915_MAP_FORCE_WB);
10771077
if (IS_ERR(dst))
10781078
goto unpin_dst;
10791079

‎drivers/gpu/drm/i915/i915_drv.c‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1891,9 +1891,15 @@ void i915_reset(struct drm_i915_private *i915, unsigned int flags)
18911891

18921892
/*
18931893
* Everything depends on having the GTT running, so we need to start
1894-
* there. Fortunately we don't need to do this unless we reset the
1895-
* chip at a PCI level.
1896-
*
1894+
* there.
1895+
*/
1896+
ret = i915_ggtt_enable_hw(i915);
1897+
if (ret) {
1898+
DRM_ERROR("Failed to re-enable GGTT following reset %d\n", ret);
1899+
goto error;
1900+
}
1901+
1902+
/*
18971903
* Next we need to restore the context, but we don't use those
18981904
* yet either...
18991905
*

‎drivers/gpu/drm/i915/i915_drv.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3479,6 +3479,9 @@ void __i915_gem_object_invalidate(struct drm_i915_gem_object *obj);
34793479
enum i915_map_type {
34803480
I915_MAP_WB = 0,
34813481
I915_MAP_WC,
3482+
#define I915_MAP_OVERRIDE BIT(31)
3483+
I915_MAP_FORCE_WB = I915_MAP_WB | I915_MAP_OVERRIDE,
3484+
I915_MAP_FORCE_WC = I915_MAP_WC | I915_MAP_OVERRIDE,
34823485
};
34833486

34843487
/**

‎drivers/gpu/drm/i915/i915_gem.c‎

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -695,12 +695,11 @@ flush_write_domain(struct drm_i915_gem_object *obj, unsigned int flush_domains)
695695
switch (obj->base.write_domain) {
696696
case I915_GEM_DOMAIN_GTT:
697697
if (INTEL_GEN(dev_priv) >= 6 && !HAS_LLC(dev_priv)) {
698-
if (intel_runtime_pm_get_if_in_use(dev_priv)) {
699-
spin_lock_irq(&dev_priv->uncore.lock);
700-
POSTING_READ_FW(RING_ACTHD(dev_priv->engine[RCS]->mmio_base));
701-
spin_unlock_irq(&dev_priv->uncore.lock);
702-
intel_runtime_pm_put(dev_priv);
703-
}
698+
intel_runtime_pm_get(dev_priv);
699+
spin_lock_irq(&dev_priv->uncore.lock);
700+
POSTING_READ_FW(RING_ACTHD(dev_priv->engine[RCS]->mmio_base));
701+
spin_unlock_irq(&dev_priv->uncore.lock);
702+
intel_runtime_pm_put(dev_priv);
704703
}
705704

706705
intel_fb_obj_flush(obj,
@@ -2213,7 +2212,7 @@ i915_gem_object_put_pages_gtt(struct drm_i915_gem_object *obj,
22132212
static void __i915_gem_object_reset_page_iter(struct drm_i915_gem_object *obj)
22142213
{
22152214
struct radix_tree_iter iter;
2216-
void **slot;
2215+
void __rcu **slot;
22172216

22182217
radix_tree_for_each_slot(slot, &obj->mm.get_page.radix, &iter, 0)
22192218
radix_tree_delete(&obj->mm.get_page.radix, iter.index);
@@ -2553,6 +2552,9 @@ static void *i915_gem_object_map(const struct drm_i915_gem_object *obj,
25532552
GEM_BUG_ON(i != n_pages);
25542553

25552554
switch (type) {
2555+
default:
2556+
MISSING_CASE(type);
2557+
/* fallthrough to use PAGE_KERNEL anyway */
25562558
case I915_MAP_WB:
25572559
pgprot = PAGE_KERNEL;
25582560
break;
@@ -2583,7 +2585,9 @@ void *i915_gem_object_pin_map(struct drm_i915_gem_object *obj,
25832585
if (ret)
25842586
return ERR_PTR(ret);
25852587

2586-
pinned = true;
2588+
pinned = !(type & I915_MAP_OVERRIDE);
2589+
type &= ~I915_MAP_OVERRIDE;
2590+
25872591
if (!atomic_inc_not_zero(&obj->mm.pages_pin_count)) {
25882592
if (unlikely(IS_ERR_OR_NULL(obj->mm.pages))) {
25892593
ret = ____i915_gem_object_get_pages(obj);
@@ -3258,7 +3262,13 @@ void i915_gem_close_object(struct drm_gem_object *gem, struct drm_file *file)
32583262

32593263
vma = radix_tree_delete(&ctx->handles_vma, lut->handle);
32603264

3261-
if (!i915_vma_is_ggtt(vma))
3265+
GEM_BUG_ON(vma->obj != obj);
3266+
3267+
/* We allow the process to have multiple handles to the same
3268+
* vma, in the same fd namespace, by virtue of flink/open.
3269+
*/
3270+
GEM_BUG_ON(!vma->open_count);
3271+
if (!--vma->open_count && !i915_vma_is_ggtt(vma))
32623272
i915_vma_close(vma);
32633273

32643274
list_del(&lut->obj_link);

‎drivers/gpu/drm/i915/i915_gem_execbuffer.c‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ static int eb_create(struct i915_execbuffer *eb)
285285
* direct lookup.
286286
*/
287287
do {
288-
unsigned int flags;
288+
gfp_t flags;
289289

290290
/* While we can still reduce the allocation size, don't
291291
* raise a warning and allow the allocation to fail.
@@ -720,6 +720,7 @@ static int eb_lookup_vmas(struct i915_execbuffer *eb)
720720
goto err_obj;
721721
}
722722

723+
vma->open_count++;
723724
list_add(&lut->obj_link, &obj->lut_list);
724725
list_add(&lut->ctx_link, &eb->ctx->handles_list);
725726
lut->ctx = eb->ctx;
@@ -1070,7 +1071,9 @@ static int __reloc_gpu_alloc(struct i915_execbuffer *eb,
10701071
return PTR_ERR(obj);
10711072

10721073
cmd = i915_gem_object_pin_map(obj,
1073-
cache->has_llc ? I915_MAP_WB : I915_MAP_WC);
1074+
cache->has_llc ?
1075+
I915_MAP_FORCE_WB :
1076+
I915_MAP_FORCE_WC);
10741077
i915_gem_object_unpin_pages(obj);
10751078
if (IS_ERR(cmd))
10761079
return PTR_ERR(cmd);
@@ -1526,7 +1529,7 @@ static int eb_copy_relocations(const struct i915_execbuffer *eb)
15261529
min_t(u64, BIT_ULL(31), size - copied);
15271530

15281531
if (__copy_from_user((char *)relocs + copied,
1529-
(char *)urelocs + copied,
1532+
(char __user *)urelocs + copied,
15301533
len)) {
15311534
kvfree(relocs);
15321535
err = -EFAULT;

‎drivers/gpu/drm/i915/i915_gem_gtt.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2754,10 +2754,10 @@ static void cnl_setup_private_ppat(struct drm_i915_private *dev_priv)
27542754
I915_WRITE(GEN10_PAT_INDEX(1), GEN8_PPAT_WC | GEN8_PPAT_LLCELLC);
27552755
I915_WRITE(GEN10_PAT_INDEX(2), GEN8_PPAT_WT | GEN8_PPAT_LLCELLC);
27562756
I915_WRITE(GEN10_PAT_INDEX(3), GEN8_PPAT_UC);
2757-
I915_WRITE(GEN10_PAT_INDEX(4), GEN8_PPAT_LLCELLC | GEN8_PPAT_AGE(0));
2758-
I915_WRITE(GEN10_PAT_INDEX(5), GEN8_PPAT_LLCELLC | GEN8_PPAT_AGE(1));
2759-
I915_WRITE(GEN10_PAT_INDEX(6), GEN8_PPAT_LLCELLC | GEN8_PPAT_AGE(2));
2760-
I915_WRITE(GEN10_PAT_INDEX(7), GEN8_PPAT_LLCELLC | GEN8_PPAT_AGE(3));
2757+
I915_WRITE(GEN10_PAT_INDEX(4), GEN8_PPAT_WB | GEN8_PPAT_LLCELLC | GEN8_PPAT_AGE(0));
2758+
I915_WRITE(GEN10_PAT_INDEX(5), GEN8_PPAT_WB | GEN8_PPAT_LLCELLC | GEN8_PPAT_AGE(1));
2759+
I915_WRITE(GEN10_PAT_INDEX(6), GEN8_PPAT_WB | GEN8_PPAT_LLCELLC | GEN8_PPAT_AGE(2));
2760+
I915_WRITE(GEN10_PAT_INDEX(7), GEN8_PPAT_WB | GEN8_PPAT_LLCELLC | GEN8_PPAT_AGE(3));
27612761
}
27622762

27632763
/* The GGTT and PPGTT need a private PPAT setup in order to handle cacheability

‎drivers/gpu/drm/i915/i915_trace.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ TRACE_EVENT(intel_cpu_fifo_underrun,
3838
);
3939

4040
TRACE_EVENT(intel_pch_fifo_underrun,
41-
TP_PROTO(struct drm_i915_private *dev_priv, enum transcoder pch_transcoder),
41+
TP_PROTO(struct drm_i915_private *dev_priv, enum pipe pch_transcoder),
4242
TP_ARGS(dev_priv, pch_transcoder),
4343

4444
TP_STRUCT__entry(
@@ -48,7 +48,7 @@ TRACE_EVENT(intel_pch_fifo_underrun,
4848
),
4949

5050
TP_fast_assign(
51-
enum pipe pipe = (enum pipe)pch_transcoder;
51+
enum pipe pipe = pch_transcoder;
5252
__entry->pipe = pipe;
5353
__entry->frame = dev_priv->drm.driver->get_vblank_counter(&dev_priv->drm, pipe);
5454
__entry->scanline = intel_get_crtc_scanline(intel_get_crtc_for_pipe(dev_priv, pipe));

‎drivers/gpu/drm/i915/i915_vma.h‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ struct i915_vma {
5959
u32 fence_size;
6060
u32 fence_alignment;
6161

62+
/**
63+
* Count of the number of times this vma has been opened by different
64+
* handles (but same file) for execbuf, i.e. the number of aliases
65+
* that exist in the ctx->handle_vmas LUT for this vma.
66+
*/
67+
unsigned int open_count;
6268
unsigned int flags;
6369
/**
6470
* How many users have pinned this object in GTT space. The following

‎drivers/gpu/drm/i915/intel_color.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ static void ctm_mult_by_limited(uint64_t *result, int64_t *input)
107107
}
108108
}
109109

110-
void i9xx_load_ycbcr_conversion_matrix(struct intel_crtc *intel_crtc)
110+
static void i9xx_load_ycbcr_conversion_matrix(struct intel_crtc *intel_crtc)
111111
{
112112
int pipe = intel_crtc->pipe;
113113
struct drm_i915_private *dev_priv = to_i915(intel_crtc->base.dev);

0 commit comments

Comments
 (0)