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

drm/radeon/dpm: select the appropriate vce power state for KV/KB/ML

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>
Cc: stable@vger.kernel.org

+3 -3
+3 -3
drivers/gpu/drm/radeon/kv_dpm.c
··· 1438 1438 return kv_enable_uvd_dpm(rdev, !gate); 1439 1439 } 1440 1440 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) 1442 1442 { 1443 1443 u8 i; 1444 1444 struct radeon_vce_clock_voltage_dependency_table *table = 1445 1445 &rdev->pm.dpm.dyn_state.vce_clock_voltage_dependency_table; 1446 1446 1447 1447 for (i = 0; i < table->count; i++) { 1448 - if (table->entries[i].evclk >= 0) /* XXX */ 1448 + if (table->entries[i].evclk >= evclk) 1449 1449 break; 1450 1450 } 1451 1451 ··· 1468 1468 if (pi->caps_stable_p_state) 1469 1469 pi->vce_boot_level = table->count - 1; 1470 1470 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); 1472 1472 1473 1473 ret = kv_copy_bytes_to_smc(rdev, 1474 1474 pi->dpm_table_start +