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

Merge branch 'drm-next-3.11' of git://people.freedesktop.org/~agd5f/linux into drm-next

A few more patches for 3.11:
- add debugfs interface to check current DPM state
- Fix a bug that caused problems with DPM on BTC+ asics.

* 'drm-next-3.11' of git://people.freedesktop.org/~agd5f/linux:
drm/radeon/dpm: add debugfs support for SI
drm/radeon/dpm: add debugfs support for cayman
drm/radeon/dpm: add debugfs support for TN
drm/radeon/dpm: add debugfs support for ON/LN
drm/radeon/dpm: add debugfs support for 7xx/evergreen/btc
drm/radeon/dpm: add debugfs support for rv6xx
drm/radeon/dpm: add infrastructure to support debugfs info
drm/radeon/dpm: re-enable state transitions for Cayman
drm/radeon/dpm: re-enable state transitions for BTC
drm/radeon: fix typo in radeon_atom_init_mc_reg_table()
drm/radeon/atom: fix endian bug in radeon_atom_init_mc_reg_table()
drm/radeon: remove sumo dpm/uvd bringup leftovers

+206 -39
-3
drivers/gpu/drm/radeon/btc_dpm.c
··· 2326 2326 return ret; 2327 2327 } 2328 2328 2329 - #if 0 2330 - /* XXX */ 2331 2329 ret = rv770_unrestrict_performance_levels_after_switch(rdev); 2332 2330 if (ret) { 2333 2331 DRM_ERROR("rv770_unrestrict_performance_levels_after_switch failed\n"); 2334 2332 return ret; 2335 2333 } 2336 - #endif 2337 2334 2338 2335 return 0; 2339 2336 }
+20 -5
drivers/gpu/drm/radeon/ni_dpm.c
··· 1036 1036 0 : -EINVAL; 1037 1037 } 1038 1038 1039 - #if 0 1040 1039 static int ni_unrestrict_performance_levels_after_switch(struct radeon_device *rdev) 1041 1040 { 1042 1041 if (ni_send_msg_to_smc_with_parameter(rdev, PPSMC_MSG_SetForcedLevels, 0) != PPSMC_Result_OK) ··· 1044 1045 return (ni_send_msg_to_smc_with_parameter(rdev, PPSMC_MSG_SetEnabledLevels, 0) == PPSMC_Result_OK) ? 1045 1046 0 : -EINVAL; 1046 1047 } 1047 - #endif 1048 1048 1049 1049 static void ni_stop_smc(struct radeon_device *rdev) 1050 1050 { ··· 3830 3832 return ret; 3831 3833 } 3832 3834 3833 - #if 0 3834 - /* XXX */ 3835 3835 ret = ni_unrestrict_performance_levels_after_switch(rdev); 3836 3836 if (ret) { 3837 3837 DRM_ERROR("ni_unrestrict_performance_levels_after_switch failed\n"); 3838 3838 return ret; 3839 3839 } 3840 - #endif 3841 3840 3842 3841 return 0; 3843 3842 } ··· 4285 4290 i, pl->sclk, pl->mclk, pl->vddc, pl->vddci); 4286 4291 } 4287 4292 r600_dpm_print_ps_status(rdev, rps); 4293 + } 4294 + 4295 + void ni_dpm_debugfs_print_current_performance_level(struct radeon_device *rdev, 4296 + struct seq_file *m) 4297 + { 4298 + struct radeon_ps *rps = rdev->pm.dpm.current_ps; 4299 + struct ni_ps *ps = ni_get_ps(rps); 4300 + struct rv7xx_pl *pl; 4301 + u32 current_index = 4302 + (RREG32(TARGET_AND_CURRENT_PROFILE_INDEX) & CURRENT_STATE_INDEX_MASK) >> 4303 + CURRENT_STATE_INDEX_SHIFT; 4304 + 4305 + if (current_index >= ps->performance_level_count) { 4306 + seq_printf(m, "invalid dpm profile %d\n", current_index); 4307 + } else { 4308 + pl = &ps->performance_levels[current_index]; 4309 + seq_printf(m, "uvd vclk: %d dclk: %d\n", rps->vclk, rps->dclk); 4310 + seq_printf(m, "power level %d sclk: %u mclk: %u vddc: %u vddci: %u\n", 4311 + current_index, pl->sclk, pl->mclk, pl->vddc, pl->vddci); 4312 + } 4288 4313 } 4289 4314 4290 4315 u32 ni_dpm_get_sclk(struct radeon_device *rdev, bool low)
+4
drivers/gpu/drm/radeon/nid.h
··· 618 618 # define MRDCKD0_BYPASS (1 << 30) 619 619 # define MRDCKD1_BYPASS (1 << 31) 620 620 621 + #define TARGET_AND_CURRENT_PROFILE_INDEX 0x66c 622 + # define CURRENT_STATE_INDEX_MASK (0xf << 4) 623 + # define CURRENT_STATE_INDEX_SHIFT 4 624 + 621 625 #define CG_AT 0x6d4 622 626 # define CG_R(x) ((x) << 0) 623 627 # define CG_R_MASK (0xffff << 0)
+2
drivers/gpu/drm/radeon/radeon.h
··· 1667 1667 u32 (*get_sclk)(struct radeon_device *rdev, bool low); 1668 1668 u32 (*get_mclk)(struct radeon_device *rdev, bool low); 1669 1669 void (*print_power_state)(struct radeon_device *rdev, struct radeon_ps *ps); 1670 + void (*debugfs_print_current_performance_level)(struct radeon_device *rdev, struct seq_file *m); 1670 1671 } dpm; 1671 1672 /* pageflipping */ 1672 1673 struct { ··· 2434 2433 #define radeon_dpm_get_sclk(rdev, l) rdev->asic->dpm.get_sclk((rdev), (l)) 2435 2434 #define radeon_dpm_get_mclk(rdev, l) rdev->asic->dpm.get_mclk((rdev), (l)) 2436 2435 #define radeon_dpm_print_power_state(rdev, ps) rdev->asic->dpm.print_power_state((rdev), (ps)) 2436 + #define radeon_dpm_debugfs_print_current_performance_level(rdev, m) rdev->asic->dpm.debugfs_print_current_performance_level((rdev), (m)) 2437 2437 2438 2438 /* Common functions */ 2439 2439 /* AGP */
+8
drivers/gpu/drm/radeon/radeon_asic.c
··· 1160 1160 .get_sclk = &rv6xx_dpm_get_sclk, 1161 1161 .get_mclk = &rv6xx_dpm_get_mclk, 1162 1162 .print_power_state = &rv6xx_dpm_print_power_state, 1163 + .debugfs_print_current_performance_level = &rv6xx_dpm_debugfs_print_current_performance_level, 1163 1164 }, 1164 1165 .pflip = { 1165 1166 .pre_page_flip = &rs600_pre_page_flip, ··· 1392 1391 .get_sclk = &rv770_dpm_get_sclk, 1393 1392 .get_mclk = &rv770_dpm_get_mclk, 1394 1393 .print_power_state = &rv770_dpm_print_power_state, 1394 + .debugfs_print_current_performance_level = &rv770_dpm_debugfs_print_current_performance_level, 1395 1395 }, 1396 1396 .pflip = { 1397 1397 .pre_page_flip = &rs600_pre_page_flip, ··· 1515 1513 .get_sclk = &rv770_dpm_get_sclk, 1516 1514 .get_mclk = &rv770_dpm_get_mclk, 1517 1515 .print_power_state = &rv770_dpm_print_power_state, 1516 + .debugfs_print_current_performance_level = &rv770_dpm_debugfs_print_current_performance_level, 1518 1517 }, 1519 1518 .pflip = { 1520 1519 .pre_page_flip = &evergreen_pre_page_flip, ··· 1638 1635 .get_sclk = &sumo_dpm_get_sclk, 1639 1636 .get_mclk = &sumo_dpm_get_mclk, 1640 1637 .print_power_state = &sumo_dpm_print_power_state, 1638 + .debugfs_print_current_performance_level = &sumo_dpm_debugfs_print_current_performance_level, 1641 1639 }, 1642 1640 .pflip = { 1643 1641 .pre_page_flip = &evergreen_pre_page_flip, ··· 1761 1757 .get_sclk = &btc_dpm_get_sclk, 1762 1758 .get_mclk = &btc_dpm_get_mclk, 1763 1759 .print_power_state = &rv770_dpm_print_power_state, 1760 + .debugfs_print_current_performance_level = &rv770_dpm_debugfs_print_current_performance_level, 1764 1761 }, 1765 1762 .pflip = { 1766 1763 .pre_page_flip = &evergreen_pre_page_flip, ··· 1936 1931 .get_sclk = &ni_dpm_get_sclk, 1937 1932 .get_mclk = &ni_dpm_get_mclk, 1938 1933 .print_power_state = &ni_dpm_print_power_state, 1934 + .debugfs_print_current_performance_level = &ni_dpm_debugfs_print_current_performance_level, 1939 1935 }, 1940 1936 .pflip = { 1941 1937 .pre_page_flip = &evergreen_pre_page_flip, ··· 2109 2103 .get_sclk = &trinity_dpm_get_sclk, 2110 2104 .get_mclk = &trinity_dpm_get_mclk, 2111 2105 .print_power_state = &trinity_dpm_print_power_state, 2106 + .debugfs_print_current_performance_level = &trinity_dpm_debugfs_print_current_performance_level, 2112 2107 }, 2113 2108 .pflip = { 2114 2109 .pre_page_flip = &evergreen_pre_page_flip, ··· 2282 2275 .get_sclk = &ni_dpm_get_sclk, 2283 2276 .get_mclk = &ni_dpm_get_mclk, 2284 2277 .print_power_state = &ni_dpm_print_power_state, 2278 + .debugfs_print_current_performance_level = &si_dpm_debugfs_print_current_performance_level, 2285 2279 }, 2286 2280 .pflip = { 2287 2281 .pre_page_flip = &evergreen_pre_page_flip,
+12
drivers/gpu/drm/radeon/radeon_asic.h
··· 416 416 u32 rv6xx_dpm_get_mclk(struct radeon_device *rdev, bool low); 417 417 void rv6xx_dpm_print_power_state(struct radeon_device *rdev, 418 418 struct radeon_ps *ps); 419 + void rv6xx_dpm_debugfs_print_current_performance_level(struct radeon_device *rdev, 420 + struct seq_file *m); 419 421 /* rs780 dpm */ 420 422 int rs780_dpm_init(struct radeon_device *rdev); 421 423 int rs780_dpm_enable(struct radeon_device *rdev); ··· 476 474 u32 rv770_dpm_get_mclk(struct radeon_device *rdev, bool low); 477 475 void rv770_dpm_print_power_state(struct radeon_device *rdev, 478 476 struct radeon_ps *ps); 477 + void rv770_dpm_debugfs_print_current_performance_level(struct radeon_device *rdev, 478 + struct seq_file *m); 479 479 480 480 /* 481 481 * evergreen ··· 565 561 u32 sumo_dpm_get_mclk(struct radeon_device *rdev, bool low); 566 562 void sumo_dpm_print_power_state(struct radeon_device *rdev, 567 563 struct radeon_ps *ps); 564 + void sumo_dpm_debugfs_print_current_performance_level(struct radeon_device *rdev, 565 + struct seq_file *m); 568 566 569 567 /* 570 568 * cayman ··· 613 607 u32 ni_dpm_get_mclk(struct radeon_device *rdev, bool low); 614 608 void ni_dpm_print_power_state(struct radeon_device *rdev, 615 609 struct radeon_ps *ps); 610 + void ni_dpm_debugfs_print_current_performance_level(struct radeon_device *rdev, 611 + struct seq_file *m); 616 612 int trinity_dpm_init(struct radeon_device *rdev); 617 613 int trinity_dpm_enable(struct radeon_device *rdev); 618 614 void trinity_dpm_disable(struct radeon_device *rdev); ··· 628 620 u32 trinity_dpm_get_mclk(struct radeon_device *rdev, bool low); 629 621 void trinity_dpm_print_power_state(struct radeon_device *rdev, 630 622 struct radeon_ps *ps); 623 + void trinity_dpm_debugfs_print_current_performance_level(struct radeon_device *rdev, 624 + struct seq_file *m); 631 625 632 626 /* DCE6 - SI */ 633 627 void dce6_bandwidth_update(struct radeon_device *rdev); ··· 677 667 void si_dpm_post_set_power_state(struct radeon_device *rdev); 678 668 void si_dpm_fini(struct radeon_device *rdev); 679 669 void si_dpm_display_configuration_changed(struct radeon_device *rdev); 670 + void si_dpm_debugfs_print_current_performance_level(struct radeon_device *rdev, 671 + struct seq_file *m); 680 672 681 673 /* DCE8 - CIK */ 682 674 void dce8_bandwidth_update(struct radeon_device *rdev);
+2 -1
drivers/gpu/drm/radeon/radeon_atombios.c
··· 3732 3732 } 3733 3733 num_ranges++; 3734 3734 } 3735 - reg_data += reg_block->usRegDataBlkSize; 3735 + reg_data = (ATOM_MEMORY_SETTING_DATA_BLOCK *) 3736 + ((u8 *)reg_data + le16_to_cpu(reg_block->usRegDataBlkSize)); 3736 3737 } 3737 3738 if (*(u32 *)reg_data != END_OF_REG_DATA_BLOCK) 3738 3739 return -EINVAL;
+27 -13
drivers/gpu/drm/radeon/radeon_pm.c
··· 1062 1062 ret = device_create_file(rdev->dev, &dev_attr_power_method); 1063 1063 if (ret) 1064 1064 DRM_ERROR("failed to create device file for power method\n"); 1065 + 1066 + if (radeon_debugfs_pm_init(rdev)) { 1067 + DRM_ERROR("Failed to register debugfs file for dpm!\n"); 1068 + } 1069 + 1065 1070 DRM_INFO("radeon: dpm initialized\n"); 1066 1071 } 1067 1072 ··· 1394 1389 struct drm_device *dev = node->minor->dev; 1395 1390 struct radeon_device *rdev = dev->dev_private; 1396 1391 1397 - seq_printf(m, "default engine clock: %u0 kHz\n", rdev->pm.default_sclk); 1398 - /* radeon_get_engine_clock is not reliable on APUs so just print the current clock */ 1399 - if ((rdev->family >= CHIP_PALM) && (rdev->flags & RADEON_IS_IGP)) 1400 - seq_printf(m, "current engine clock: %u0 kHz\n", rdev->pm.current_sclk); 1401 - else 1402 - seq_printf(m, "current engine clock: %u0 kHz\n", radeon_get_engine_clock(rdev)); 1403 - seq_printf(m, "default memory clock: %u0 kHz\n", rdev->pm.default_mclk); 1404 - if (rdev->asic->pm.get_memory_clock) 1405 - seq_printf(m, "current memory clock: %u0 kHz\n", radeon_get_memory_clock(rdev)); 1406 - if (rdev->pm.current_vddc) 1407 - seq_printf(m, "voltage: %u mV\n", rdev->pm.current_vddc); 1408 - if (rdev->asic->pm.get_pcie_lanes) 1409 - seq_printf(m, "PCIE lanes: %d\n", radeon_get_pcie_lanes(rdev)); 1392 + if (rdev->pm.dpm_enabled) { 1393 + mutex_lock(&rdev->pm.mutex); 1394 + if (rdev->asic->dpm.debugfs_print_current_performance_level) 1395 + radeon_dpm_debugfs_print_current_performance_level(rdev, m); 1396 + else 1397 + seq_printf(m, "Unsupported\n"); 1398 + mutex_unlock(&rdev->pm.mutex); 1399 + } else { 1400 + seq_printf(m, "default engine clock: %u0 kHz\n", rdev->pm.default_sclk); 1401 + /* radeon_get_engine_clock is not reliable on APUs so just print the current clock */ 1402 + if ((rdev->family >= CHIP_PALM) && (rdev->flags & RADEON_IS_IGP)) 1403 + seq_printf(m, "current engine clock: %u0 kHz\n", rdev->pm.current_sclk); 1404 + else 1405 + seq_printf(m, "current engine clock: %u0 kHz\n", radeon_get_engine_clock(rdev)); 1406 + seq_printf(m, "default memory clock: %u0 kHz\n", rdev->pm.default_mclk); 1407 + if (rdev->asic->pm.get_memory_clock) 1408 + seq_printf(m, "current memory clock: %u0 kHz\n", radeon_get_memory_clock(rdev)); 1409 + if (rdev->pm.current_vddc) 1410 + seq_printf(m, "voltage: %u mV\n", rdev->pm.current_vddc); 1411 + if (rdev->asic->pm.get_pcie_lanes) 1412 + seq_printf(m, "PCIE lanes: %d\n", radeon_get_pcie_lanes(rdev)); 1413 + } 1410 1414 1411 1415 return 0; 1412 1416 }
+25
drivers/gpu/drm/radeon/rv6xx_dpm.c
··· 2027 2027 r600_dpm_print_ps_status(rdev, rps); 2028 2028 } 2029 2029 2030 + void rv6xx_dpm_debugfs_print_current_performance_level(struct radeon_device *rdev, 2031 + struct seq_file *m) 2032 + { 2033 + struct radeon_ps *rps = rdev->pm.dpm.current_ps; 2034 + struct rv6xx_ps *ps = rv6xx_get_ps(rps); 2035 + struct rv6xx_pl *pl; 2036 + u32 current_index = 2037 + (RREG32(TARGET_AND_CURRENT_PROFILE_INDEX) & CURRENT_PROFILE_INDEX_MASK) >> 2038 + CURRENT_PROFILE_INDEX_SHIFT; 2039 + 2040 + if (current_index > 2) { 2041 + seq_printf(m, "invalid dpm profile %d\n", current_index); 2042 + } else { 2043 + if (current_index == 0) 2044 + pl = &ps->low; 2045 + else if (current_index == 1) 2046 + pl = &ps->medium; 2047 + else /* current_index == 2 */ 2048 + pl = &ps->high; 2049 + seq_printf(m, "uvd vclk: %d dclk: %d\n", rps->vclk, rps->dclk); 2050 + seq_printf(m, "power level %d sclk: %u mclk: %u vddc: %u\n", 2051 + current_index, pl->sclk, pl->mclk, pl->vddc); 2052 + } 2053 + } 2054 + 2030 2055 void rv6xx_dpm_fini(struct radeon_device *rdev) 2031 2056 { 2032 2057 int i;
+30
drivers/gpu/drm/radeon/rv770_dpm.c
··· 2430 2430 r600_dpm_print_ps_status(rdev, rps); 2431 2431 } 2432 2432 2433 + void rv770_dpm_debugfs_print_current_performance_level(struct radeon_device *rdev, 2434 + struct seq_file *m) 2435 + { 2436 + struct radeon_ps *rps = rdev->pm.dpm.current_ps; 2437 + struct rv7xx_ps *ps = rv770_get_ps(rps); 2438 + struct rv7xx_pl *pl; 2439 + u32 current_index = 2440 + (RREG32(TARGET_AND_CURRENT_PROFILE_INDEX) & CURRENT_PROFILE_INDEX_MASK) >> 2441 + CURRENT_PROFILE_INDEX_SHIFT; 2442 + 2443 + if (current_index > 2) { 2444 + seq_printf(m, "invalid dpm profile %d\n", current_index); 2445 + } else { 2446 + if (current_index == 0) 2447 + pl = &ps->low; 2448 + else if (current_index == 1) 2449 + pl = &ps->medium; 2450 + else /* current_index == 2 */ 2451 + pl = &ps->high; 2452 + seq_printf(m, "uvd vclk: %d dclk: %d\n", rps->vclk, rps->dclk); 2453 + if (rdev->family >= CHIP_CEDAR) { 2454 + seq_printf(m, "power level %d sclk: %u mclk: %u vddc: %u vddci: %u\n", 2455 + current_index, pl->sclk, pl->mclk, pl->vddc, pl->vddci); 2456 + } else { 2457 + seq_printf(m, "power level %d sclk: %u mclk: %u vddc: %u\n", 2458 + current_index, pl->sclk, pl->mclk, pl->vddc); 2459 + } 2460 + } 2461 + } 2462 + 2433 2463 void rv770_dpm_fini(struct radeon_device *rdev) 2434 2464 { 2435 2465 int i;
+4
drivers/gpu/drm/radeon/rv770d.h
··· 207 207 # define MUX_TCLK_TO_XCLK (1 << 8) 208 208 # define XTALIN_DIVIDE (1 << 9) 209 209 210 + #define TARGET_AND_CURRENT_PROFILE_INDEX 0x66c 211 + # define CURRENT_PROFILE_INDEX_MASK (0xf << 4) 212 + # define CURRENT_PROFILE_INDEX_SHIFT 4 213 + 210 214 #define S0_VID_LOWER_SMIO_CNTL 0x678 211 215 #define S1_VID_LOWER_SMIO_CNTL 0x67c 212 216 #define S2_VID_LOWER_SMIO_CNTL 0x680
+19
drivers/gpu/drm/radeon/si_dpm.c
··· 6385 6385 r600_free_extended_power_table(rdev); 6386 6386 } 6387 6387 6388 + void si_dpm_debugfs_print_current_performance_level(struct radeon_device *rdev, 6389 + struct seq_file *m) 6390 + { 6391 + struct radeon_ps *rps = rdev->pm.dpm.current_ps; 6392 + struct ni_ps *ps = ni_get_ps(rps); 6393 + struct rv7xx_pl *pl; 6394 + u32 current_index = 6395 + (RREG32(TARGET_AND_CURRENT_PROFILE_INDEX) & CURRENT_STATE_INDEX_MASK) >> 6396 + CURRENT_STATE_INDEX_SHIFT; 6397 + 6398 + if (current_index >= ps->performance_level_count) { 6399 + seq_printf(m, "invalid dpm profile %d\n", current_index); 6400 + } else { 6401 + pl = &ps->performance_levels[current_index]; 6402 + seq_printf(m, "uvd vclk: %d dclk: %d\n", rps->vclk, rps->dclk); 6403 + seq_printf(m, "power level %d sclk: %u mclk: %u vddc: %u vddci: %u pcie gen: %u\n", 6404 + current_index, pl->sclk, pl->mclk, pl->vddc, pl->vddci, pl->pcie_gen + 1); 6405 + } 6406 + }
+4
drivers/gpu/drm/radeon/sid.h
··· 220 220 # define GFX_CLK_OFF_ACPI_D3 (1 << 13) 221 221 # define DYN_LIGHT_SLEEP_EN (1 << 14) 222 222 223 + #define TARGET_AND_CURRENT_PROFILE_INDEX 0x798 224 + # define CURRENT_STATE_INDEX_MASK (0xf << 4) 225 + # define CURRENT_STATE_INDEX_SHIFT 4 226 + 223 227 #define CG_FTV 0x7bc 224 228 225 229 #define CG_FFCT_0 0x7c0
+28 -17
drivers/gpu/drm/radeon/sumo_dpm.c
··· 1133 1133 sumo_take_smu_control(rdev, false); 1134 1134 } 1135 1135 1136 - static void sumo_uvd_init(struct radeon_device *rdev) 1137 - { 1138 - u32 tmp; 1139 - 1140 - tmp = RREG32(CG_VCLK_CNTL); 1141 - tmp &= ~VCLK_DIR_CNTL_EN; 1142 - WREG32(CG_VCLK_CNTL, tmp); 1143 - 1144 - tmp = RREG32(CG_DCLK_CNTL); 1145 - tmp &= ~DCLK_DIR_CNTL_EN; 1146 - WREG32(CG_DCLK_CNTL, tmp); 1147 - 1148 - /* 100 Mhz */ 1149 - radeon_set_uvd_clocks(rdev, 10000, 10000); 1150 - } 1151 - 1152 1136 static int sumo_set_thermal_temperature_range(struct radeon_device *rdev, 1153 1137 int min_temp, int max_temp) 1154 1138 { ··· 1332 1348 sumo_program_acpi_power_level(rdev); 1333 1349 sumo_enable_acpi_pm(rdev); 1334 1350 sumo_take_smu_control(rdev, true); 1335 - sumo_uvd_init(rdev); 1336 1351 } 1337 1352 1338 1353 void sumo_dpm_display_configuration_changed(struct radeon_device *rdev) ··· 1750 1767 sumo_convert_voltage_index_to_value(rdev, pl->vddc_index)); 1751 1768 } 1752 1769 r600_dpm_print_ps_status(rdev, rps); 1770 + } 1771 + 1772 + void sumo_dpm_debugfs_print_current_performance_level(struct radeon_device *rdev, 1773 + struct seq_file *m) 1774 + { 1775 + struct sumo_power_info *pi = sumo_get_pi(rdev); 1776 + struct radeon_ps *rps = rdev->pm.dpm.current_ps; 1777 + struct sumo_ps *ps = sumo_get_ps(rps); 1778 + struct sumo_pl *pl; 1779 + u32 current_index = 1780 + (RREG32(TARGET_AND_CURRENT_PROFILE_INDEX) & CURR_INDEX_MASK) >> 1781 + CURR_INDEX_SHIFT; 1782 + 1783 + if (current_index == BOOST_DPM_LEVEL) { 1784 + pl = &pi->boost_pl; 1785 + seq_printf(m, "uvd vclk: %d dclk: %d\n", rps->vclk, rps->dclk); 1786 + seq_printf(m, "power level %d sclk: %u vddc: %u\n", 1787 + current_index, pl->sclk, 1788 + sumo_convert_voltage_index_to_value(rdev, pl->vddc_index)); 1789 + } else if (current_index >= ps->num_levels) { 1790 + seq_printf(m, "invalid dpm profile %d\n", current_index); 1791 + } else { 1792 + pl = &ps->levels[current_index]; 1793 + seq_printf(m, "uvd vclk: %d dclk: %d\n", rps->vclk, rps->dclk); 1794 + seq_printf(m, "power level %d sclk: %u vddc: %u\n", 1795 + current_index, pl->sclk, 1796 + sumo_convert_voltage_index_to_value(rdev, pl->vddc_index)); 1797 + } 1753 1798 } 1754 1799 1755 1800 void sumo_dpm_fini(struct radeon_device *rdev)
+21
drivers/gpu/drm/radeon/trinity_dpm.c
··· 1855 1855 r600_dpm_print_ps_status(rdev, rps); 1856 1856 } 1857 1857 1858 + void trinity_dpm_debugfs_print_current_performance_level(struct radeon_device *rdev, 1859 + struct seq_file *m) 1860 + { 1861 + struct radeon_ps *rps = rdev->pm.dpm.current_ps; 1862 + struct trinity_ps *ps = trinity_get_ps(rps); 1863 + struct trinity_pl *pl; 1864 + u32 current_index = 1865 + (RREG32(TARGET_AND_CURRENT_PROFILE_INDEX) & CURRENT_STATE_MASK) >> 1866 + CURRENT_STATE_SHIFT; 1867 + 1868 + if (current_index >= ps->num_levels) { 1869 + seq_printf(m, "invalid dpm profile %d\n", current_index); 1870 + } else { 1871 + pl = &ps->levels[current_index]; 1872 + seq_printf(m, "uvd vclk: %d dclk: %d\n", rps->vclk, rps->dclk); 1873 + seq_printf(m, "power level %d sclk: %u vddc: %u\n", 1874 + current_index, pl->sclk, 1875 + trinity_convert_voltage_index_to_value(rdev, pl->vddc_index)); 1876 + } 1877 + } 1878 + 1858 1879 void trinity_dpm_fini(struct radeon_device *rdev) 1859 1880 { 1860 1881 int i;