amd-drm-fixes-6.9-2024-05-01: amdgpu: - Fix VRAM memory accounting - DCN 3.1 fixes - DCN 2.0 fix - DCN 3.1.5 fix - DCN 3.5 fix - DCN 3.2.1 fix - DP fixes - Seamless boot fix - Fix call order in amdgpu_ttm_move() - Fix doorbell regression - Disable panel replay temporarily amdkfd: - Flush wq before creating kfd process Signed-off-by: Dave Airlie <airlied@redhat.com>
Unified · Split
| @@ -220,7 +220,7 @@ int amdgpu_amdkfd_reserve_mem_limit(struct amdgpu_device *adev, · 219 unmodified lines | ||
| 220 | 220 | (kfd_mem_limit.ttm_mem_used + ttm_mem_needed > |
| 221 | 221 | kfd_mem_limit.max_ttm_mem_limit) || |
| 222 | 222 | (adev && xcp_id >= 0 && adev->kfd.vram_used[xcp_id] + vram_needed > |
| 223 | − vram_size - reserved_for_pt)) { | |
| 223 | + vram_size - reserved_for_pt - atomic64_read(&adev->vram_pin_size))) { | |
| 224 | 224 | ret = -ENOMEM; |
| 225 | 225 | goto release; |
| 226 | 226 | } |
| @@ -1243,14 +1243,18 @@ int amdgpu_bo_get_metadata(struct amdgpu_bo *bo, void *buffer, · 1242 unmodified lines | ||
| 1243 | 1243 | * amdgpu_bo_move_notify - notification about a memory move |
| 1244 | 1244 | * @bo: pointer to a buffer object |
| 1245 | 1245 | * @evict: if this move is evicting the buffer from the graphics address space |
| 1246 | + * @new_mem: new resource for backing the BO | |
| 1246 | 1247 | * |
| 1247 | 1248 | * Marks the corresponding &amdgpu_bo buffer object as invalid, also performs |
| 1248 | 1249 | * bookkeeping. |
| 1249 | 1250 | * TTM driver callback which is called when ttm moves a buffer. |
| 1250 | 1251 | */ |
| 1251 | −void amdgpu_bo_move_notify(struct ttm_buffer_object *bo, bool evict) | |
| 1252 | +void amdgpu_bo_move_notify(struct ttm_buffer_object *bo, | |
| 1253 | + bool evict, | |
| 1254 | + struct ttm_resource *new_mem) | |
| 1252 | 1255 | { |
| 1253 | 1256 | struct amdgpu_device *adev = amdgpu_ttm_adev(bo->bdev); |
| 1257 | + struct ttm_resource *old_mem = bo->resource; | |
| 1254 | 1258 | struct amdgpu_bo *abo; |
| 1255 | 1259 | |
| 1256 | 1260 | if (!amdgpu_bo_is_amdgpu_bo(bo)) |
| @@ -1262,12 +1266,12 @@ void amdgpu_bo_move_notify(struct ttm_buffer_object *bo, bool evict) · 5 unmodified lines | ||
| 1262 | 1266 | amdgpu_bo_kunmap(abo); |
| 1263 | 1267 | |
| 1264 | 1268 | if (abo->tbo.base.dma_buf && !abo->tbo.base.import_attach && |
| 1265 | − bo->resource->mem_type != TTM_PL_SYSTEM) | |
| 1269 | + old_mem && old_mem->mem_type != TTM_PL_SYSTEM) | |
| 1266 | 1270 | dma_buf_move_notify(abo->tbo.base.dma_buf); |
| 1267 | 1271 | |
| 1268 | − /* remember the eviction */ | |
| 1269 | − if (evict) | |
| 1270 | − atomic64_inc(&adev->num_evictions); | |
| 1272 | + /* move_notify is called before move happens */ | |
| 1273 | + trace_amdgpu_bo_move(abo, new_mem ? new_mem->mem_type : -1, | |
| 1274 | + old_mem ? old_mem->mem_type : -1); | |
| 1271 | 1275 | } |
| 1272 | 1276 | |
| 1273 | 1277 | void amdgpu_bo_get_memory(struct amdgpu_bo *bo, |
| @@ -328,7 +328,9 @@ int amdgpu_bo_set_metadata (struct amdgpu_bo *bo, void *metadata, · 327 unmodified lines | ||
| 328 | 328 | int amdgpu_bo_get_metadata(struct amdgpu_bo *bo, void *buffer, |
| 329 | 329 | size_t buffer_size, uint32_t *metadata_size, |
| 330 | 330 | uint64_t *flags); |
| 331 | −void amdgpu_bo_move_notify(struct ttm_buffer_object *bo, bool evict); | |
| 331 | +void amdgpu_bo_move_notify(struct ttm_buffer_object *bo, | |
| 332 | + bool evict, | |
| 333 | + struct ttm_resource *new_mem); | |
| 332 | 334 | void amdgpu_bo_release_notify(struct ttm_buffer_object *bo); |
| 333 | 335 | vm_fault_t amdgpu_bo_fault_reserve_notify(struct ttm_buffer_object *bo); |
| 334 | 336 | void amdgpu_bo_fence(struct amdgpu_bo *bo, struct dma_fence *fence, |
| @@ -419,7 +419,7 @@ bool amdgpu_res_cpu_visible(struct amdgpu_device *adev, · 418 unmodified lines | ||
| 419 | 419 | return false; |
| 420 | 420 | |
| 421 | 421 | if (res->mem_type == TTM_PL_SYSTEM || res->mem_type == TTM_PL_TT || |
| 422 | − res->mem_type == AMDGPU_PL_PREEMPT) | |
| 422 | + res->mem_type == AMDGPU_PL_PREEMPT || res->mem_type == AMDGPU_PL_DOORBELL) | |
| 423 | 423 | return true; |
| 424 | 424 | |
| 425 | 425 | if (res->mem_type != TTM_PL_VRAM) |
| @@ -481,14 +481,16 @@ static int amdgpu_bo_move(struct ttm_buffer_object *bo, bool evict, · 55 unmodified lines | ||
| 481 | 481 | |
| 482 | 482 | if (!old_mem || (old_mem->mem_type == TTM_PL_SYSTEM && |
| 483 | 483 | bo->ttm == NULL)) { |
| 484 | + amdgpu_bo_move_notify(bo, evict, new_mem); | |
| 484 | 485 | ttm_bo_move_null(bo, new_mem); |
| 485 | − goto out; | |
| 486 | + return 0; | |
| 486 | 487 | } |
| 487 | 488 | if (old_mem->mem_type == TTM_PL_SYSTEM && |
| 488 | 489 | (new_mem->mem_type == TTM_PL_TT || |
| 489 | 490 | new_mem->mem_type == AMDGPU_PL_PREEMPT)) { |
| 491 | + amdgpu_bo_move_notify(bo, evict, new_mem); | |
| 490 | 492 | ttm_bo_move_null(bo, new_mem); |
| 491 | − goto out; | |
| 493 | + return 0; | |
| 492 | 494 | } |
| 493 | 495 | if ((old_mem->mem_type == TTM_PL_TT || |
| 494 | 496 | old_mem->mem_type == AMDGPU_PL_PREEMPT) && |
| @@ -498,9 +500,10 @@ static int amdgpu_bo_move(struct ttm_buffer_object *bo, bool evict, · 3 unmodified lines | ||
| 498 | 500 | return r; |
| 499 | 501 | |
| 500 | 502 | amdgpu_ttm_backend_unbind(bo->bdev, bo->ttm); |
| 503 | + amdgpu_bo_move_notify(bo, evict, new_mem); | |
| 501 | 504 | ttm_resource_free(bo, &bo->resource); |
| 502 | 505 | ttm_bo_assign_mem(bo, new_mem); |
| 503 | − goto out; | |
| 506 | + return 0; | |
| 504 | 507 | } |
| 505 | 508 | |
| 506 | 509 | if (old_mem->mem_type == AMDGPU_PL_GDS || |
| @@ -512,8 +515,9 @@ static int amdgpu_bo_move(struct ttm_buffer_object *bo, bool evict, · 5 unmodified lines | ||
| 512 | 515 | new_mem->mem_type == AMDGPU_PL_OA || |
| 513 | 516 | new_mem->mem_type == AMDGPU_PL_DOORBELL) { |
| 514 | 517 | /* Nothing to save here */ |
| 518 | + amdgpu_bo_move_notify(bo, evict, new_mem); | |
| 515 | 519 | ttm_bo_move_null(bo, new_mem); |
| 516 | − goto out; | |
| 520 | + return 0; | |
| 517 | 521 | } |
| 518 | 522 | |
| 519 | 523 | if (bo->type == ttm_bo_type_device && |
| @@ -525,22 +529,23 @@ static int amdgpu_bo_move(struct ttm_buffer_object *bo, bool evict, · 5 unmodified lines | ||
| 525 | 529 | abo->flags &= ~AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED; |
| 526 | 530 | } |
| 527 | 531 | |
| 528 | − if (adev->mman.buffer_funcs_enabled) { | |
| 529 | − if (((old_mem->mem_type == TTM_PL_SYSTEM && | |
| 530 | − new_mem->mem_type == TTM_PL_VRAM) || | |
| 531 | − (old_mem->mem_type == TTM_PL_VRAM && | |
| 532 | − new_mem->mem_type == TTM_PL_SYSTEM))) { | |
| 533 | − hop->fpfn = 0; | |
| 534 | − hop->lpfn = 0; | |
| 535 | − hop->mem_type = TTM_PL_TT; | |
| 536 | − hop->flags = TTM_PL_FLAG_TEMPORARY; | |
| 537 | − return -EMULTIHOP; | |
| 538 | − } | |
| 532 | + if (adev->mman.buffer_funcs_enabled && | |
| 533 | + ((old_mem->mem_type == TTM_PL_SYSTEM && | |
| 534 | + new_mem->mem_type == TTM_PL_VRAM) || | |
| 535 | + (old_mem->mem_type == TTM_PL_VRAM && | |
| 536 | + new_mem->mem_type == TTM_PL_SYSTEM))) { | |
| 537 | + hop->fpfn = 0; | |
| 538 | + hop->lpfn = 0; | |
| 539 | + hop->mem_type = TTM_PL_TT; | |
| 540 | + hop->flags = TTM_PL_FLAG_TEMPORARY; | |
| 541 | + return -EMULTIHOP; | |
| 542 | + } | |
| 539 | 543 | |
| 544 | + amdgpu_bo_move_notify(bo, evict, new_mem); | |
| 545 | + if (adev->mman.buffer_funcs_enabled) | |
| 540 | 546 | r = amdgpu_move_blit(bo, evict, new_mem, old_mem); |
| 541 | − } else { | |
| 547 | + else | |
| 542 | 548 | r = -ENODEV; |
| 543 | − } | |
| 544 | 549 | |
| 545 | 550 | if (r) { |
| 546 | 551 | /* Check that all memory is CPU accessible */ |
| @@ -555,11 +560,10 @@ static int amdgpu_bo_move(struct ttm_buffer_object *bo, bool evict, · 8 unmodified lines | ||
| 555 | 560 | return r; |
| 556 | 561 | } |
| 557 | 562 | |
| 558 | − trace_amdgpu_bo_move(abo, new_mem->mem_type, old_mem->mem_type); | |
| 559 | −out: | |
| 560 | − /* update statistics */ | |
| 563 | + /* update statistics after the move */ | |
| 564 | + if (evict) | |
| 565 | + atomic64_inc(&adev->num_evictions); | |
| 561 | 566 | atomic64_add(bo->base.size, &adev->num_bytes_moved); |
| 562 | − amdgpu_bo_move_notify(bo, evict); | |
| 563 | 567 | return 0; |
| 564 | 568 | } |
| 565 | 569 | |
| @@ -1559,7 +1563,7 @@ static int amdgpu_ttm_access_memory(struct ttm_buffer_object *bo, · 993 unmodified lines | ||
| 1559 | 1563 | static void |
| 1560 | 1564 | amdgpu_bo_delete_mem_notify(struct ttm_buffer_object *bo) |
| 1561 | 1565 | { |
| 1562 | − amdgpu_bo_move_notify(bo, false); | |
| 1566 | + amdgpu_bo_move_notify(bo, false, NULL); | |
| 1563 | 1567 | } |
| 1564 | 1568 | |
| 1565 | 1569 | static struct ttm_device_funcs amdgpu_bo_driver = { |
| @@ -829,6 +829,14 @@ struct kfd_process *kfd_create_process(struct task_struct *thread) · 828 unmodified lines | ||
| 829 | 829 | if (process) { |
| 830 | 830 | pr_debug("Process already found\n"); |
| 831 | 831 | } else { |
| 832 | + /* If the process just called exec(3), it is possible that the | |
| 833 | + * cleanup of the kfd_process (following the release of the mm | |
| 834 | + * of the old process image) is still in the cleanup work queue. | |
| 835 | + * Make sure to drain any job before trying to recreate any | |
| 836 | + * resource for this process. | |
| 837 | + */ | |
| 838 | + flush_workqueue(kfd_process_wq); | |
| 839 | + | |
| 832 | 840 | process = create_process(thread); |
| 833 | 841 | if (IS_ERR(process)) |
| 834 | 842 | goto out; |
| @@ -4537,15 +4537,18 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev) · 4536 unmodified lines | ||
| 4537 | 4537 | /* Determine whether to enable Replay support by default. */ |
| 4538 | 4538 | if (!(amdgpu_dc_debug_mask & DC_DISABLE_REPLAY)) { |
| 4539 | 4539 | switch (amdgpu_ip_version(adev, DCE_HWIP, 0)) { |
| 4540 | − case IP_VERSION(3, 1, 4): | |
| 4541 | − case IP_VERSION(3, 1, 5): | |
| 4542 | − case IP_VERSION(3, 1, 6): | |
| 4543 | − case IP_VERSION(3, 2, 0): | |
| 4544 | − case IP_VERSION(3, 2, 1): | |
| 4545 | − case IP_VERSION(3, 5, 0): | |
| 4546 | − case IP_VERSION(3, 5, 1): | |
| 4547 | − replay_feature_enabled = true; | |
| 4548 | − break; | |
| 4540 | +/* | |
| 4541 | + * Disabled by default due to https://gitlab.freedesktop.org/drm/amd/-/issues/3344 | |
| 4542 | + * case IP_VERSION(3, 1, 4): | |
| 4543 | + * case IP_VERSION(3, 1, 5): | |
| 4544 | + * case IP_VERSION(3, 1, 6): | |
| 4545 | + * case IP_VERSION(3, 2, 0): | |
| 4546 | + * case IP_VERSION(3, 2, 1): | |
| 4547 | + * case IP_VERSION(3, 5, 0): | |
| 4548 | + * case IP_VERSION(3, 5, 1): | |
| 4549 | + * replay_feature_enabled = true; | |
| 4550 | + * break; | |
| 4551 | + */ | |
| 4549 | 4552 | default: |
| 4550 | 4553 | replay_feature_enabled = amdgpu_dc_feature_mask & DC_REPLAY_MASK; |
| 4551 | 4554 | break; |
| @@ -1495,7 +1495,9 @@ static ssize_t dp_dsc_clock_en_read(struct file *f, char __user *buf, · 1494 unmodified lines | ||
| 1495 | 1495 | for (i = 0; i < MAX_PIPES; i++) { |
| 1496 | 1496 | pipe_ctx = &aconnector->dc_link->dc->current_state->res_ctx.pipe_ctx[i]; |
| 1497 | 1497 | if (pipe_ctx->stream && |
| 1498 | − pipe_ctx->stream->link == aconnector->dc_link) | |
| 1498 | + pipe_ctx->stream->link == aconnector->dc_link && | |
| 1499 | + pipe_ctx->stream->sink && | |
| 1500 | + pipe_ctx->stream->sink == aconnector->dc_sink) | |
| 1499 | 1501 | break; |
| 1500 | 1502 | } |
| 1501 | 1503 | |
| @@ -1596,7 +1598,9 @@ static ssize_t dp_dsc_clock_en_write(struct file *f, const char __user *buf, · 94 unmodified lines | ||
| 1596 | 1598 | for (i = 0; i < MAX_PIPES; i++) { |
| 1597 | 1599 | pipe_ctx = &aconnector->dc_link->dc->current_state->res_ctx.pipe_ctx[i]; |
| 1598 | 1600 | if (pipe_ctx->stream && |
| 1599 | − pipe_ctx->stream->link == aconnector->dc_link) | |
| 1601 | + pipe_ctx->stream->link == aconnector->dc_link && | |
| 1602 | + pipe_ctx->stream->sink && | |
| 1603 | + pipe_ctx->stream->sink == aconnector->dc_sink) | |
| 1600 | 1604 | break; |
| 1601 | 1605 | } |
| 1602 | 1606 | |
| @@ -1681,7 +1685,9 @@ static ssize_t dp_dsc_slice_width_read(struct file *f, char __user *buf, · 78 unmodified lines | ||
| 1681 | 1685 | for (i = 0; i < MAX_PIPES; i++) { |
| 1682 | 1686 | pipe_ctx = &aconnector->dc_link->dc->current_state->res_ctx.pipe_ctx[i]; |
| 1683 | 1687 | if (pipe_ctx->stream && |
| 1684 | − pipe_ctx->stream->link == aconnector->dc_link) | |
| 1688 | + pipe_ctx->stream->link == aconnector->dc_link && | |
| 1689 | + pipe_ctx->stream->sink && | |
| 1690 | + pipe_ctx->stream->sink == aconnector->dc_sink) | |
| 1685 | 1691 | break; |
| 1686 | 1692 | } |
| 1687 | 1693 | |
| @@ -1780,7 +1786,9 @@ static ssize_t dp_dsc_slice_width_write(struct file *f, const char __user *buf, · 92 unmodified lines | ||
| 1780 | 1786 | for (i = 0; i < MAX_PIPES; i++) { |
| 1781 | 1787 | pipe_ctx = &aconnector->dc_link->dc->current_state->res_ctx.pipe_ctx[i]; |
| 1782 | 1788 | if (pipe_ctx->stream && |
| 1783 | − pipe_ctx->stream->link == aconnector->dc_link) | |
| 1789 | + pipe_ctx->stream->link == aconnector->dc_link && | |
| 1790 | + pipe_ctx->stream->sink && | |
| 1791 | + pipe_ctx->stream->sink == aconnector->dc_sink) | |
| 1784 | 1792 | break; |
| 1785 | 1793 | } |
| 1786 | 1794 | |
| @@ -1865,7 +1873,9 @@ static ssize_t dp_dsc_slice_height_read(struct file *f, char __user *buf, · 78 unmodified lines | ||
| 1865 | 1873 | for (i = 0; i < MAX_PIPES; i++) { |
| 1866 | 1874 | pipe_ctx = &aconnector->dc_link->dc->current_state->res_ctx.pipe_ctx[i]; |
| 1867 | 1875 | if (pipe_ctx->stream && |
| 1868 | − pipe_ctx->stream->link == aconnector->dc_link) | |
| 1876 | + pipe_ctx->stream->link == aconnector->dc_link && | |
| 1877 | + pipe_ctx->stream->sink && | |
| 1878 | + pipe_ctx->stream->sink == aconnector->dc_sink) | |
| 1869 | 1879 | break; |
| 1870 | 1880 | } |
| 1871 | 1881 | |
| @@ -1964,7 +1974,9 @@ static ssize_t dp_dsc_slice_height_write(struct file *f, const char __user *buf, · 92 unmodified lines | ||
| 1964 | 1974 | for (i = 0; i < MAX_PIPES; i++) { |
| 1965 | 1975 | pipe_ctx = &aconnector->dc_link->dc->current_state->res_ctx.pipe_ctx[i]; |
| 1966 | 1976 | if (pipe_ctx->stream && |
| 1967 | − pipe_ctx->stream->link == aconnector->dc_link) | |
| 1977 | + pipe_ctx->stream->link == aconnector->dc_link && | |
| 1978 | + pipe_ctx->stream->sink && | |
| 1979 | + pipe_ctx->stream->sink == aconnector->dc_sink) | |
| 1968 | 1980 | break; |
| 1969 | 1981 | } |
| 1970 | 1982 | |
| @@ -2045,7 +2057,9 @@ static ssize_t dp_dsc_bits_per_pixel_read(struct file *f, char __user *buf, · 74 unmodified lines | ||
| 2045 | 2057 | for (i = 0; i < MAX_PIPES; i++) { |
| 2046 | 2058 | pipe_ctx = &aconnector->dc_link->dc->current_state->res_ctx.pipe_ctx[i]; |
| 2047 | 2059 | if (pipe_ctx->stream && |
| 2048 | − pipe_ctx->stream->link == aconnector->dc_link) | |
| 2060 | + pipe_ctx->stream->link == aconnector->dc_link && | |
| 2061 | + pipe_ctx->stream->sink && | |
| 2062 | + pipe_ctx->stream->sink == aconnector->dc_sink) | |
| 2049 | 2063 | break; |
| 2050 | 2064 | } |
| 2051 | 2065 | |
| @@ -2141,7 +2155,9 @@ static ssize_t dp_dsc_bits_per_pixel_write(struct file *f, const char __user *bu · 89 unmodified lines | ||
| 2141 | 2155 | for (i = 0; i < MAX_PIPES; i++) { |
| 2142 | 2156 | pipe_ctx = &aconnector->dc_link->dc->current_state->res_ctx.pipe_ctx[i]; |
| 2143 | 2157 | if (pipe_ctx->stream && |
| 2144 | − pipe_ctx->stream->link == aconnector->dc_link) | |
| 2158 | + pipe_ctx->stream->link == aconnector->dc_link && | |
| 2159 | + pipe_ctx->stream->sink && | |
| 2160 | + pipe_ctx->stream->sink == aconnector->dc_sink) | |
| 2145 | 2161 | break; |
| 2146 | 2162 | } |
| 2147 | 2163 | |
| @@ -2220,7 +2236,9 @@ static ssize_t dp_dsc_pic_width_read(struct file *f, char __user *buf, · 72 unmodified lines | ||
| 2220 | 2236 | for (i = 0; i < MAX_PIPES; i++) { |
| 2221 | 2237 | pipe_ctx = &aconnector->dc_link->dc->current_state->res_ctx.pipe_ctx[i]; |
| 2222 | 2238 | if (pipe_ctx->stream && |
| 2223 | − pipe_ctx->stream->link == aconnector->dc_link) | |
| 2239 | + pipe_ctx->stream->link == aconnector->dc_link && | |
| 2240 | + pipe_ctx->stream->sink && | |
| 2241 | + pipe_ctx->stream->sink == aconnector->dc_sink) | |
| 2224 | 2242 | break; |
| 2225 | 2243 | } |
| 2226 | 2244 | |
| @@ -2276,7 +2294,9 @@ static ssize_t dp_dsc_pic_height_read(struct file *f, char __user *buf, · 49 unmodified lines | ||
| 2276 | 2294 | for (i = 0; i < MAX_PIPES; i++) { |
| 2277 | 2295 | pipe_ctx = &aconnector->dc_link->dc->current_state->res_ctx.pipe_ctx[i]; |
| 2278 | 2296 | if (pipe_ctx->stream && |
| 2279 | − pipe_ctx->stream->link == aconnector->dc_link) | |
| 2297 | + pipe_ctx->stream->link == aconnector->dc_link && | |
| 2298 | + pipe_ctx->stream->sink && | |
| 2299 | + pipe_ctx->stream->sink == aconnector->dc_sink) | |
| 2280 | 2300 | break; |
| 2281 | 2301 | } |
| 2282 | 2302 | |
| @@ -2347,7 +2367,9 @@ static ssize_t dp_dsc_chunk_size_read(struct file *f, char __user *buf, · 64 unmodified lines | ||
| 2347 | 2367 | for (i = 0; i < MAX_PIPES; i++) { |
| 2348 | 2368 | pipe_ctx = &aconnector->dc_link->dc->current_state->res_ctx.pipe_ctx[i]; |
| 2349 | 2369 | if (pipe_ctx->stream && |
| 2350 | − pipe_ctx->stream->link == aconnector->dc_link) | |
| 2370 | + pipe_ctx->stream->link == aconnector->dc_link && | |
| 2371 | + pipe_ctx->stream->sink && | |
| 2372 | + pipe_ctx->stream->sink == aconnector->dc_sink) | |
| 2351 | 2373 | break; |
| 2352 | 2374 | } |
| 2353 | 2375 | |
| @@ -2418,7 +2440,9 @@ static ssize_t dp_dsc_slice_bpg_offset_read(struct file *f, char __user *buf, · 64 unmodified lines | ||
| 2418 | 2440 | for (i = 0; i < MAX_PIPES; i++) { |
| 2419 | 2441 | pipe_ctx = &aconnector->dc_link->dc->current_state->res_ctx.pipe_ctx[i]; |
| 2420 | 2442 | if (pipe_ctx->stream && |
| 2421 | − pipe_ctx->stream->link == aconnector->dc_link) | |
| 2443 | + pipe_ctx->stream->link == aconnector->dc_link && | |
| 2444 | + pipe_ctx->stream->sink && | |
| 2445 | + pipe_ctx->stream->sink == aconnector->dc_sink) | |
| 2422 | 2446 | break; |
| 2423 | 2447 | } |
| 2424 | 2448 | |
| @@ -2948,6 +2948,7 @@ static enum bp_result construct_integrated_info( · 2947 unmodified lines | ||
| 2948 | 2948 | result = get_integrated_info_v2_1(bp, info); |
| 2949 | 2949 | break; |
| 2950 | 2950 | case 2: |
| 2951 | + case 3: | |
| 2951 | 2952 | result = get_integrated_info_v2_2(bp, info); |
| 2952 | 2953 | break; |
| 2953 | 2954 | default: |
| @@ -145,6 +145,10 @@ static void dcn315_update_clocks(struct clk_mgr *clk_mgr_base, · 144 unmodified lines | ||
| 145 | 145 | */ |
| 146 | 146 | clk_mgr_base->clks.zstate_support = new_clocks->zstate_support; |
| 147 | 147 | if (safe_to_lower) { |
| 148 | + if (clk_mgr_base->clks.dtbclk_en && !new_clocks->dtbclk_en) { | |
| 149 | + dcn315_smu_set_dtbclk(clk_mgr, false); | |
| 150 | + clk_mgr_base->clks.dtbclk_en = new_clocks->dtbclk_en; | |
| 151 | + } | |
| 148 | 152 | /* check that we're not already in lower */ |
| 149 | 153 | if (clk_mgr_base->clks.pwr_state != DCN_PWR_STATE_LOW_POWER) { |
| 150 | 154 | display_count = dcn315_get_active_display_cnt_wa(dc, context); |
| @@ -160,6 +164,10 @@ static void dcn315_update_clocks(struct clk_mgr *clk_mgr_base, · 9 unmodified lines | ||
| 160 | 164 | } |
| 161 | 165 | } |
| 162 | 166 | } else { |
| 167 | + if (!clk_mgr_base->clks.dtbclk_en && new_clocks->dtbclk_en) { | |
| 168 | + dcn315_smu_set_dtbclk(clk_mgr, true); | |
| 169 | + clk_mgr_base->clks.dtbclk_en = new_clocks->dtbclk_en; | |
| 170 | + } | |
| 163 | 171 | /* check that we're not already in D0 */ |
| 164 | 172 | if (clk_mgr_base->clks.pwr_state != DCN_PWR_STATE_MISSION_MODE) { |
| 165 | 173 | union display_idle_optimization_u idle_info = { 0 }; |
| @@ -712,8 +712,12 @@ static void dcn32_update_clocks(struct clk_mgr *clk_mgr_base, · 711 unmodified lines | ||
| 712 | 712 | * since we calculate mode support based on softmax being the max UCLK |
| 713 | 713 | * frequency. |
| 714 | 714 | */ |
| 715 | − dcn32_smu_set_hard_min_by_freq(clk_mgr, PPCLK_UCLK, | |
| 716 | − dc->clk_mgr->bw_params->dc_mode_softmax_memclk); | |
| 715 | + if (dc->debug.disable_dc_mode_overwrite) { | |
| 716 | + dcn30_smu_set_hard_max_by_freq(clk_mgr, PPCLK_UCLK, dc->clk_mgr->bw_params->max_memclk_mhz); | |
| 717 | + dcn32_smu_set_hard_min_by_freq(clk_mgr, PPCLK_UCLK, dc->clk_mgr->bw_params->max_memclk_mhz); | |
| 718 | + } else | |
| 719 | + dcn32_smu_set_hard_min_by_freq(clk_mgr, PPCLK_UCLK, | |
| 720 | + dc->clk_mgr->bw_params->dc_mode_softmax_memclk); | |
| 717 | 721 | } else { |
| 718 | 722 | dcn32_smu_set_hard_min_by_freq(clk_mgr, PPCLK_UCLK, dc->clk_mgr->bw_params->max_memclk_mhz); |
| 719 | 723 | } |
| @@ -746,8 +750,13 @@ static void dcn32_update_clocks(struct clk_mgr *clk_mgr_base, · 26 unmodified lines | ||
| 746 | 750 | /* set UCLK to requested value if P-State switching is supported, or to re-enable P-State switching */ |
| 747 | 751 | if (clk_mgr_base->clks.p_state_change_support && |
| 748 | 752 | (update_uclk || !clk_mgr_base->clks.prev_p_state_change_support) && |
| 749 | − !dc->work_arounds.clock_update_disable_mask.uclk) | |
| 753 | + !dc->work_arounds.clock_update_disable_mask.uclk) { | |
| 754 | + if (dc->clk_mgr->dc_mode_softmax_enabled && dc->debug.disable_dc_mode_overwrite) | |
| 755 | + dcn30_smu_set_hard_max_by_freq(clk_mgr, PPCLK_UCLK, | |
| 756 | + max((int)dc->clk_mgr->bw_params->dc_mode_softmax_memclk, khz_to_mhz_ceil(clk_mgr_base->clks.dramclk_khz))); | |
| 757 | + | |
| 750 | 758 | dcn32_smu_set_hard_min_by_freq(clk_mgr, PPCLK_UCLK, khz_to_mhz_ceil(clk_mgr_base->clks.dramclk_khz)); |
| 759 | + } | |
| 751 | 760 | |
| 752 | 761 | if (clk_mgr_base->clks.num_ways != new_clocks->num_ways && |
| 753 | 762 | clk_mgr_base->clks.num_ways > new_clocks->num_ways) { |
| @@ -1801,6 +1801,9 @@ bool dc_validate_boot_timing(const struct dc *dc, · 1800 unmodified lines | ||
| 1801 | 1801 | return false; |
| 1802 | 1802 | } |
| 1803 | 1803 | |
| 1804 | + if (link->dpcd_caps.channel_coding_cap.bits.DP_128b_132b_SUPPORTED) | |
| 1805 | + return false; | |
| 1806 | + | |
| 1804 | 1807 | if (dc->link_srv->edp_is_ilr_optimization_required(link, crtc_timing)) { |
| 1805 | 1808 | DC_LOG_EVENT_LINK_TRAINING("Seamless boot disabled to optimize eDP link rate\n"); |
| 1806 | 1809 | return false; |
| @@ -395,6 +395,12 @@ void dcn31_hpo_dp_link_enc_set_throttled_vcp_size( · 394 unmodified lines | ||
| 395 | 395 | x), |
| 396 | 396 | 25)); |
| 397 | 397 | |
| 398 | + // If y rounds up to integer, carry it over to x. | |
| 399 | + if (y >> 25) { | |
| 400 | + x += 1; | |
| 401 | + y = 0; | |
| 402 | + } | |
| 403 | + | |
| 398 | 404 | switch (stream_encoder_inst) { |
| 399 | 405 | case 0: |
| 400 | 406 | REG_SET_2(DP_DPHY_SYM32_VC_RATE_CNTL0, 0, |
| @@ -291,6 +291,7 @@ static struct _vcs_dpi_soc_bounding_box_st dcn3_15_soc = { · 290 unmodified lines | ||
| 291 | 291 | .do_urgent_latency_adjustment = false, |
| 292 | 292 | .urgent_latency_adjustment_fabric_clock_component_us = 0, |
| 293 | 293 | .urgent_latency_adjustment_fabric_clock_reference_mhz = 0, |
| 294 | + .dispclk_dppclk_vco_speed_mhz = 2400.0, | |
| 294 | 295 | .num_chans = 4, |
| 295 | 296 | .dummy_pstate_latency_us = 10.0 |
| 296 | 297 | }; |
| @@ -438,6 +439,7 @@ static struct _vcs_dpi_soc_bounding_box_st dcn3_16_soc = { · 141 unmodified lines | ||
| 438 | 439 | .do_urgent_latency_adjustment = false, |
| 439 | 440 | .urgent_latency_adjustment_fabric_clock_component_us = 0, |
| 440 | 441 | .urgent_latency_adjustment_fabric_clock_reference_mhz = 0, |
| 442 | + .dispclk_dppclk_vco_speed_mhz = 2500.0, | |
| 441 | 443 | }; |
| 442 | 444 | |
| 443 | 445 | void dcn31_zero_pipe_dcc_fraction(display_e2e_pipe_params_st *pipes, |
| @@ -270,7 +270,7 @@ static void set_usb4_req_bw_req(struct dc_link *link, int req_bw) · 269 unmodified lines | ||
| 270 | 270 | |
| 271 | 271 | /* Error check whether requested and allocated are equal */ |
| 272 | 272 | req_bw = requested_bw * (Kbps_TO_Gbps / link->dpia_bw_alloc_config.bw_granularity); |
| 273 | − if (req_bw == link->dpia_bw_alloc_config.allocated_bw) { | |
| 273 | + if (req_bw && (req_bw == link->dpia_bw_alloc_config.allocated_bw)) { | |
| 274 | 274 | DC_LOG_ERROR("%s: Request bw equals to allocated bw for link(%d)\n", |
| 275 | 275 | __func__, link->link_index); |
| 276 | 276 | } |
| @@ -341,6 +341,14 @@ bool link_dp_dpia_set_dptx_usb4_bw_alloc_support(struct dc_link *link) · 64 unmodified lines | ||
| 341 | 341 | ret = true; |
| 342 | 342 | init_usb4_bw_struct(link); |
| 343 | 343 | link->dpia_bw_alloc_config.bw_alloc_enabled = true; |
| 344 | + | |
| 345 | + /* | |
| 346 | + * During DP tunnel creation, CM preallocates BW and reduces estimated BW of other | |
| 347 | + * DPIA. CM release preallocation only when allocation is complete. Do zero alloc | |
| 348 | + * to make the CM to release preallocation and update estimated BW correctly for | |
| 349 | + * all DPIAs per host router | |
| 350 | + */ | |
| 351 | + link_dp_dpia_allocate_usb4_bandwidth_for_stream(link, 0); | |
| 344 | 352 | } |
| 345 | 353 | } |
| 346 | 354 | |
| @@ -2449,6 +2449,7 @@ static bool dcn20_resource_construct( · 2448 unmodified lines | ||
| 2449 | 2449 | dc->caps.post_blend_color_processing = true; |
| 2450 | 2450 | dc->caps.force_dp_tps4_for_cp2520 = true; |
| 2451 | 2451 | dc->caps.extended_aux_timeout_support = true; |
| 2452 | + dc->caps.dmcub_support = true; | |
| 2452 | 2453 | |
| 2453 | 2454 | /* Color pipeline capabilities */ |
| 2454 | 2455 | dc->caps.color.dpp.dcn_arch = 1; |