diff options
author | Dave Airlie <airlied@redhat.com> | 2018-09-27 19:37:51 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2018-09-27 19:37:55 -0400 |
commit | db9825c95498280718c4687fcf712016f5b6f5f6 (patch) | |
tree | 01661a811bcd16a7b6f3ee9790e77da75fd178b0 /drivers/gpu/drm/i915/intel_lrc.c | |
parent | 156e60bc71aa31a3b42b1d66a822c2999bd0994c (diff) | |
parent | 448626103dad54ec5d06722e955586b5d557625d (diff) |
Merge tag 'drm-intel-next-2018-09-21' of git://anongit.freedesktop.org/drm/drm-intel into drm-next
Driver Changes:
- Bugzilla 107600: Fix stuttering video playback on MythTV on old hardware (Chris)
- Avoid black screen when using CSC coefficient matrix (Raviraj)
- Hammer PDs on Baytrail to make sure they reload (Chris)
- Capture some objects if unable to capture all, on error (Chris)
- Add W/A for 16 GB DIMMs on SKL+ (Mahesh)
- Only enable IPC for symmetric memory configurations on KBL+ (Mahesh)
- Assume pipe A to have maximum stride limits (Ville)
- Always update update OA contexts via context image (Tvrtko)
- Icelake enabling patches (Madhav, Dhinakaran)
- Add Icelake DMC firmware (Anusha)
- Fixes for CI found corner cases (Chris)
- Limit the backpressure for request allocation (Chris)
- Park GPU on module load so usage starts from known state (Chris)
- Flush tasklet when checking for idle (Chris)
- Use coherent write into the context image on BSW+ (Chris)
- Fix possible integer overflow for framebuffers that get aligned past 4GiB (Ville)
- Downgrade fence timeout from warn to notice and add debug hint (Chris)
- Fixes to multi function encoder code (Ville)
- Fix sprite plane check logic (Dan, Ville)
- PAGE_SIZE vs. I915_GTT_PAGE_SIZE fixes (Ville)
- Decode memory bandwidth and parameters for BXT and SKL+ (Mahesh)
- Overwrite BIOS set IPC value from KMS (Mahesh)
- Multiple pipe handling code cleanups/restructurings/optimizations (Ville)
- Spare low 4G address for non-48bit objects (Chris)
- Free context_setparam of struct_mutex (Chris)
- Delay updating ring register state on resume (Chris)
- Avoid unnecessarily copying overlay IOCTL parameters (Chris)
- Update GuC power domain states even without submission (Michal)
- Restore GuC preempt-context across S3/S4 (Chris)
- Add kernel selftest for rapid context switching (Chris)
- Keep runtime power management ref for live selftests (Chris)
- GEM code cleanups (Matt)
Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180927095933.GA11458@jlahtine-desk.ger.corp.intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/intel_lrc.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_lrc.c | 57 |
1 files changed, 30 insertions, 27 deletions
diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c index 9b1f0e5211a0..43957bb37a42 100644 --- a/drivers/gpu/drm/i915/intel_lrc.c +++ b/drivers/gpu/drm/i915/intel_lrc.c | |||
@@ -1294,7 +1294,7 @@ static int __context_pin(struct i915_gem_context *ctx, struct i915_vma *vma) | |||
1294 | * on an active context (which by nature is already on the GPU). | 1294 | * on an active context (which by nature is already on the GPU). |
1295 | */ | 1295 | */ |
1296 | if (!(vma->flags & I915_VMA_GLOBAL_BIND)) { | 1296 | if (!(vma->flags & I915_VMA_GLOBAL_BIND)) { |
1297 | err = i915_gem_object_set_to_gtt_domain(vma->obj, true); | 1297 | err = i915_gem_object_set_to_wc_domain(vma->obj, true); |
1298 | if (err) | 1298 | if (err) |
1299 | return err; | 1299 | return err; |
1300 | } | 1300 | } |
@@ -1322,7 +1322,9 @@ __execlists_context_pin(struct intel_engine_cs *engine, | |||
1322 | if (ret) | 1322 | if (ret) |
1323 | goto err; | 1323 | goto err; |
1324 | 1324 | ||
1325 | vaddr = i915_gem_object_pin_map(ce->state->obj, I915_MAP_WB); | 1325 | vaddr = i915_gem_object_pin_map(ce->state->obj, |
1326 | i915_coherent_map_type(ctx->i915) | | ||
1327 | I915_MAP_OVERRIDE); | ||
1326 | if (IS_ERR(vaddr)) { | 1328 | if (IS_ERR(vaddr)) { |
1327 | ret = PTR_ERR(vaddr); | 1329 | ret = PTR_ERR(vaddr); |
1328 | goto unpin_vma; | 1330 | goto unpin_vma; |
@@ -1338,11 +1340,13 @@ __execlists_context_pin(struct intel_engine_cs *engine, | |||
1338 | 1340 | ||
1339 | intel_lr_context_descriptor_update(ctx, engine, ce); | 1341 | intel_lr_context_descriptor_update(ctx, engine, ce); |
1340 | 1342 | ||
1343 | GEM_BUG_ON(!intel_ring_offset_valid(ce->ring, ce->ring->head)); | ||
1344 | |||
1341 | ce->lrc_reg_state = vaddr + LRC_STATE_PN * PAGE_SIZE; | 1345 | ce->lrc_reg_state = vaddr + LRC_STATE_PN * PAGE_SIZE; |
1342 | ce->lrc_reg_state[CTX_RING_BUFFER_START+1] = | 1346 | ce->lrc_reg_state[CTX_RING_BUFFER_START+1] = |
1343 | i915_ggtt_offset(ce->ring->vma); | 1347 | i915_ggtt_offset(ce->ring->vma); |
1344 | GEM_BUG_ON(!intel_ring_offset_valid(ce->ring, ce->ring->head)); | 1348 | ce->lrc_reg_state[CTX_RING_HEAD + 1] = ce->ring->head; |
1345 | ce->lrc_reg_state[CTX_RING_HEAD+1] = ce->ring->head; | 1349 | ce->lrc_reg_state[CTX_RING_TAIL + 1] = ce->ring->tail; |
1346 | 1350 | ||
1347 | ce->state->obj->pin_global++; | 1351 | ce->state->obj->pin_global++; |
1348 | i915_gem_context_get(ctx); | 1352 | i915_gem_context_get(ctx); |
@@ -2392,7 +2396,7 @@ static int logical_ring_init(struct intel_engine_cs *engine) | |||
2392 | 2396 | ||
2393 | ret = intel_engine_init_common(engine); | 2397 | ret = intel_engine_init_common(engine); |
2394 | if (ret) | 2398 | if (ret) |
2395 | goto error; | 2399 | return ret; |
2396 | 2400 | ||
2397 | if (HAS_LOGICAL_RING_ELSQ(i915)) { | 2401 | if (HAS_LOGICAL_RING_ELSQ(i915)) { |
2398 | execlists->submit_reg = i915->regs + | 2402 | execlists->submit_reg = i915->regs + |
@@ -2434,10 +2438,6 @@ static int logical_ring_init(struct intel_engine_cs *engine) | |||
2434 | reset_csb_pointers(execlists); | 2438 | reset_csb_pointers(execlists); |
2435 | 2439 | ||
2436 | return 0; | 2440 | return 0; |
2437 | |||
2438 | error: | ||
2439 | intel_logical_ring_cleanup(engine); | ||
2440 | return ret; | ||
2441 | } | 2441 | } |
2442 | 2442 | ||
2443 | int logical_render_ring_init(struct intel_engine_cs *engine) | 2443 | int logical_render_ring_init(struct intel_engine_cs *engine) |
@@ -2460,10 +2460,14 @@ int logical_render_ring_init(struct intel_engine_cs *engine) | |||
2460 | engine->emit_breadcrumb = gen8_emit_breadcrumb_rcs; | 2460 | engine->emit_breadcrumb = gen8_emit_breadcrumb_rcs; |
2461 | engine->emit_breadcrumb_sz = gen8_emit_breadcrumb_rcs_sz; | 2461 | engine->emit_breadcrumb_sz = gen8_emit_breadcrumb_rcs_sz; |
2462 | 2462 | ||
2463 | ret = intel_engine_create_scratch(engine, PAGE_SIZE); | 2463 | ret = logical_ring_init(engine); |
2464 | if (ret) | 2464 | if (ret) |
2465 | return ret; | 2465 | return ret; |
2466 | 2466 | ||
2467 | ret = intel_engine_create_scratch(engine, PAGE_SIZE); | ||
2468 | if (ret) | ||
2469 | goto err_cleanup_common; | ||
2470 | |||
2467 | ret = intel_init_workaround_bb(engine); | 2471 | ret = intel_init_workaround_bb(engine); |
2468 | if (ret) { | 2472 | if (ret) { |
2469 | /* | 2473 | /* |
@@ -2475,7 +2479,11 @@ int logical_render_ring_init(struct intel_engine_cs *engine) | |||
2475 | ret); | 2479 | ret); |
2476 | } | 2480 | } |
2477 | 2481 | ||
2478 | return logical_ring_init(engine); | 2482 | return 0; |
2483 | |||
2484 | err_cleanup_common: | ||
2485 | intel_engine_cleanup_common(engine); | ||
2486 | return ret; | ||
2479 | } | 2487 | } |
2480 | 2488 | ||
2481 | int logical_xcs_ring_init(struct intel_engine_cs *engine) | 2489 | int logical_xcs_ring_init(struct intel_engine_cs *engine) |
@@ -2841,13 +2849,14 @@ error_deref_obj: | |||
2841 | return ret; | 2849 | return ret; |
2842 | } | 2850 | } |
2843 | 2851 | ||
2844 | void intel_lr_context_resume(struct drm_i915_private *dev_priv) | 2852 | void intel_lr_context_resume(struct drm_i915_private *i915) |
2845 | { | 2853 | { |
2846 | struct intel_engine_cs *engine; | 2854 | struct intel_engine_cs *engine; |
2847 | struct i915_gem_context *ctx; | 2855 | struct i915_gem_context *ctx; |
2848 | enum intel_engine_id id; | 2856 | enum intel_engine_id id; |
2849 | 2857 | ||
2850 | /* Because we emit WA_TAIL_DWORDS there may be a disparity | 2858 | /* |
2859 | * Because we emit WA_TAIL_DWORDS there may be a disparity | ||
2851 | * between our bookkeeping in ce->ring->head and ce->ring->tail and | 2860 | * between our bookkeeping in ce->ring->head and ce->ring->tail and |
2852 | * that stored in context. As we only write new commands from | 2861 | * that stored in context. As we only write new commands from |
2853 | * ce->ring->tail onwards, everything before that is junk. If the GPU | 2862 | * ce->ring->tail onwards, everything before that is junk. If the GPU |
@@ -2857,28 +2866,22 @@ void intel_lr_context_resume(struct drm_i915_private *dev_priv) | |||
2857 | * So to avoid that we reset the context images upon resume. For | 2866 | * So to avoid that we reset the context images upon resume. For |
2858 | * simplicity, we just zero everything out. | 2867 | * simplicity, we just zero everything out. |
2859 | */ | 2868 | */ |
2860 | list_for_each_entry(ctx, &dev_priv->contexts.list, link) { | 2869 | list_for_each_entry(ctx, &i915->contexts.list, link) { |
2861 | for_each_engine(engine, dev_priv, id) { | 2870 | for_each_engine(engine, i915, id) { |
2862 | struct intel_context *ce = | 2871 | struct intel_context *ce = |
2863 | to_intel_context(ctx, engine); | 2872 | to_intel_context(ctx, engine); |
2864 | u32 *reg; | ||
2865 | 2873 | ||
2866 | if (!ce->state) | 2874 | if (!ce->state) |
2867 | continue; | 2875 | continue; |
2868 | 2876 | ||
2869 | reg = i915_gem_object_pin_map(ce->state->obj, | 2877 | intel_ring_reset(ce->ring, 0); |
2870 | I915_MAP_WB); | ||
2871 | if (WARN_ON(IS_ERR(reg))) | ||
2872 | continue; | ||
2873 | |||
2874 | reg += LRC_STATE_PN * PAGE_SIZE / sizeof(*reg); | ||
2875 | reg[CTX_RING_HEAD+1] = 0; | ||
2876 | reg[CTX_RING_TAIL+1] = 0; | ||
2877 | 2878 | ||
2878 | ce->state->obj->mm.dirty = true; | 2879 | if (ce->pin_count) { /* otherwise done in context_pin */ |
2879 | i915_gem_object_unpin_map(ce->state->obj); | 2880 | u32 *regs = ce->lrc_reg_state; |
2880 | 2881 | ||
2881 | intel_ring_reset(ce->ring, 0); | 2882 | regs[CTX_RING_HEAD + 1] = ce->ring->head; |
2883 | regs[CTX_RING_TAIL + 1] = ce->ring->tail; | ||
2884 | } | ||
2882 | } | 2885 | } |
2883 | } | 2886 | } |
2884 | } | 2887 | } |