History

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

Pull drm fixes from Dave Airlie: "A varied bunch of fixes, one for an API regression with connectors. Otherwise amdgpu and i915 have a bunch of varied fixes, the shrinker ones being the most important" * tag 'drm-fixes-for-v4.12-rc7' of git://people.freedesktop.org/~airlied/linux: drm: Fix GETCONNECTOR regression drm/radeon: add a quirk for Toshiba Satellite L20-183 drm/radeon: add a PX quirk for another K53TK variant drm/amdgpu: adjust default display clock drm/amdgpu/atom: fix ps allocation size for EnableDispPowerGating drm/amdgpu: add Polaris12 DID drm/i915: Don't enable backlight at setup time. drm/i915: Plumb the correct acquire ctx into intel_crtc_disable_noatomic() drm/i915: Fix deadlock witha the pipe A quirk during resume drm/i915: Remove __GFP_NORETRY from our buffer allocator drm/i915: Encourage our shrinker more when our shmemfs allocations fails drm/i915: Differentiate between sw write location into ring and last hw read

Linus Torvalds committed 9 years ago

Commit 311548f2 parents 7139a06 33ce75614 files · +145 −80Browse files

Unified · Split

14 files
  1. drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c +4 −0
  2. drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +1 −0
  3. drivers/gpu/drm/amd/amdgpu/atombios_crtc.c +2 −2
  4. drivers/gpu/drm/drm_connector.c +20 −18
  5. drivers/gpu/drm/i915/i915_gem.c +42 −21
  6. drivers/gpu/drm/i915/i915_gem_request.c +1 −1
  7. drivers/gpu/drm/i915/i915_guc_submission.c +1 −3
  8. drivers/gpu/drm/i915/intel_display.c +17 −13
  9. drivers/gpu/drm/i915/intel_dp_aux_backlight.c +0 −2
  10. drivers/gpu/drm/i915/intel_lrc.c +2 −4
  11. drivers/gpu/drm/i915/intel_ringbuffer.c +27 −14
  12. drivers/gpu/drm/i915/intel_ringbuffer.h +17 −2
  13. drivers/gpu/drm/radeon/radeon_combios.c +7 −0
  14. drivers/gpu/drm/radeon/radeon_device.c +4 −0
drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c+4−0
@@ -693,6 +693,10 @@ int amdgpu_atombios_get_clock_info(struct amdgpu_device *adev) · 692 unmodified lines
693693 DRM_INFO("Changing default dispclk from %dMhz to 600Mhz\n",
694694 adev->clock.default_dispclk / 100);
695695 adev->clock.default_dispclk = 60000;
696+ } else if (adev->clock.default_dispclk <= 60000) {
697+ DRM_INFO("Changing default dispclk from %dMhz to 625Mhz\n",
698+ adev->clock.default_dispclk / 100);
699+ adev->clock.default_dispclk = 62500;
696700 }
697701 adev->clock.dp_extclk =
698702 le16_to_cpu(firmware_info->info_21.usUniphyDPModeExtClkFreq);
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c+1−0
@@ -449,6 +449,7 @@ static const struct pci_device_id pciidlist[] = { · 448 unmodified lines
449449 {0x1002, 0x6986, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS12},
450450 {0x1002, 0x6987, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS12},
451451 {0x1002, 0x6995, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS12},
452+ {0x1002, 0x6997, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS12},
452453 {0x1002, 0x699F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS12},
453454 /* Vega 10 */
454455 {0x1002, 0x6860, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VEGA10|AMD_EXP_HW_SUPPORT},
drivers/gpu/drm/amd/amdgpu/atombios_crtc.c+2−2
@@ -165,7 +165,7 @@ void amdgpu_atombios_crtc_powergate(struct drm_crtc *crtc, int state) · 164 unmodified lines
165165 struct drm_device *dev = crtc->dev;
166166 struct amdgpu_device *adev = dev->dev_private;
167167 int index = GetIndexIntoMasterTable(COMMAND, EnableDispPowerGating);
168− ENABLE_DISP_POWER_GATING_PARAMETERS_V2_1 args;
168+ ENABLE_DISP_POWER_GATING_PS_ALLOCATION args;
169169
170170 memset(&args, 0, sizeof(args));
171171
@@ -178,7 +178,7 @@ void amdgpu_atombios_crtc_powergate(struct drm_crtc *crtc, int state) · 6 unmodified lines
178178 void amdgpu_atombios_crtc_powergate_init(struct amdgpu_device *adev)
179179 {
180180 int index = GetIndexIntoMasterTable(COMMAND, EnableDispPowerGating);
181− ENABLE_DISP_POWER_GATING_PARAMETERS_V2_1 args;
181+ ENABLE_DISP_POWER_GATING_PS_ALLOCATION args;
182182
183183 memset(&args, 0, sizeof(args));
184184
drivers/gpu/drm/drm_connector.c+20−18
@@ -1229,21 +1229,6 @@ int drm_mode_getconnector(struct drm_device *dev, void *data, · 1228 unmodified lines
12291229 if (!connector)
12301230 return -ENOENT;
12311231
1232− drm_modeset_lock(&dev->mode_config.connection_mutex, NULL);
1233− encoder = drm_connector_get_encoder(connector);
1234− if (encoder)
1235− out_resp->encoder_id = encoder->base.id;
1236− else
1237− out_resp->encoder_id = 0;
1238−
1239− ret = drm_mode_object_get_properties(&connector->base, file_priv->atomic,
1240− (uint32_t __user *)(unsigned long)(out_resp->props_ptr),
1241− (uint64_t __user *)(unsigned long)(out_resp->prop_values_ptr),
1242− &out_resp->count_props);
1243− drm_modeset_unlock(&dev->mode_config.connection_mutex);
1244− if (ret)
1245− goto out_unref;
1246−
12471232 for (i = 0; i < DRM_CONNECTOR_MAX_ENCODER; i++)
12481233 if (connector->encoder_ids[i] != 0)
12491234 encoders_count++;
@@ -1256,7 +1241,7 @@ int drm_mode_getconnector(struct drm_device *dev, void *data, · 6 unmodified lines
12561241 if (put_user(connector->encoder_ids[i],
12571242 encoder_ptr + copied)) {
12581243 ret = -EFAULT;
1259− goto out_unref;
1244+ goto out;
12601245 }
12611246 copied++;
12621247 }
@@ -1300,15 +1285,32 @@ int drm_mode_getconnector(struct drm_device *dev, void *data, · 37 unmodified lines
13001285 if (copy_to_user(mode_ptr + copied,
13011286 &u_mode, sizeof(u_mode))) {
13021287 ret = -EFAULT;
1288+ mutex_unlock(&dev->mode_config.mutex);
1289+
13031290 goto out;
13041291 }
13051292 copied++;
13061293 }
13071294 }
13081295 out_resp->count_modes = mode_count;
1309−out:
13101296 mutex_unlock(&dev->mode_config.mutex);
1311−out_unref:
1297+
1298+ drm_modeset_lock(&dev->mode_config.connection_mutex, NULL);
1299+ encoder = drm_connector_get_encoder(connector);
1300+ if (encoder)
1301+ out_resp->encoder_id = encoder->base.id;
1302+ else
1303+ out_resp->encoder_id = 0;
1304+
1305+ /* Only grab properties after probing, to make sure EDID and other
1306+ * properties reflect the latest status. */
1307+ ret = drm_mode_object_get_properties(&connector->base, file_priv->atomic,
1308+ (uint32_t __user *)(unsigned long)(out_resp->props_ptr),
1309+ (uint64_t __user *)(unsigned long)(out_resp->prop_values_ptr),
1310+ &out_resp->count_props);
1311+ drm_modeset_unlock(&dev->mode_config.connection_mutex);
1312+
1313+out:
13121314 drm_connector_put(connector);
13131315
13141316 return ret;
drivers/gpu/drm/i915/i915_gem.c+42−21
@@ -2285,8 +2285,8 @@ i915_gem_object_get_pages_gtt(struct drm_i915_gem_object *obj) · 2284 unmodified lines
22852285 struct page *page;
22862286 unsigned long last_pfn = 0; /* suppress gcc warning */
22872287 unsigned int max_segment;
2288+ gfp_t noreclaim;
22882289 int ret;
2289− gfp_t gfp;
22902290
22912291 /* Assert that the object is not currently in any GPU domain. As it
22922292 * wasn't in the GTT, there shouldn't be any way it could have been in
@@ -2315,22 +2315,31 @@ rebuild_st: · 22 unmodified lines
23152315 * Fail silently without starting the shrinker
23162316 */
23172317 mapping = obj->base.filp->f_mapping;
2318− gfp = mapping_gfp_constraint(mapping, ~(__GFP_IO | __GFP_RECLAIM));
2319− gfp |= __GFP_NORETRY | __GFP_NOWARN;
2318+ noreclaim = mapping_gfp_constraint(mapping,
2319+ ~(__GFP_IO | __GFP_RECLAIM));
2320+ noreclaim |= __GFP_NORETRY | __GFP_NOWARN;
2321+
23202322 sg = st->sgl;
23212323 st->nents = 0;
23222324 for (i = 0; i < page_count; i++) {
2323− page = shmem_read_mapping_page_gfp(mapping, i, gfp);
2324− if (unlikely(IS_ERR(page))) {
2325− i915_gem_shrink(dev_priv,
2326− page_count,
2327− I915_SHRINK_BOUND |
2328− I915_SHRINK_UNBOUND |
2329− I915_SHRINK_PURGEABLE);
2325+ const unsigned int shrink[] = {
2326+ I915_SHRINK_BOUND | I915_SHRINK_UNBOUND | I915_SHRINK_PURGEABLE,
2327+ 0,
2328+ }, *s = shrink;
2329+ gfp_t gfp = noreclaim;
2330+
2331+ do {
23302332 page = shmem_read_mapping_page_gfp(mapping, i, gfp);
2331− }
2332− if (unlikely(IS_ERR(page))) {
2333− gfp_t reclaim;
2333+ if (likely(!IS_ERR(page)))
2334+ break;
2335+
2336+ if (!*s) {
2337+ ret = PTR_ERR(page);
2338+ goto err_sg;
2339+ }
2340+
2341+ i915_gem_shrink(dev_priv, 2 * page_count, *s++);
2342+ cond_resched();
23342343
23352344 /* We've tried hard to allocate the memory by reaping
23362345 * our own buffer, now let the real VM do its job and
@@ -2340,15 +2349,26 @@ rebuild_st: · 3 unmodified lines
23402349 * defer the oom here by reporting the ENOMEM back
23412350 * to userspace.
23422351 */
2343− reclaim = mapping_gfp_mask(mapping);
2344− reclaim |= __GFP_NORETRY; /* reclaim, but no oom */
2345−
2346− page = shmem_read_mapping_page_gfp(mapping, i, reclaim);
2347− if (IS_ERR(page)) {
2348− ret = PTR_ERR(page);
2349− goto err_sg;
2352+ if (!*s) {
2353+ /* reclaim and warn, but no oom */
2354+ gfp = mapping_gfp_mask(mapping);
2355+
2356+ /* Our bo are always dirty and so we require
2357+ * kswapd to reclaim our pages (direct reclaim
2358+ * does not effectively begin pageout of our
2359+ * buffers on its own). However, direct reclaim
2360+ * only waits for kswapd when under allocation
2361+ * congestion. So as a result __GFP_RECLAIM is
2362+ * unreliable and fails to actually reclaim our
2363+ * dirty pages -- unless you try over and over
2364+ * again with !__GFP_NORETRY. However, we still
2365+ * want to fail this allocation rather than
2366+ * trigger the out-of-memory killer and for
2367+ * this we want the future __GFP_MAYFAIL.
2368+ */
23502369 }
2351− }
2370+ } while (1);
2371+
23522372 if (!i ||
23532373 sg->length >= max_segment ||
23542374 page_to_pfn(page) != last_pfn + 1) {
@@ -4222,6 +4242,7 @@ i915_gem_object_create(struct drm_i915_private *dev_priv, u64 size) · 1867 unmodified lines
42224242
42234243 mapping = obj->base.filp->f_mapping;
42244244 mapping_set_gfp_mask(mapping, mask);
4245+ GEM_BUG_ON(!(mapping_gfp_mask(mapping) & __GFP_RECLAIM));
42254246
42264247 i915_gem_object_init(obj, &i915_gem_object_ops);
42274248
drivers/gpu/drm/i915/i915_gem_request.c+1−1
@@ -623,7 +623,7 @@ i915_gem_request_alloc(struct intel_engine_cs *engine, · 622 unmodified lines
623623 * GPU processing the request, we never over-estimate the
624624 * position of the head.
625625 */
626− req->head = req->ring->tail;
626+ req->head = req->ring->emit;
627627
628628 /* Check that we didn't interrupt ourselves with a new request */
629629 GEM_BUG_ON(req->timeline->seqno != req->fence.seqno);
drivers/gpu/drm/i915/i915_guc_submission.c+1−3
@@ -480,9 +480,7 @@ static void guc_wq_item_append(struct i915_guc_client *client, · 479 unmodified lines
480480 GEM_BUG_ON(freespace < wqi_size);
481481
482482 /* The GuC firmware wants the tail index in QWords, not bytes */
483− tail = rq->tail;
484− assert_ring_tail_valid(rq->ring, rq->tail);
485− tail >>= 3;
483+ tail = intel_ring_set_tail(rq->ring, rq->tail) >> 3;
486484 GEM_BUG_ON(tail > WQ_RING_TAIL_MAX);
487485
488486 /* For now workqueue item is 4 DWs; workqueue buffer is 2 pages. So we
drivers/gpu/drm/i915/intel_display.c+17−13
@@ -120,7 +120,8 @@ static void intel_crtc_init_scalers(struct intel_crtc *crtc, · 119 unmodified lines
120120 static void skylake_pfit_enable(struct intel_crtc *crtc);
121121 static void ironlake_pfit_disable(struct intel_crtc *crtc, bool force);
122122 static void ironlake_pfit_enable(struct intel_crtc *crtc);
123−static void intel_modeset_setup_hw_state(struct drm_device *dev);
123+static void intel_modeset_setup_hw_state(struct drm_device *dev,
124+ struct drm_modeset_acquire_ctx *ctx);
124125 static void intel_pre_disable_primary_noatomic(struct drm_crtc *crtc);
125126
126127 struct intel_limit {
@@ -3449,7 +3450,7 @@ __intel_display_resume(struct drm_device *dev, · 3322 unmodified lines
34493450 struct drm_crtc *crtc;
34503451 int i, ret;
34513452
3452− intel_modeset_setup_hw_state(dev);
3453+ intel_modeset_setup_hw_state(dev, ctx);
34533454 i915_redisable_vga(to_i915(dev));
34543455
34553456 if (!state)
@@ -5825,7 +5826,8 @@ static void i9xx_crtc_disable(struct intel_crtc_state *old_crtc_state, · 2369 unmodified lines
58255826 intel_update_watermarks(intel_crtc);
58265827 }
58275828
5828−static void intel_crtc_disable_noatomic(struct drm_crtc *crtc)
5829+static void intel_crtc_disable_noatomic(struct drm_crtc *crtc,
5830+ struct drm_modeset_acquire_ctx *ctx)
58295831 {
58305832 struct intel_encoder *encoder;
58315833 struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
@@ -5855,7 +5857,7 @@ static void intel_crtc_disable_noatomic(struct drm_crtc *crtc) · 23 unmodified lines
58555857 return;
58565858 }
58575859
5858− state->acquire_ctx = crtc->dev->mode_config.acquire_ctx;
5860+ state->acquire_ctx = ctx;
58595861
58605862 /* Everything's already locked, -EDEADLK can't happen. */
58615863 crtc_state = intel_atomic_get_crtc_state(state, intel_crtc);
@@ -15030,7 +15032,7 @@ int intel_modeset_init(struct drm_device *dev) · 9168 unmodified lines
1503015032 intel_setup_outputs(dev_priv);
1503115033
1503215034 drm_modeset_lock_all(dev);
15033− intel_modeset_setup_hw_state(dev);
15035+ intel_modeset_setup_hw_state(dev, dev->mode_config.acquire_ctx);
1503415036 drm_modeset_unlock_all(dev);
1503515037
1503615038 for_each_intel_crtc(dev, crtc) {
@@ -15067,13 +15069,13 @@ int intel_modeset_init(struct drm_device *dev) · 30 unmodified lines
1506715069 return 0;
1506815070 }
1506915071
15070−static void intel_enable_pipe_a(struct drm_device *dev)
15072+static void intel_enable_pipe_a(struct drm_device *dev,
15073+ struct drm_modeset_acquire_ctx *ctx)
1507115074 {
1507215075 struct intel_connector *connector;
1507315076 struct drm_connector_list_iter conn_iter;
1507415077 struct drm_connector *crt = NULL;
1507515078 struct intel_load_detect_pipe load_detect_temp;
15076− struct drm_modeset_acquire_ctx *ctx = dev->mode_config.acquire_ctx;
1507715079 int ret;
1507815080
1507915081 /* We can't just switch on the pipe A, we need to set things up with a
@@ -15145,7 +15147,8 @@ static bool has_pch_trancoder(struct drm_i915_private *dev_priv, · 65 unmodified lines
1514515147 (HAS_PCH_LPT_H(dev_priv) && pch_transcoder == TRANSCODER_A);
1514615148 }
1514715149
15148−static void intel_sanitize_crtc(struct intel_crtc *crtc)
15150+static void intel_sanitize_crtc(struct intel_crtc *crtc,
15151+ struct drm_modeset_acquire_ctx *ctx)
1514915152 {
1515015153 struct drm_device *dev = crtc->base.dev;
1515115154 struct drm_i915_private *dev_priv = to_i915(dev);
@@ -15191,7 +15194,7 @@ static void intel_sanitize_crtc(struct intel_crtc *crtc) · 39 unmodified lines
1519115194 plane = crtc->plane;
1519215195 crtc->base.primary->state->visible = true;
1519315196 crtc->plane = !plane;
15194− intel_crtc_disable_noatomic(&crtc->base);
15197+ intel_crtc_disable_noatomic(&crtc->base, ctx);
1519515198 crtc->plane = plane;
1519615199 }
1519715200
@@ -15201,13 +15204,13 @@ static void intel_sanitize_crtc(struct intel_crtc *crtc) · 3 unmodified lines
1520115204 * resume. Force-enable the pipe to fix this, the update_dpms
1520215205 * call below we restore the pipe to the right state, but leave
1520315206 * the required bits on. */
15204− intel_enable_pipe_a(dev);
15207+ intel_enable_pipe_a(dev, ctx);
1520515208 }
1520615209
1520715210 /* Adjust the state of the output pipe according to whether we
1520815211 * have active connectors/encoders. */
1520915212 if (crtc->active && !intel_crtc_has_encoders(crtc))
15210− intel_crtc_disable_noatomic(&crtc->base);
15213+ intel_crtc_disable_noatomic(&crtc->base, ctx);
1521115214
1521215215 if (crtc->active || HAS_GMCH_DISPLAY(dev_priv)) {
1521315216 /*
@@ -15505,7 +15508,8 @@ get_encoder_power_domains(struct drm_i915_private *dev_priv) · 291 unmodified lines
1550515508 * and sanitizes it to the current state
1550615509 */
1550715510 static void
15508−intel_modeset_setup_hw_state(struct drm_device *dev)
15511+intel_modeset_setup_hw_state(struct drm_device *dev,
15512+ struct drm_modeset_acquire_ctx *ctx)
1550915513 {
1551015514 struct drm_i915_private *dev_priv = to_i915(dev);
1551115515 enum pipe pipe;
@@ -15525,7 +15529,7 @@ intel_modeset_setup_hw_state(struct drm_device *dev) · 13 unmodified lines
1552515529 for_each_pipe(dev_priv, pipe) {
1552615530 crtc = intel_get_crtc_for_pipe(dev_priv, pipe);
1552715531
15528− intel_sanitize_crtc(crtc);
15532+ intel_sanitize_crtc(crtc, ctx);
1552915533 intel_dump_pipe_config(crtc, crtc->config,
1553015534 "[setup_hw_state]");
1553115535 }
drivers/gpu/drm/i915/intel_dp_aux_backlight.c+0−2
@@ -119,8 +119,6 @@ static int intel_dp_aux_setup_backlight(struct intel_connector *connector, · 118 unmodified lines
119119 struct intel_dp *intel_dp = enc_to_intel_dp(&connector->encoder->base);
120120 struct intel_panel *panel = &connector->panel;
121121
122− intel_dp_aux_enable_backlight(connector);
123−
124122 if (intel_dp->edp_dpcd[2] & DP_EDP_BACKLIGHT_BRIGHTNESS_BYTE_COUNT)
125123 panel->backlight.max = 0xFFFF;
126124 else
drivers/gpu/drm/i915/intel_lrc.c+2−4
@@ -326,8 +326,7 @@ static u64 execlists_update_context(struct drm_i915_gem_request *rq) · 325 unmodified lines
326326 rq->ctx->ppgtt ?: rq->i915->mm.aliasing_ppgtt;
327327 u32 *reg_state = ce->lrc_reg_state;
328328
329− assert_ring_tail_valid(rq->ring, rq->tail);
330− reg_state[CTX_RING_TAIL+1] = rq->tail;
329+ reg_state[CTX_RING_TAIL+1] = intel_ring_set_tail(rq->ring, rq->tail);
331330
332331 /* True 32b PPGTT with dynamic page allocation: update PDP
333332 * registers and point the unallocated PDPs to scratch page.
@@ -2036,8 +2035,7 @@ void intel_lr_context_resume(struct drm_i915_private *dev_priv) · 1702 unmodified lines
20362035 ce->state->obj->mm.dirty = true;
20372036 i915_gem_object_unpin_map(ce->state->obj);
20382037
2039− ce->ring->head = ce->ring->tail = 0;
2040− intel_ring_update_space(ce->ring);
2038+ intel_ring_reset(ce->ring, 0);
20412039 }
20422040 }
20432041 }
drivers/gpu/drm/i915/intel_ringbuffer.c+27−14
@@ -49,7 +49,7 @@ static int __intel_ring_space(int head, int tail, int size) · 48 unmodified lines
4949
5050 void intel_ring_update_space(struct intel_ring *ring)
5151 {
52− ring->space = __intel_ring_space(ring->head, ring->tail, ring->size);
52+ ring->space = __intel_ring_space(ring->head, ring->emit, ring->size);
5353 }
5454
5555 static int
@@ -774,8 +774,8 @@ static void i9xx_submit_request(struct drm_i915_gem_request *request) · 718 unmodified lines
774774
775775 i915_gem_request_submit(request);
776776
777− assert_ring_tail_valid(request->ring, request->tail);
778− I915_WRITE_TAIL(request->engine, request->tail);
777+ I915_WRITE_TAIL(request->engine,
778+ intel_ring_set_tail(request->ring, request->tail));
779779 }
780780
781781 static void i9xx_emit_breadcrumb(struct drm_i915_gem_request *req, u32 *cs)
@@ -1316,11 +1316,23 @@ err: · 534 unmodified lines
13161316 return PTR_ERR(addr);
13171317 }
13181318
1319+void intel_ring_reset(struct intel_ring *ring, u32 tail)
1320+{
1321+ GEM_BUG_ON(!list_empty(&ring->request_list));
1322+ ring->tail = tail;
1323+ ring->head = tail;
1324+ ring->emit = tail;
1325+ intel_ring_update_space(ring);
1326+}
1327+
13191328 void intel_ring_unpin(struct intel_ring *ring)
13201329 {
13211330 GEM_BUG_ON(!ring->vma);
13221331 GEM_BUG_ON(!ring->vaddr);
13231332
1333+ /* Discard any unused bytes beyond that submitted to hw. */
1334+ intel_ring_reset(ring, ring->tail);
1335+
13241336 if (i915_vma_is_map_and_fenceable(ring->vma))
13251337 i915_vma_unpin_iomap(ring->vma);
13261338 else
@@ -1562,8 +1574,9 @@ void intel_legacy_submission_resume(struct drm_i915_private *dev_priv) · 235 unmodified lines
15621574 struct intel_engine_cs *engine;
15631575 enum intel_engine_id id;
15641576
1577+ /* Restart from the beginning of the rings for convenience */
15651578 for_each_engine(engine, dev_priv, id)
1566− engine->buffer->head = engine->buffer->tail;
1579+ intel_ring_reset(engine->buffer, 0);
15671580 }
15681581
15691582 static int ring_request_alloc(struct drm_i915_gem_request *request)
@@ -1616,7 +1629,7 @@ static int wait_for_space(struct drm_i915_gem_request *req, int bytes) · 46 unmodified lines
16161629 unsigned space;
16171630
16181631 /* Would completion of this request free enough space? */
1619− space = __intel_ring_space(target->postfix, ring->tail,
1632+ space = __intel_ring_space(target->postfix, ring->emit,
16201633 ring->size);
16211634 if (space >= bytes)
16221635 break;
@@ -1641,8 +1654,8 @@ static int wait_for_space(struct drm_i915_gem_request *req, int bytes) · 18 unmodified lines
16411654 u32 *intel_ring_begin(struct drm_i915_gem_request *req, int num_dwords)
16421655 {
16431656 struct intel_ring *ring = req->ring;
1644− int remain_actual = ring->size - ring->tail;
1645− int remain_usable = ring->effective_size - ring->tail;
1657+ int remain_actual = ring->size - ring->emit;
1658+ int remain_usable = ring->effective_size - ring->emit;
16461659 int bytes = num_dwords * sizeof(u32);
16471660 int total_bytes, wait_bytes;
16481661 bool need_wrap = false;
@@ -1678,17 +1691,17 @@ u32 *intel_ring_begin(struct drm_i915_gem_request *req, int num_dwords) · 29 unmodified lines
16781691
16791692 if (unlikely(need_wrap)) {
16801693 GEM_BUG_ON(remain_actual > ring->space);
1681− GEM_BUG_ON(ring->tail + remain_actual > ring->size);
1694+ GEM_BUG_ON(ring->emit + remain_actual > ring->size);
16821695
16831696 /* Fill the tail with MI_NOOP */
1684− memset(ring->vaddr + ring->tail, 0, remain_actual);
1685− ring->tail = 0;
1697+ memset(ring->vaddr + ring->emit, 0, remain_actual);
1698+ ring->emit = 0;
16861699 ring->space -= remain_actual;
16871700 }
16881701
1689− GEM_BUG_ON(ring->tail > ring->size - bytes);
1690− cs = ring->vaddr + ring->tail;
1691− ring->tail += bytes;
1702+ GEM_BUG_ON(ring->emit > ring->size - bytes);
1703+ cs = ring->vaddr + ring->emit;
1704+ ring->emit += bytes;
16921705 ring->space -= bytes;
16931706 GEM_BUG_ON(ring->space < 0);
16941707
@@ -1699,7 +1712,7 @@ u32 *intel_ring_begin(struct drm_i915_gem_request *req, int num_dwords) · 4 unmodified lines
16991712 int intel_ring_cacheline_align(struct drm_i915_gem_request *req)
17001713 {
17011714 int num_dwords =
1702− (req->ring->tail & (CACHELINE_BYTES - 1)) / sizeof(uint32_t);
1715+ (req->ring->emit & (CACHELINE_BYTES - 1)) / sizeof(uint32_t);
17031716 u32 *cs;
17041717
17051718 if (num_dwords == 0)
drivers/gpu/drm/i915/intel_ringbuffer.h+17−2
@@ -145,6 +145,7 @@ struct intel_ring { · 144 unmodified lines
145145
146146 u32 head;
147147 u32 tail;
148+ u32 emit;
148149
149150 int space;
150151 int size;
@@ -488,6 +489,8 @@ intel_write_status_page(struct intel_engine_cs *engine, int reg, u32 value) · 337 unmodified lines
488489 struct intel_ring *
489490 intel_engine_create_ring(struct intel_engine_cs *engine, int size);
490491 int intel_ring_pin(struct intel_ring *ring, unsigned int offset_bias);
492+void intel_ring_reset(struct intel_ring *ring, u32 tail);
493+void intel_ring_update_space(struct intel_ring *ring);
491494 void intel_ring_unpin(struct intel_ring *ring);
492495 void intel_ring_free(struct intel_ring *ring);
493496
@@ -511,7 +514,7 @@ intel_ring_advance(struct drm_i915_gem_request *req, u32 *cs) · 17 unmodified lines
511514 * reserved for the command packet (i.e. the value passed to
512515 * intel_ring_begin()).
513516 */
514− GEM_BUG_ON((req->ring->vaddr + req->ring->tail) != cs);
517+ GEM_BUG_ON((req->ring->vaddr + req->ring->emit) != cs);
515518 }
516519
517520 static inline u32
@@ -540,7 +543,19 @@ assert_ring_tail_valid(const struct intel_ring *ring, unsigned int tail) · 22 unmodified lines
540543 GEM_BUG_ON(tail >= ring->size);
541544 }
542545
543−void intel_ring_update_space(struct intel_ring *ring);
546+static inline unsigned int
547+intel_ring_set_tail(struct intel_ring *ring, unsigned int tail)
548+{
549+ /* Whilst writes to the tail are strictly order, there is no
550+ * serialisation between readers and the writers. The tail may be
551+ * read by i915_gem_request_retire() just as it is being updated
552+ * by execlists, as although the breadcrumb is complete, the context
553+ * switch hasn't been seen.
554+ */
555+ assert_ring_tail_valid(ring, tail);
556+ ring->tail = tail;
557+ return tail;
558+}
544559
545560 void intel_engine_init_global_seqno(struct intel_engine_cs *engine, u32 seqno);
546561
drivers/gpu/drm/radeon/radeon_combios.c+7−0
@@ -3393,6 +3393,13 @@ void radeon_combios_asic_init(struct drm_device *dev) · 3392 unmodified lines
33933393 rdev->pdev->subsystem_vendor == 0x103c &&
33943394 rdev->pdev->subsystem_device == 0x280a)
33953395 return;
3396+ /* quirk for rs4xx Toshiba Sattellite L20-183 latop to make it resume
3397+ * - it hangs on resume inside the dynclk 1 table.
3398+ */
3399+ if (rdev->family == CHIP_RS400 &&
3400+ rdev->pdev->subsystem_vendor == 0x1179 &&
3401+ rdev->pdev->subsystem_device == 0xff31)
3402+ return;
33963403
33973404 /* DYN CLK 1 */
33983405 table = combios_get_table_offset(dev, COMBIOS_DYN_CLK_1_TABLE);
drivers/gpu/drm/radeon/radeon_device.c+4−0
@@ -136,6 +136,10 @@ static struct radeon_px_quirk radeon_px_quirk_list[] = { · 135 unmodified lines
136136 * https://bugzilla.kernel.org/show_bug.cgi?id=51381
137137 */
138138 { PCI_VENDOR_ID_ATI, 0x6840, 0x1043, 0x2122, RADEON_PX_QUIRK_DISABLE_PX },
139+ /* Asus K53TK laptop with AMD A6-3420M APU and Radeon 7670m GPU
140+ * https://bugs.freedesktop.org/show_bug.cgi?id=101491
141+ */
142+ { PCI_VENDOR_ID_ATI, 0x6741, 0x1043, 0x2122, RADEON_PX_QUIRK_DISABLE_PX },
139143 /* macbook pro 8.2 */
140144 { PCI_VENDOR_ID_ATI, 0x6741, PCI_VENDOR_ID_APPLE, 0x00e2, RADEON_PX_QUIRK_LONG_WAKEUP },
141145 { 0, 0, 0, 0, 0 },

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t