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

Configure Feed

Select the types of activity you want to include in your feed.

drm/amd/pm: Use smu vram copy in SMUv13

Use smu vram copy wrapper function for vram copy operations in
SMUv13.0.6 and SMUv13.0.12.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Asad Kamal <asad.kamal@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Lijo Lazar and committed by
Alex Deucher
3bec5825 f2275ea9

+19 -9
+7 -2
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_12_ppt.c
··· 479 479 } 480 480 481 481 amdgpu_hdp_invalidate(smu->adev, NULL); 482 + 483 + ret = smu_cmn_vram_cpy(smu, sys_table->cache.buffer, 484 + table->cpu_addr, 485 + smu_v13_0_12_get_system_metrics_size()); 486 + if (ret) 487 + return ret; 488 + 482 489 smu_table_cache_update_time(sys_table, jiffies); 483 - memcpy(sys_table->cache.buffer, table->cpu_addr, 484 - smu_v13_0_12_get_system_metrics_size()); 485 490 486 491 return 0; 487 492 }
+12 -7
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c
··· 778 778 } 779 779 780 780 amdgpu_hdp_invalidate(smu->adev, NULL); 781 - memcpy(smu_table->metrics_table, table->cpu_addr, table_size); 781 + ret = smu_cmn_vram_cpy(smu, smu_table->metrics_table, 782 + table->cpu_addr, table_size); 783 + if (ret) 784 + return ret; 782 785 783 786 smu_table->metrics_time = jiffies; 784 787 } ··· 860 857 } 861 858 862 859 amdgpu_hdp_invalidate(smu->adev, NULL); 863 - memcpy(smu_table->metrics_table, table->cpu_addr, table_size); 864 860 865 - return 0; 861 + return smu_cmn_vram_cpy(smu, smu_table->metrics_table, 862 + table->cpu_addr, table_size); 866 863 } 867 864 868 865 static void smu_v13_0_6_update_caps(struct smu_context *smu) ··· 2407 2404 2408 2405 table_size = smu_table->tables[SMU_TABLE_I2C_COMMANDS].size; 2409 2406 2410 - memcpy(table->cpu_addr, table_data, table_size); 2407 + ret = smu_cmn_vram_cpy(smu, table->cpu_addr, table_data, table_size); 2408 + if (ret) 2409 + return ret; 2410 + 2411 2411 /* Flush hdp cache */ 2412 2412 amdgpu_hdp_flush(adev, NULL); 2413 - ret = smu_cmn_send_smc_msg(smu, SMU_MSG_RequestI2cTransaction, 2414 - NULL); 2415 2413 2416 - return ret; 2414 + return smu_cmn_send_smc_msg(smu, SMU_MSG_RequestI2cTransaction, 2415 + NULL); 2417 2416 } 2418 2417 2419 2418 static int smu_v13_0_6_i2c_xfer(struct i2c_adapter *i2c_adap,