Skip to content

Commit 64e33ca

Browse files
alexdeuchergregkh
authored andcommitted
drm/radeon/dpm: select the appropriate vce power state for KV/KB/ML
commit c83dec3 upstream. Compare the clock in the limits table to the requested evclk rather than just taking the first value. Improves vce performance in certain cases. Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent ac3e095 commit 64e33ca

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎drivers/gpu/drm/radeon/kv_dpm.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1438,14 +1438,14 @@ static int kv_update_uvd_dpm(struct radeon_device *rdev, bool gate)
14381438
return kv_enable_uvd_dpm(rdev, !gate);
14391439
}
14401440

1441-
static u8 kv_get_vce_boot_level(struct radeon_device *rdev)
1441+
static u8 kv_get_vce_boot_level(struct radeon_device *rdev, u32 evclk)
14421442
{
14431443
u8 i;
14441444
struct radeon_vce_clock_voltage_dependency_table *table =
14451445
&rdev->pm.dpm.dyn_state.vce_clock_voltage_dependency_table;
14461446

14471447
for (i = 0; i < table->count; i++) {
1448-
if (table->entries[i].evclk >= 0) /* XXX */
1448+
if (table->entries[i].evclk >= evclk)
14491449
break;
14501450
}
14511451

@@ -1468,7 +1468,7 @@ static int kv_update_vce_dpm(struct radeon_device *rdev,
14681468
if (pi->caps_stable_p_state)
14691469
pi->vce_boot_level = table->count - 1;
14701470
else
1471-
pi->vce_boot_level = kv_get_vce_boot_level(rdev);
1471+
pi->vce_boot_level = kv_get_vce_boot_level(rdev, radeon_new_state->evclk);
14721472

14731473
ret = kv_copy_bytes_to_smc(rdev,
14741474
pi->dpm_table_start +

0 commit comments

Comments
 (0)