aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
diff options
context:
space:
mode:
authorOded Gabbay <oded.gabbay@gmail.com>2015-06-12 14:35:14 -0400
committerOded Gabbay <oded.gabbay@gmail.com>2015-07-20 02:16:47 -0400
commit130e0371b7d454bb4a861253c822b9f911ad5d19 (patch)
treea2ec6267c5d4eff7caf1caa469e61402c3c0cd29 /drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
parent22801f76fa59870aed2c0b8a4eb6c8d6993347ae (diff)
drm/amdgpu: Add H/W agnostic amdgpu <--> amdkfd interface
This patch adds an interface file between amdgpu and amdkfd. This interface file is H/W agnostic, thus containing functions that operate the same for any AMD APU/GPU H/W generation. The functions in this interface mirror (some) of the functions in radeon_kfd.c (the radeon<-->amdkfd interface file). The main functions are: - amdgpu_amdkfd_init - initialize the amdkfd module - amdgpu_amdkfd_load_interface - load the H/W interface according to the currently probed device - amdgpu_amdkfd_device_probe - probe the device in amdkfd - amdgpu_amdkfd_device_init - initialize the device in amdkfd - amdgpu_amdkfd_interrupt - call the ISR of amdkfd - amdgpu_amdkfd_suspend - suspend callback from amdgpu - amdgpu_amdkfd_resume - resume callback from amdgpu This patch also modifies the relevant amdgpu files, to use this new interface. Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
index 5533434c7a8f..8c40a9671b9f 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
@@ -34,6 +34,7 @@
34#include <linux/vga_switcheroo.h> 34#include <linux/vga_switcheroo.h>
35#include <linux/slab.h> 35#include <linux/slab.h>
36#include <linux/pm_runtime.h> 36#include <linux/pm_runtime.h>
37#include "amdgpu_amdkfd.h"
37 38
38#if defined(CONFIG_VGA_SWITCHEROO) 39#if defined(CONFIG_VGA_SWITCHEROO)
39bool amdgpu_has_atpx(void); 40bool amdgpu_has_atpx(void);
@@ -61,6 +62,8 @@ int amdgpu_driver_unload_kms(struct drm_device *dev)
61 62
62 pm_runtime_get_sync(dev->dev); 63 pm_runtime_get_sync(dev->dev);
63 64
65 amdgpu_amdkfd_device_fini(adev);
66
64 amdgpu_acpi_fini(adev); 67 amdgpu_acpi_fini(adev);
65 68
66 amdgpu_device_fini(adev); 69 amdgpu_device_fini(adev);
@@ -118,6 +121,10 @@ int amdgpu_driver_load_kms(struct drm_device *dev, unsigned long flags)
118 "Error during ACPI methods call\n"); 121 "Error during ACPI methods call\n");
119 } 122 }
120 123
124 amdgpu_amdkfd_load_interface(adev);
125 amdgpu_amdkfd_device_probe(adev);
126 amdgpu_amdkfd_device_init(adev);
127
121 if (amdgpu_device_is_px(dev)) { 128 if (amdgpu_device_is_px(dev)) {
122 pm_runtime_use_autosuspend(dev->dev); 129 pm_runtime_use_autosuspend(dev->dev);
123 pm_runtime_set_autosuspend_delay(dev->dev, 5000); 130 pm_runtime_set_autosuspend_delay(dev->dev, 5000);