aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/files/0078-drm-amdgpu-support-per-device-powerplay-enablement-v.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-kernel/linux/files/0078-drm-amdgpu-support-per-device-powerplay-enablement-v.patch')
-rw-r--r--common/recipes-kernel/linux/files/0078-drm-amdgpu-support-per-device-powerplay-enablement-v.patch406
1 files changed, 0 insertions, 406 deletions
diff --git a/common/recipes-kernel/linux/files/0078-drm-amdgpu-support-per-device-powerplay-enablement-v.patch b/common/recipes-kernel/linux/files/0078-drm-amdgpu-support-per-device-powerplay-enablement-v.patch
deleted file mode 100644
index 9b184872..00000000
--- a/common/recipes-kernel/linux/files/0078-drm-amdgpu-support-per-device-powerplay-enablement-v.patch
+++ /dev/null
@@ -1,406 +0,0 @@
-From e3d67c2f684799961df46e685a7808b7f4deb7d3 Mon Sep 17 00:00:00 2001
-From: Jammy Zhou <Jammy.Zhou@amd.com>
-Date: Tue, 10 Nov 2015 18:31:08 -0500
-Subject: [PATCH 0078/1110] drm/amdgpu: support per device powerplay enablement
- (v2)
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The amdgu_powerplay variable is global for multiple GPU instances.
-
-v2: fold in Flora's module option change, protect adev reference in
-macros
-
-Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
-Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
-Reviewed-by: Christian K├Ânig <christian.koenig@amd.com>
----
- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 71 ++++++++++++++-------------
- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 +-
- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 30 +++++------
- drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c | 15 +++---
- drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 4 +-
- drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | 2 +-
- 6 files changed, 65 insertions(+), 61 deletions(-)
-
-diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
-index 0c66b15..ea4a467 100644
---- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
-+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
-@@ -2049,6 +2049,7 @@ struct amdgpu_device {
-
- /* powerplay */
- struct amd_powerplay powerplay;
-+ bool pp_enabled;
-
- /* dpm */
- struct amdgpu_pm pm;
-@@ -2277,68 +2278,68 @@ amdgpu_get_sdma_instance(struct amdgpu_ring *ring)
- #define amdgpu_dpm_enable_bapm(adev, e) (adev)->pm.funcs->enable_bapm((adev), (e))
-
- #define amdgpu_dpm_get_temperature(adev) \
-- amdgpu_powerplay ? \
-- (adev)->powerplay.pp_funcs->get_temperature((adev)->powerplay.pp_handle) : \
-- (adev)->pm.funcs->get_temperature((adev))
-+ (adev)->pp_enabled ? \
-+ (adev)->powerplay.pp_funcs->get_temperature((adev)->powerplay.pp_handle) : \
-+ (adev)->pm.funcs->get_temperature((adev))
-
- #define amdgpu_dpm_set_fan_control_mode(adev, m) \
-- amdgpu_powerplay ? \
-- (adev)->powerplay.pp_funcs->set_fan_control_mode((adev)->powerplay.pp_handle, (m)) : \
-- (adev)->pm.funcs->set_fan_control_mode((adev), (m))
-+ (adev)->pp_enabled ? \
-+ (adev)->powerplay.pp_funcs->set_fan_control_mode((adev)->powerplay.pp_handle, (m)) : \
-+ (adev)->pm.funcs->set_fan_control_mode((adev), (m))
-
- #define amdgpu_dpm_get_fan_control_mode(adev) \
-- amdgpu_powerplay ? \
-- (adev)->powerplay.pp_funcs->get_fan_control_mode((adev)->powerplay.pp_handle) : \
-- (adev)->pm.funcs->get_fan_control_mode((adev))
-+ (adev)->pp_enabled ? \
-+ (adev)->powerplay.pp_funcs->get_fan_control_mode((adev)->powerplay.pp_handle) : \
-+ (adev)->pm.funcs->get_fan_control_mode((adev))
-
- #define amdgpu_dpm_set_fan_speed_percent(adev, s) \
-- amdgpu_powerplay ? \
-- (adev)->powerplay.pp_funcs->set_fan_speed_percent((adev)->powerplay.pp_handle, (s)) : \
-- (adev)->pm.funcs->set_fan_speed_percent((adev), (s))
-+ (adev)->pp_enabled ? \
-+ (adev)->powerplay.pp_funcs->set_fan_speed_percent((adev)->powerplay.pp_handle, (s)) : \
-+ (adev)->pm.funcs->set_fan_speed_percent((adev), (s))
-
- #define amdgpu_dpm_get_fan_speed_percent(adev, s) \
-- amdgpu_powerplay ? \
-- (adev)->powerplay.pp_funcs->get_fan_speed_percent((adev)->powerplay.pp_handle, (s)) : \
-- (adev)->pm.funcs->get_fan_speed_percent((adev), (s))
-+ (adev)->pp_enabled ? \
-+ (adev)->powerplay.pp_funcs->get_fan_speed_percent((adev)->powerplay.pp_handle, (s)) : \
-+ (adev)->pm.funcs->get_fan_speed_percent((adev), (s))
-
- #define amdgpu_dpm_get_sclk(adev, l) \
-- amdgpu_powerplay ? \
-- (adev)->powerplay.pp_funcs->get_sclk((adev)->powerplay.pp_handle, (l)) : \
-+ (adev)->pp_enabled ? \
-+ (adev)->powerplay.pp_funcs->get_sclk((adev)->powerplay.pp_handle, (l)) : \
- (adev)->pm.funcs->get_sclk((adev), (l))
-
- #define amdgpu_dpm_get_mclk(adev, l) \
-- amdgpu_powerplay ? \
-- (adev)->powerplay.pp_funcs->get_mclk((adev)->powerplay.pp_handle, (l)) : \
-- (adev)->pm.funcs->get_mclk((adev), (l))
-+ (adev)->pp_enabled ? \
-+ (adev)->powerplay.pp_funcs->get_mclk((adev)->powerplay.pp_handle, (l)) : \
-+ (adev)->pm.funcs->get_mclk((adev), (l))
-
-
- #define amdgpu_dpm_force_performance_level(adev, l) \
-- amdgpu_powerplay ? \
-- (adev)->powerplay.pp_funcs->force_performance_level((adev)->powerplay.pp_handle, (l)) : \
-- (adev)->pm.funcs->force_performance_level((adev), (l))
-+ (adev)->pp_enabled ? \
-+ (adev)->powerplay.pp_funcs->force_performance_level((adev)->powerplay.pp_handle, (l)) : \
-+ (adev)->pm.funcs->force_performance_level((adev), (l))
-
- #define amdgpu_dpm_powergate_uvd(adev, g) \
-- amdgpu_powerplay ? \
-- (adev)->powerplay.pp_funcs->powergate_uvd((adev)->powerplay.pp_handle, (g)) : \
-- (adev)->pm.funcs->powergate_uvd((adev), (g))
-+ (adev)->pp_enabled ? \
-+ (adev)->powerplay.pp_funcs->powergate_uvd((adev)->powerplay.pp_handle, (g)) : \
-+ (adev)->pm.funcs->powergate_uvd((adev), (g))
-
- #define amdgpu_dpm_powergate_vce(adev, g) \
-- amdgpu_powerplay ? \
-- (adev)->powerplay.pp_funcs->powergate_vce((adev)->powerplay.pp_handle, (g)) : \
-- (adev)->pm.funcs->powergate_vce((adev), (g))
-+ (adev)->pp_enabled ? \
-+ (adev)->powerplay.pp_funcs->powergate_vce((adev)->powerplay.pp_handle, (g)) : \
-+ (adev)->pm.funcs->powergate_vce((adev), (g))
-
- #define amdgpu_dpm_debugfs_print_current_performance_level(adev, m) \
-- amdgpu_powerplay ? \
-- (adev)->powerplay.pp_funcs->print_current_performance_level((adev)->powerplay.pp_handle, (m)) : \
-- (adev)->pm.funcs->debugfs_print_current_performance_level((adev), (m))
-+ (adev)->pp_enabled ? \
-+ (adev)->powerplay.pp_funcs->print_current_performance_level((adev)->powerplay.pp_handle, (m)) : \
-+ (adev)->pm.funcs->debugfs_print_current_performance_level((adev), (m))
-
- #define amdgpu_dpm_get_current_power_state(adev) \
-- (adev)->powerplay.pp_funcs->get_current_power_state((adev)->powerplay.pp_handle)
-+ (adev)->powerplay.pp_funcs->get_current_power_state((adev)->powerplay.pp_handle)
-
- #define amdgpu_dpm_get_performance_level(adev) \
-- (adev)->powerplay.pp_funcs->get_performance_level((adev)->powerplay.pp_handle)
-+ (adev)->powerplay.pp_funcs->get_performance_level((adev)->powerplay.pp_handle)
-
--#define amdgpu_dpm_dispatch_task(adev, event_id, input, output) \
-+#define amdgpu_dpm_dispatch_task(adev, event_id, input, output) \
- (adev)->powerplay.pp_funcs->dispatch_tasks((adev)->powerplay.pp_handle, (event_id), (input), (output))
-
- #define amdgpu_gds_switch(adev, r, v, d, w, a) (adev)->gds.funcs->patch_gds_switch((r), (v), (d), (w), (a))
-diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
-index 8aedfa6..9c1af89 100644
---- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
-+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
-@@ -82,7 +82,7 @@ int amdgpu_enable_scheduler = 1;
- int amdgpu_sched_jobs = 32;
- int amdgpu_sched_hw_submission = 2;
- int amdgpu_enable_semaphores = 0;
--int amdgpu_powerplay = 0;
-+int amdgpu_powerplay = -1;
-
- MODULE_PARM_DESC(vramlimit, "Restrict VRAM for testing, in megabytes");
- module_param_named(vramlimit, amdgpu_vram_limit, int, 0600);
-@@ -166,7 +166,7 @@ MODULE_PARM_DESC(enable_semaphores, "Enable semaphores (1 = enable, 0 = disable
- module_param_named(enable_semaphores, amdgpu_enable_semaphores, int, 0644);
-
- #ifdef CONFIG_DRM_AMD_POWERPLAY
--MODULE_PARM_DESC(powerplay, "Powerplay component (1 = enable, 0 = disable (default))");
-+MODULE_PARM_DESC(powerplay, "Powerplay component (1 = enable, 0 = disable, -1 = auto (default))");
- module_param_named(powerplay, amdgpu_powerplay, int, 0444);
- #endif
-
-diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
-index 754c169..e05ae17 100644
---- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
-+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
-@@ -36,7 +36,7 @@ static int amdgpu_debugfs_pm_init(struct amdgpu_device *adev);
-
- void amdgpu_pm_acpi_event_handler(struct amdgpu_device *adev)
- {
-- if (amdgpu_powerplay)
-+ if (adev->pp_enabled)
- /* TODO */
- return;
-
-@@ -60,7 +60,7 @@ static ssize_t amdgpu_get_dpm_state(struct device *dev,
- struct amdgpu_device *adev = ddev->dev_private;
- enum amd_pm_state_type pm;
-
-- if (amdgpu_powerplay) {
-+ if (adev->pp_enabled) {
- pm = amdgpu_dpm_get_current_power_state(adev);
- } else
- pm = adev->pm.dpm.user_state;
-@@ -90,7 +90,7 @@ static ssize_t amdgpu_set_dpm_state(struct device *dev,
- goto fail;
- }
-
-- if (amdgpu_powerplay) {
-+ if (adev->pp_enabled) {
- amdgpu_dpm_dispatch_task(adev, AMD_PP_EVENT_ENABLE_USER_STATE, &state, NULL);
- } else {
- mutex_lock(&adev->pm.mutex);
-@@ -113,7 +113,7 @@ static ssize_t amdgpu_get_dpm_forced_performance_level(struct device *dev,
- struct drm_device *ddev = dev_get_drvdata(dev);
- struct amdgpu_device *adev = ddev->dev_private;
-
-- if (amdgpu_powerplay) {
-+ if (adev->pp_enabled) {
- enum amd_dpm_forced_level level;
-
- level = amdgpu_dpm_get_performance_level(adev);
-@@ -151,7 +151,7 @@ static ssize_t amdgpu_set_dpm_forced_performance_level(struct device *dev,
- goto fail;
- }
-
-- if (amdgpu_powerplay)
-+ if (adev->pp_enabled)
- amdgpu_dpm_force_performance_level(adev, level);
- else {
- mutex_lock(&adev->pm.mutex);
-@@ -184,7 +184,7 @@ static ssize_t amdgpu_hwmon_show_temp(struct device *dev,
- struct amdgpu_device *adev = dev_get_drvdata(dev);
- int temp;
-
-- if (!amdgpu_powerplay && !adev->pm.funcs->get_temperature)
-+ if (!adev->pp_enabled && !adev->pm.funcs->get_temperature)
- temp = 0;
- else
- temp = amdgpu_dpm_get_temperature(adev);
-@@ -215,7 +215,7 @@ static ssize_t amdgpu_hwmon_get_pwm1_enable(struct device *dev,
- struct amdgpu_device *adev = dev_get_drvdata(dev);
- u32 pwm_mode = 0;
-
-- if (!amdgpu_powerplay && !adev->pm.funcs->get_fan_control_mode)
-+ if (!adev->pp_enabled && !adev->pm.funcs->get_fan_control_mode)
- return -EINVAL;
-
- pwm_mode = amdgpu_dpm_get_fan_control_mode(adev);
-@@ -233,7 +233,7 @@ static ssize_t amdgpu_hwmon_set_pwm1_enable(struct device *dev,
- int err;
- int value;
-
-- if (!amdgpu_powerplay && !adev->pm.funcs->set_fan_control_mode)
-+ if (!adev->pp_enabled && !adev->pm.funcs->set_fan_control_mode)
- return -EINVAL;
-
- err = kstrtoint(buf, 10, &value);
-@@ -340,7 +340,7 @@ static umode_t hwmon_attributes_visible(struct kobject *kobj,
- attr == &sensor_dev_attr_pwm1_min.dev_attr.attr))
- return 0;
-
-- if (amdgpu_powerplay)
-+ if (adev->pp_enabled)
- return effective_mode;
-
- /* Skip fan attributes if fan is not present */
-@@ -675,7 +675,7 @@ done:
-
- void amdgpu_dpm_enable_uvd(struct amdgpu_device *adev, bool enable)
- {
-- if (amdgpu_powerplay)
-+ if (adev->pp_enabled)
- amdgpu_dpm_powergate_uvd(adev, !enable);
- else {
- if (adev->pm.funcs->powergate_uvd) {
-@@ -702,7 +702,7 @@ void amdgpu_dpm_enable_uvd(struct amdgpu_device *adev, bool enable)
-
- void amdgpu_dpm_enable_vce(struct amdgpu_device *adev, bool enable)
- {
-- if (amdgpu_powerplay)
-+ if (adev->pp_enabled)
- amdgpu_dpm_powergate_vce(adev, !enable);
- else {
- if (adev->pm.funcs->powergate_vce) {
-@@ -730,7 +730,7 @@ void amdgpu_pm_print_power_states(struct amdgpu_device *adev)
- {
- int i;
-
-- if (amdgpu_powerplay)
-+ if (adev->pp_enabled)
- /* TO DO */
- return;
-
-@@ -746,7 +746,7 @@ int amdgpu_pm_sysfs_init(struct amdgpu_device *adev)
- if (adev->pm.sysfs_initialized)
- return 0;
-
-- if (!amdgpu_powerplay) {
-+ if (!adev->pp_enabled) {
- if (adev->pm.funcs->get_temperature == NULL)
- return 0;
- }
-@@ -799,7 +799,7 @@ void amdgpu_pm_compute_clocks(struct amdgpu_device *adev)
- if (!adev->pm.dpm_enabled)
- return;
-
-- if (amdgpu_powerplay) {
-+ if (adev->pp_enabled) {
- int i = 0;
-
- amdgpu_display_bandwidth_update(adev);
-@@ -853,7 +853,7 @@ static int amdgpu_debugfs_pm_info(struct seq_file *m, void *data)
- seq_printf(m, "dpm not enabled\n");
- return 0;
- }
-- if (amdgpu_powerplay) {
-+ if (adev->pp_enabled) {
- amdgpu_dpm_debugfs_print_current_performance_level(adev, m);
- } else {
- mutex_lock(&adev->pm.mutex);
-diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c
-index 1ff6fd5..6b46fbf 100644
---- a/drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c
-+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c
-@@ -40,7 +40,7 @@ static int amdgpu_powerplay_init(struct amdgpu_device *adev)
-
- amd_pp = &(adev->powerplay);
-
-- if (amdgpu_powerplay) {
-+ if (adev->pp_enabled) {
- #ifdef CONFIG_DRM_AMD_POWERPLAY
- struct amd_pp_init *pp_init;
-
-@@ -100,11 +100,14 @@ static int amdgpu_pp_early_init(void *handle)
- switch (adev->asic_type) {
- case CHIP_TONGA:
- case CHIP_FIJI:
-- amdgpu_powerplay = 1;
-+ adev->pp_enabled = (amdgpu_powerplay == 0) ? false : true;
- break;
- default:
-+ adev->pp_enabled = (amdgpu_powerplay > 0) ? true : false;
- break;
- }
-+#else
-+ adev->pp_enabled = false;
- #endif
-
- ret = amdgpu_powerplay_init(adev);
-@@ -127,7 +130,7 @@ static int amdgpu_pp_sw_init(void *handle)
- adev->powerplay.pp_handle);
-
- #ifdef CONFIG_DRM_AMD_POWERPLAY
-- if (amdgpu_powerplay) {
-+ if (adev->pp_enabled) {
- adev->pm.dpm_enabled = true;
- amdgpu_pm_sysfs_init(adev);
- }
-@@ -148,7 +151,7 @@ static int amdgpu_pp_sw_fini(void *handle)
- return ret;
-
- #ifdef CONFIG_DRM_AMD_POWERPLAY
-- if (amdgpu_powerplay) {
-+ if (adev->pp_enabled) {
- amdgpu_pm_sysfs_fini(adev);
- amd_powerplay_fini(adev->powerplay.pp_handle);
- }
-@@ -162,7 +165,7 @@ static int amdgpu_pp_hw_init(void *handle)
- int ret = 0;
- struct amdgpu_device *adev = (struct amdgpu_device *)handle;
-
-- if (amdgpu_powerplay && adev->firmware.smu_load)
-+ if (adev->pp_enabled && adev->firmware.smu_load)
- amdgpu_ucode_init_bo(adev);
-
- if (adev->powerplay.ip_funcs->hw_init)
-@@ -181,7 +184,7 @@ static int amdgpu_pp_hw_fini(void *handle)
- ret = adev->powerplay.ip_funcs->hw_fini(
- adev->powerplay.pp_handle);
-
-- if (amdgpu_powerplay && adev->firmware.smu_load)
-+ if (adev->pp_enabled && adev->firmware.smu_load)
- amdgpu_ucode_fini_bo(adev);
-
- return ret;
-diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
-index 23fde5b..2fda19c 100644
---- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
-+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
-@@ -2902,7 +2902,7 @@ static int gfx_v8_0_rlc_resume(struct amdgpu_device *adev)
-
- gfx_v8_0_rlc_reset(adev);
-
-- if (!amdgpu_powerplay) {
-+ if (!adev->pp_enabled) {
- if (!adev->firmware.smu_load) {
- /* legacy rlc firmware loading */
- r = gfx_v8_0_rlc_load_microcode(adev);
-@@ -3804,7 +3804,7 @@ static int gfx_v8_0_cp_resume(struct amdgpu_device *adev)
- if (!(adev->flags & AMD_IS_APU))
- gfx_v8_0_enable_gui_idle_interrupt(adev, false);
-
-- if (!amdgpu_powerplay) {
-+ if (!adev->pp_enabled) {
- if (!adev->firmware.smu_load) {
- /* legacy firmware loading */
- r = gfx_v8_0_cp_gfx_load_microcode(adev);
-diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
-index 8091c1c..c741c09 100644
---- a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
-+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
-@@ -727,7 +727,7 @@ static int sdma_v3_0_start(struct amdgpu_device *adev)
- {
- int r, i;
-
-- if (!amdgpu_powerplay) {
-+ if (!adev->pp_enabled) {
- if (!adev->firmware.smu_load) {
- r = sdma_v3_0_load_microcode(adev);
- if (r)
---
-2.7.4
-