Commit 6154cc9
drm/i915/cdclk: Fix voltage_level programming edge case
Currently we only consider the relationship of the
old and new CDCLK frequencies when determining whether
to do the repgramming from intel_set_cdclk_pre_plane_update()
or intel_set_cdclk_post_plane_update().
It is technically possible to have a situation where the
CDCLK frequency is decreasing, but the voltage_level is
increasing due a DDI port. In this case we should bump
the voltage level already in intel_set_cdclk_pre_plane_update()
(so that the voltage_level will have been increased by the
time the port gets enabled), while leaving the CDCLK frequency
unchanged (as active planes/etc. may still depend on it).
We can then reduce the CDCLK frequency to its final value
from intel_set_cdclk_post_plane_update().
In order to handle that correctly we shall construct a
suitable amalgam of the old and new cdclk states in
intel_set_cdclk_pre_plane_update().
And we can simply call intel_set_cdclk() unconditionally
in both places as it will not do anything if nothing actually
changes vs. the current hw state.
v2: Handle cdclk_state->disable_pipes
v3: Only synchronize the cd2x update against the pipe's vblank
when the cdclk frequency is changing during the current
commit phase (Gustavo)
Cc: stable@vger.kernel.org
Cc: Gustavo Sousa <gustavo.sousa@intel.com>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240402155016.13733-3-ville.syrjala@linux.intel.com
(cherry picked from commit 34d127e)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>1 parent 7b1f6b5 commit 6154cc9
1 file changed
Lines changed: 27 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2534 | 2534 | | |
2535 | 2535 | | |
2536 | 2536 | | |
2537 | | - | |
| 2537 | + | |
| 2538 | + | |
2538 | 2539 | | |
2539 | 2540 | | |
2540 | 2541 | | |
| |||
2543 | 2544 | | |
2544 | 2545 | | |
2545 | 2546 | | |
2546 | | - | |
2547 | | - | |
2548 | | - | |
| 2547 | + | |
| 2548 | + | |
| 2549 | + | |
| 2550 | + | |
| 2551 | + | |
| 2552 | + | |
| 2553 | + | |
| 2554 | + | |
| 2555 | + | |
| 2556 | + | |
| 2557 | + | |
2549 | 2558 | | |
2550 | | - | |
| 2559 | + | |
| 2560 | + | |
2551 | 2561 | | |
| 2562 | + | |
| 2563 | + | |
| 2564 | + | |
| 2565 | + | |
2552 | 2566 | | |
2553 | 2567 | | |
2554 | 2568 | | |
| |||
2566 | 2580 | | |
2567 | 2581 | | |
2568 | 2582 | | |
2569 | | - | |
| 2583 | + | |
2570 | 2584 | | |
2571 | 2585 | | |
2572 | 2586 | | |
| |||
2576 | 2590 | | |
2577 | 2591 | | |
2578 | 2592 | | |
2579 | | - | |
2580 | | - | |
| 2593 | + | |
| 2594 | + | |
| 2595 | + | |
| 2596 | + | |
2581 | 2597 | | |
2582 | | - | |
2583 | | - | |
| 2598 | + | |
| 2599 | + | |
| 2600 | + | |
2584 | 2601 | | |
2585 | 2602 | | |
2586 | 2603 | | |
| |||
0 commit comments