The biggest fix is the restoration of mmap ioctl for gen12 integrated parts which lack was breaking ADL-P with media stack. Besides that a small selftest fix and a theoretical overflow on i915->pipe_to_crtc_mapping. Signed-off-by: Dave Airlie <airlied@redhat.com>
Unified · Split
| @@ -9618,7 +9618,6 @@ static int intel_atomic_check_bigjoiner(struct intel_atomic_state *state, · 9617 unmodified lines | ||
| 9618 | 9618 | struct intel_crtc_state *old_crtc_state, |
| 9619 | 9619 | struct intel_crtc_state *new_crtc_state) |
| 9620 | 9620 | { |
| 9621 | − struct drm_i915_private *dev_priv = to_i915(state->base.dev); | |
| 9622 | 9621 | struct intel_crtc_state *slave_crtc_state, *master_crtc_state; |
| 9623 | 9622 | struct intel_crtc *slave, *master; |
| 9624 | 9623 | |
| @@ -9634,15 +9633,15 @@ static int intel_atomic_check_bigjoiner(struct intel_atomic_state *state, · 9 unmodified lines | ||
| 9634 | 9633 | if (!new_crtc_state->bigjoiner) |
| 9635 | 9634 | return 0; |
| 9636 | 9635 | |
| 9637 | − if (1 + crtc->pipe >= INTEL_NUM_PIPES(dev_priv)) { | |
| 9636 | + slave = intel_dsc_get_bigjoiner_secondary(crtc); | |
| 9637 | + if (!slave) { | |
| 9638 | 9638 | DRM_DEBUG_KMS("[CRTC:%d:%s] Big joiner configuration requires " |
| 9639 | 9639 | "CRTC + 1 to be used, doesn't exist\n", |
| 9640 | 9640 | crtc->base.base.id, crtc->base.name); |
| 9641 | 9641 | return -EINVAL; |
| 9642 | 9642 | } |
| 9643 | 9643 | |
| 9644 | − slave = new_crtc_state->bigjoiner_linked_crtc = | |
| 9645 | − intel_get_crtc_for_pipe(dev_priv, crtc->pipe + 1); | |
| 9644 | + new_crtc_state->bigjoiner_linked_crtc = slave; | |
| 9646 | 9645 | slave_crtc_state = intel_atomic_get_crtc_state(&state->base, slave); |
| 9647 | 9646 | master = crtc; |
| 9648 | 9647 | if (IS_ERR(slave_crtc_state)) |
| @@ -1723,6 +1723,14 @@ vlv_pipe_to_channel(enum pipe pipe) · 1722 unmodified lines | ||
| 1723 | 1723 | } |
| 1724 | 1724 | } |
| 1725 | 1725 | |
| 1726 | +static inline bool intel_pipe_valid(struct drm_i915_private *i915, enum pipe pipe) | |
| 1727 | +{ | |
| 1728 | + return (pipe >= 0 && | |
| 1729 | + pipe < ARRAY_SIZE(i915->pipe_to_crtc_mapping) && | |
| 1730 | + INTEL_INFO(i915)->pipe_mask & BIT(pipe) && | |
| 1731 | + i915->pipe_to_crtc_mapping[pipe]); | |
| 1732 | +} | |
| 1733 | + | |
| 1726 | 1734 | static inline struct intel_crtc * |
| 1727 | 1735 | intel_get_first_crtc(struct drm_i915_private *dev_priv) |
| 1728 | 1736 | { |
| @@ -1106,6 +1106,27 @@ static i915_reg_t dss_ctl2_reg(const struct intel_crtc_state *crtc_state) · 1105 unmodified lines | ||
| 1106 | 1106 | return is_pipe_dsc(crtc_state) ? ICL_PIPE_DSS_CTL2(pipe) : DSS_CTL2; |
| 1107 | 1107 | } |
| 1108 | 1108 | |
| 1109 | +static struct intel_crtc * | |
| 1110 | +_get_crtc_for_pipe(struct drm_i915_private *i915, enum pipe pipe) | |
| 1111 | +{ | |
| 1112 | + if (!intel_pipe_valid(i915, pipe)) | |
| 1113 | + return NULL; | |
| 1114 | + | |
| 1115 | + return intel_get_crtc_for_pipe(i915, pipe); | |
| 1116 | +} | |
| 1117 | + | |
| 1118 | +struct intel_crtc * | |
| 1119 | +intel_dsc_get_bigjoiner_secondary(const struct intel_crtc *primary_crtc) | |
| 1120 | +{ | |
| 1121 | + return _get_crtc_for_pipe(to_i915(primary_crtc->base.dev), primary_crtc->pipe + 1); | |
| 1122 | +} | |
| 1123 | + | |
| 1124 | +static struct intel_crtc * | |
| 1125 | +intel_dsc_get_bigjoiner_primary(const struct intel_crtc *secondary_crtc) | |
| 1126 | +{ | |
| 1127 | + return _get_crtc_for_pipe(to_i915(secondary_crtc->base.dev), secondary_crtc->pipe - 1); | |
| 1128 | +} | |
| 1129 | + | |
| 1109 | 1130 | void intel_uncompressed_joiner_enable(const struct intel_crtc_state *crtc_state) |
| 1110 | 1131 | { |
| 1111 | 1132 | struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); |
| @@ -1178,15 +1199,13 @@ void intel_uncompressed_joiner_get_config(struct intel_crtc_state *crtc_state) · 66 unmodified lines | ||
| 1178 | 1199 | dss_ctl1 = intel_de_read(dev_priv, dss_ctl1_reg(crtc_state)); |
| 1179 | 1200 | if (dss_ctl1 & UNCOMPRESSED_JOINER_MASTER) { |
| 1180 | 1201 | crtc_state->bigjoiner = true; |
| 1181 | − if (!WARN_ON(INTEL_NUM_PIPES(dev_priv) == crtc->pipe + 1)) | |
| 1182 | − crtc_state->bigjoiner_linked_crtc = | |
| 1183 | − intel_get_crtc_for_pipe(dev_priv, crtc->pipe + 1); | |
| 1202 | + crtc_state->bigjoiner_linked_crtc = intel_dsc_get_bigjoiner_secondary(crtc); | |
| 1203 | + drm_WARN_ON(&dev_priv->drm, !crtc_state->bigjoiner_linked_crtc); | |
| 1184 | 1204 | } else if (dss_ctl1 & UNCOMPRESSED_JOINER_SLAVE) { |
| 1185 | 1205 | crtc_state->bigjoiner = true; |
| 1186 | 1206 | crtc_state->bigjoiner_slave = true; |
| 1187 | − if (!WARN_ON(crtc->pipe == PIPE_A)) | |
| 1188 | − crtc_state->bigjoiner_linked_crtc = | |
| 1189 | − intel_get_crtc_for_pipe(dev_priv, crtc->pipe - 1); | |
| 1207 | + crtc_state->bigjoiner_linked_crtc = intel_dsc_get_bigjoiner_primary(crtc); | |
| 1208 | + drm_WARN_ON(&dev_priv->drm, !crtc_state->bigjoiner_linked_crtc); | |
| 1190 | 1209 | } |
| 1191 | 1210 | } |
| 1192 | 1211 | |
| @@ -1224,14 +1243,11 @@ void intel_dsc_get_config(struct intel_crtc_state *crtc_state) · 31 unmodified lines | ||
| 1224 | 1243 | |
| 1225 | 1244 | if (!(dss_ctl1 & MASTER_BIG_JOINER_ENABLE)) { |
| 1226 | 1245 | crtc_state->bigjoiner_slave = true; |
| 1227 | − if (!WARN_ON(crtc->pipe == PIPE_A)) | |
| 1228 | − crtc_state->bigjoiner_linked_crtc = | |
| 1229 | − intel_get_crtc_for_pipe(dev_priv, crtc->pipe - 1); | |
| 1246 | + crtc_state->bigjoiner_linked_crtc = intel_dsc_get_bigjoiner_primary(crtc); | |
| 1230 | 1247 | } else { |
| 1231 | − if (!WARN_ON(INTEL_NUM_PIPES(dev_priv) == crtc->pipe + 1)) | |
| 1232 | − crtc_state->bigjoiner_linked_crtc = | |
| 1233 | − intel_get_crtc_for_pipe(dev_priv, crtc->pipe + 1); | |
| 1248 | + crtc_state->bigjoiner_linked_crtc = intel_dsc_get_bigjoiner_secondary(crtc); | |
| 1234 | 1249 | } |
| 1250 | + drm_WARN_ON(&dev_priv->drm, !crtc_state->bigjoiner_linked_crtc); | |
| 1235 | 1251 | } |
| 1236 | 1252 | |
| 1237 | 1253 | /* FIXME: add more state readout as needed */ |
| @@ -22,5 +22,6 @@ void intel_uncompressed_joiner_get_config(struct intel_crtc_state *crtc_state); · 21 unmodified lines | ||
| 22 | 22 | void intel_dsc_get_config(struct intel_crtc_state *crtc_state); |
| 23 | 23 | enum intel_display_power_domain |
| 24 | 24 | intel_dsc_power_domain(const struct intel_crtc_state *crtc_state); |
| 25 | +struct intel_crtc *intel_dsc_get_bigjoiner_secondary(const struct intel_crtc *primary_crtc); | |
| 25 | 26 | |
| 26 | 27 | #endif /* __INTEL_VDSC_H__ */ |
| @@ -61,10 +61,11 @@ i915_gem_mmap_ioctl(struct drm_device *dev, void *data, · 60 unmodified lines | ||
| 61 | 61 | struct drm_i915_gem_object *obj; |
| 62 | 62 | unsigned long addr; |
| 63 | 63 | |
| 64 | − /* mmap ioctl is disallowed for all platforms after TGL-LP. This also | |
| 65 | − * covers all platforms with local memory. | |
| 64 | + /* | |
| 65 | + * mmap ioctl is disallowed for all discrete platforms, | |
| 66 | + * and for all platforms with GRAPHICS_VER > 12. | |
| 66 | 67 | */ |
| 67 | − if (GRAPHICS_VER(i915) >= 12 && !IS_TIGERLAKE(i915)) | |
| 68 | + if (IS_DGFX(i915) || GRAPHICS_VER(i915) > 12) | |
| 68 | 69 | return -EOPNOTSUPP; |
| 69 | 70 | |
| 70 | 71 | if (args->flags & ~(I915_MMAP_WC)) |
| @@ -551,6 +551,32 @@ static int live_pin_rewind(void *arg) · 550 unmodified lines | ||
| 551 | 551 | return err; |
| 552 | 552 | } |
| 553 | 553 | |
| 554 | +static int engine_lock_reset_tasklet(struct intel_engine_cs *engine) | |
| 555 | +{ | |
| 556 | + tasklet_disable(&engine->execlists.tasklet); | |
| 557 | + local_bh_disable(); | |
| 558 | + | |
| 559 | + if (test_and_set_bit(I915_RESET_ENGINE + engine->id, | |
| 560 | + &engine->gt->reset.flags)) { | |
| 561 | + local_bh_enable(); | |
| 562 | + tasklet_enable(&engine->execlists.tasklet); | |
| 563 | + | |
| 564 | + intel_gt_set_wedged(engine->gt); | |
| 565 | + return -EBUSY; | |
| 566 | + } | |
| 567 | + | |
| 568 | + return 0; | |
| 569 | +} | |
| 570 | + | |
| 571 | +static void engine_unlock_reset_tasklet(struct intel_engine_cs *engine) | |
| 572 | +{ | |
| 573 | + clear_and_wake_up_bit(I915_RESET_ENGINE + engine->id, | |
| 574 | + &engine->gt->reset.flags); | |
| 575 | + | |
| 576 | + local_bh_enable(); | |
| 577 | + tasklet_enable(&engine->execlists.tasklet); | |
| 578 | +} | |
| 579 | + | |
| 554 | 580 | static int live_hold_reset(void *arg) |
| 555 | 581 | { |
| 556 | 582 | struct intel_gt *gt = arg; |
| @@ -598,15 +624,9 @@ static int live_hold_reset(void *arg) · 41 unmodified lines | ||
| 598 | 624 | |
| 599 | 625 | /* We have our request executing, now remove it and reset */ |
| 600 | 626 | |
| 601 | − local_bh_disable(); | |
| 602 | − if (test_and_set_bit(I915_RESET_ENGINE + id, | |
| 603 | − >->reset.flags)) { | |
| 604 | − local_bh_enable(); | |
| 605 | − intel_gt_set_wedged(gt); | |
| 606 | − err = -EBUSY; | |
| 627 | + err = engine_lock_reset_tasklet(engine); | |
| 628 | + if (err) | |
| 607 | 629 | goto out; |
| 608 | − } | |
| 609 | − tasklet_disable(&engine->execlists.tasklet); | |
| 610 | 630 | |
| 611 | 631 | engine->execlists.tasklet.callback(&engine->execlists.tasklet); |
| 612 | 632 | GEM_BUG_ON(execlists_active(&engine->execlists) != rq); |
| @@ -618,10 +638,7 @@ static int live_hold_reset(void *arg) · 5 unmodified lines | ||
| 618 | 638 | __intel_engine_reset_bh(engine, NULL); |
| 619 | 639 | GEM_BUG_ON(rq->fence.error != -EIO); |
| 620 | 640 | |
| 621 | − tasklet_enable(&engine->execlists.tasklet); | |
| 622 | − clear_and_wake_up_bit(I915_RESET_ENGINE + id, | |
| 623 | − >->reset.flags); | |
| 624 | − local_bh_enable(); | |
| 641 | + engine_unlock_reset_tasklet(engine); | |
| 625 | 642 | |
| 626 | 643 | /* Check that we do not resubmit the held request */ |
| 627 | 644 | if (!i915_request_wait(rq, 0, HZ / 5)) { |
| @@ -4585,15 +4602,9 @@ static int reset_virtual_engine(struct intel_gt *gt, · 3957 unmodified lines | ||
| 4585 | 4602 | GEM_BUG_ON(engine == ve->engine); |
| 4586 | 4603 | |
| 4587 | 4604 | /* Take ownership of the reset and tasklet */ |
| 4588 | − local_bh_disable(); | |
| 4589 | − if (test_and_set_bit(I915_RESET_ENGINE + engine->id, | |
| 4590 | − >->reset.flags)) { | |
| 4591 | − local_bh_enable(); | |
| 4592 | − intel_gt_set_wedged(gt); | |
| 4593 | − err = -EBUSY; | |
| 4605 | + err = engine_lock_reset_tasklet(engine); | |
| 4606 | + if (err) | |
| 4594 | 4607 | goto out_heartbeat; |
| 4595 | − } | |
| 4596 | − tasklet_disable(&engine->execlists.tasklet); | |
| 4597 | 4608 | |
| 4598 | 4609 | engine->execlists.tasklet.callback(&engine->execlists.tasklet); |
| 4599 | 4610 | GEM_BUG_ON(execlists_active(&engine->execlists) != rq); |
| @@ -4612,9 +4623,7 @@ static int reset_virtual_engine(struct intel_gt *gt, · 12 unmodified lines | ||
| 4612 | 4623 | GEM_BUG_ON(rq->fence.error != -EIO); |
| 4613 | 4624 | |
| 4614 | 4625 | /* Release our grasp on the engine, letting CS flow again */ |
| 4615 | − tasklet_enable(&engine->execlists.tasklet); | |
| 4616 | − clear_and_wake_up_bit(I915_RESET_ENGINE + engine->id, >->reset.flags); | |
| 4617 | − local_bh_enable(); | |
| 4626 | + engine_unlock_reset_tasklet(engine); | |
| 4618 | 4627 | |
| 4619 | 4628 | /* Check that we do not resubmit the held request */ |
| 4620 | 4629 | i915_request_get(rq); |