Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amd/display: have two different sr and pstate latency tables for renoir

[Why]
new sr and pstate latencies are optimized for the case when we are not
using lpddr4 memory

[How]
have two different wm tables, one for the lpddr case and one for
non lpddr case

Signed-off-by: Joseph Gravenor <joseph.gravenor@amd.com>
Reviewed-by: Eric Yang <eric.yang2@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Joseph Gravenor and committed by
Alex Deucher
10bce710 a51d9f8f

+80 -34
+80 -34
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c
··· 518 518 .num_entries = 4, 519 519 }, 520 520 521 - .wm_table = { 522 - .entries = { 523 - { 524 - .wm_inst = WM_A, 525 - .wm_type = WM_TYPE_PSTATE_CHG, 526 - .pstate_latency_us = 11.72, 527 - .sr_exit_time_us = 6.09, 528 - .sr_enter_plus_exit_time_us = 7.14, 529 - .valid = true, 530 - }, 531 - { 532 - .wm_inst = WM_B, 533 - .wm_type = WM_TYPE_PSTATE_CHG, 534 - .pstate_latency_us = 11.72, 535 - .sr_exit_time_us = 10.12, 536 - .sr_enter_plus_exit_time_us = 11.48, 537 - .valid = true, 538 - }, 539 - { 540 - .wm_inst = WM_C, 541 - .wm_type = WM_TYPE_PSTATE_CHG, 542 - .pstate_latency_us = 11.72, 543 - .sr_exit_time_us = 10.12, 544 - .sr_enter_plus_exit_time_us = 11.48, 545 - .valid = true, 546 - }, 547 - { 548 - .wm_inst = WM_D, 549 - .wm_type = WM_TYPE_PSTATE_CHG, 550 - .pstate_latency_us = 11.72, 551 - .sr_exit_time_us = 10.12, 552 - .sr_enter_plus_exit_time_us = 11.48, 553 - .valid = true, 554 - }, 521 + }; 522 + 523 + struct wm_table ddr4_wm_table = { 524 + .entries = { 525 + { 526 + .wm_inst = WM_A, 527 + .wm_type = WM_TYPE_PSTATE_CHG, 528 + .pstate_latency_us = 11.72, 529 + .sr_exit_time_us = 6.09, 530 + .sr_enter_plus_exit_time_us = 7.14, 531 + .valid = true, 532 + }, 533 + { 534 + .wm_inst = WM_B, 535 + .wm_type = WM_TYPE_PSTATE_CHG, 536 + .pstate_latency_us = 11.72, 537 + .sr_exit_time_us = 10.12, 538 + .sr_enter_plus_exit_time_us = 11.48, 539 + .valid = true, 540 + }, 541 + { 542 + .wm_inst = WM_C, 543 + .wm_type = WM_TYPE_PSTATE_CHG, 544 + .pstate_latency_us = 11.72, 545 + .sr_exit_time_us = 10.12, 546 + .sr_enter_plus_exit_time_us = 11.48, 547 + .valid = true, 548 + }, 549 + { 550 + .wm_inst = WM_D, 551 + .wm_type = WM_TYPE_PSTATE_CHG, 552 + .pstate_latency_us = 11.72, 553 + .sr_exit_time_us = 10.12, 554 + .sr_enter_plus_exit_time_us = 11.48, 555 + .valid = true, 555 556 }, 556 557 } 557 558 }; 559 + 560 + struct wm_table lpddr4_wm_table = { 561 + .entries = { 562 + { 563 + .wm_inst = WM_A, 564 + .wm_type = WM_TYPE_PSTATE_CHG, 565 + .pstate_latency_us = 23.84, 566 + .sr_exit_time_us = 12.5, 567 + .sr_enter_plus_exit_time_us = 17.0, 568 + .valid = true, 569 + }, 570 + { 571 + .wm_inst = WM_B, 572 + .wm_type = WM_TYPE_PSTATE_CHG, 573 + .pstate_latency_us = 23.84, 574 + .sr_exit_time_us = 12.5, 575 + .sr_enter_plus_exit_time_us = 17.0, 576 + .valid = true, 577 + }, 578 + { 579 + .wm_inst = WM_C, 580 + .wm_type = WM_TYPE_PSTATE_CHG, 581 + .pstate_latency_us = 23.84, 582 + .sr_exit_time_us = 12.5, 583 + .sr_enter_plus_exit_time_us = 17.0, 584 + .valid = true, 585 + }, 586 + { 587 + .wm_inst = WM_D, 588 + .wm_type = WM_TYPE_PSTATE_CHG, 589 + .pstate_latency_us = 23.84, 590 + .sr_exit_time_us = 12.5, 591 + .sr_enter_plus_exit_time_us = 17.0, 592 + .valid = true, 593 + }, 594 + } 595 + }; 596 + 558 597 559 598 static unsigned int find_dcfclk_for_voltage(struct dpm_clocks *clock_table, unsigned int voltage) 560 599 { ··· 716 677 ASSERT(clk_mgr->base.dprefclk_khz == 600000); 717 678 clk_mgr->base.dprefclk_khz = 600000; 718 679 } 680 + 681 + if (ctx->dc_bios->integrated_info->memory_type == LpDdr4MemType) { 682 + rn_bw_params.wm_table = lpddr4_wm_table; 683 + } else { 684 + rn_bw_params.wm_table = ddr4_wm_table; 685 + } 719 686 } 720 687 721 688 dce_clock_read_ss_info(clk_mgr); 689 + 722 690 723 691 clk_mgr->base.bw_params = &rn_bw_params; 724 692