aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorDave Airlie <airlied@gmail.com>2015-01-04 02:44:43 -0500
committerDave Airlie <airlied@gmail.com>2015-01-04 02:44:43 -0500
commit2f6bd4da08b5054ba933be6f7b17ed02ad6c4162 (patch)
tree86547dcf829d489fb4b8d54765c735dfaf2625a5 /drivers/gpu
parent379a2d31cb8d1eddf1970be95b871b4371be296a (diff)
parent38c2adfb00db045a876dd667040abc01b788ad61 (diff)
Merge tag 'amdkfd-fixes-2014-12-30' of git://people.freedesktop.org/~gabbayo/linux into linus
Highlights: - Link order changes in drm/Makefile and drivers/Makefile to fix issue when amdkfd, radeon and amd_iommu_v2 are compiled inside the kernel image. - Consider kernel configuration (using #IFDEFs) when radeon initializes amdkfd, due to a specific configuration that makes symbol_request() return a non-NULL value when a symbol doesn't exists. Rusty Russel is helping me to find the root cause, but it may take a while because of year-end so I'm sending this as a band-aid solution. * tag 'amdkfd-fixes-2014-12-30' of git://people.freedesktop.org/~gabbayo/linux: drm/radeon: Init amdkfd only if it was compiled amdkfd: actually allocate longs for the pasid bitmask drm: Put amdkfd before radeon in drm Makefile drivers: Move iommu/ before gpu/ in Makefile amdkfd: Remove duplicate include amdkfd: Fixing topology bug in building sysfs nodes amdkfd: Fix accounting of device queues
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/Makefile2
-rw-r--r--drivers/gpu/drm/amd/amdkfd/kfd_chardev.c1
-rw-r--r--drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c13
-rw-r--r--drivers/gpu/drm/amd/amdkfd/kfd_pasid.c2
-rw-r--r--drivers/gpu/drm/amd/amdkfd/kfd_topology.c2
-rw-r--r--drivers/gpu/drm/radeon/radeon_kfd.c12
6 files changed, 26 insertions, 6 deletions
diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile
index 66e40398b3d3..e620807418ea 100644
--- a/drivers/gpu/drm/Makefile
+++ b/drivers/gpu/drm/Makefile
@@ -37,6 +37,7 @@ obj-$(CONFIG_DRM_MIPI_DSI) += drm_mipi_dsi.o
37obj-$(CONFIG_DRM_TTM) += ttm/ 37obj-$(CONFIG_DRM_TTM) += ttm/
38obj-$(CONFIG_DRM_TDFX) += tdfx/ 38obj-$(CONFIG_DRM_TDFX) += tdfx/
39obj-$(CONFIG_DRM_R128) += r128/ 39obj-$(CONFIG_DRM_R128) += r128/
40obj-$(CONFIG_HSA_AMD) += amd/amdkfd/
40obj-$(CONFIG_DRM_RADEON)+= radeon/ 41obj-$(CONFIG_DRM_RADEON)+= radeon/
41obj-$(CONFIG_DRM_MGA) += mga/ 42obj-$(CONFIG_DRM_MGA) += mga/
42obj-$(CONFIG_DRM_I810) += i810/ 43obj-$(CONFIG_DRM_I810) += i810/
@@ -67,4 +68,3 @@ obj-$(CONFIG_DRM_IMX) += imx/
67obj-y += i2c/ 68obj-y += i2c/
68obj-y += panel/ 69obj-y += panel/
69obj-y += bridge/ 70obj-y += bridge/
70obj-$(CONFIG_HSA_AMD) += amd/amdkfd/
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
index 7d4974b83af7..fe5c543599b0 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
@@ -31,7 +31,6 @@
31#include <uapi/linux/kfd_ioctl.h> 31#include <uapi/linux/kfd_ioctl.h>
32#include <linux/time.h> 32#include <linux/time.h>
33#include <linux/mm.h> 33#include <linux/mm.h>
34#include <linux/uaccess.h>
35#include <uapi/asm-generic/mman-common.h> 34#include <uapi/asm-generic/mman-common.h>
36#include <asm/processor.h> 35#include <asm/processor.h>
37#include "kfd_priv.h" 36#include "kfd_priv.h"
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
index 924e90c072e5..f44d6737b65a 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
@@ -320,6 +320,7 @@ static int update_queue(struct device_queue_manager *dqm, struct queue *q)
320{ 320{
321 int retval; 321 int retval;
322 struct mqd_manager *mqd; 322 struct mqd_manager *mqd;
323 bool prev_active = false;
323 324
324 BUG_ON(!dqm || !q || !q->mqd); 325 BUG_ON(!dqm || !q || !q->mqd);
325 326
@@ -330,10 +331,18 @@ static int update_queue(struct device_queue_manager *dqm, struct queue *q)
330 return -ENOMEM; 331 return -ENOMEM;
331 } 332 }
332 333
333 retval = mqd->update_mqd(mqd, q->mqd, &q->properties);
334 if (q->properties.is_active == true) 334 if (q->properties.is_active == true)
335 prev_active = true;
336
337 /*
338 *
339 * check active state vs. the previous state
340 * and modify counter accordingly
341 */
342 retval = mqd->update_mqd(mqd, q->mqd, &q->properties);
343 if ((q->properties.is_active == true) && (prev_active == false))
335 dqm->queue_count++; 344 dqm->queue_count++;
336 else 345 else if ((q->properties.is_active == false) && (prev_active == true))
337 dqm->queue_count--; 346 dqm->queue_count--;
338 347
339 if (sched_policy != KFD_SCHED_POLICY_NO_HWS) 348 if (sched_policy != KFD_SCHED_POLICY_NO_HWS)
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_pasid.c b/drivers/gpu/drm/amd/amdkfd/kfd_pasid.c
index 71699ad97d74..4c25ef504f79 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_pasid.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_pasid.c
@@ -32,7 +32,7 @@ int kfd_pasid_init(void)
32{ 32{
33 pasid_limit = max_num_of_processes; 33 pasid_limit = max_num_of_processes;
34 34
35 pasid_bitmap = kzalloc(BITS_TO_LONGS(pasid_limit), GFP_KERNEL); 35 pasid_bitmap = kcalloc(BITS_TO_LONGS(pasid_limit), sizeof(long), GFP_KERNEL);
36 if (!pasid_bitmap) 36 if (!pasid_bitmap)
37 return -ENOMEM; 37 return -ENOMEM;
38 38
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
index b11792d7e70e..cca1708fd811 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
@@ -921,7 +921,7 @@ static int kfd_build_sysfs_node_tree(void)
921 uint32_t i = 0; 921 uint32_t i = 0;
922 922
923 list_for_each_entry(dev, &topology_device_list, list) { 923 list_for_each_entry(dev, &topology_device_list, list) {
924 ret = kfd_build_sysfs_node_entry(dev, 0); 924 ret = kfd_build_sysfs_node_entry(dev, i);
925 if (ret < 0) 925 if (ret < 0)
926 return ret; 926 return ret;
927 i++; 927 i++;
diff --git a/drivers/gpu/drm/radeon/radeon_kfd.c b/drivers/gpu/drm/radeon/radeon_kfd.c
index 242fd8b1b221..d3e78b4a6b75 100644
--- a/drivers/gpu/drm/radeon/radeon_kfd.c
+++ b/drivers/gpu/drm/radeon/radeon_kfd.c
@@ -101,6 +101,7 @@ static const struct kgd2kfd_calls *kgd2kfd;
101 101
102bool radeon_kfd_init(void) 102bool radeon_kfd_init(void)
103{ 103{
104#if defined(CONFIG_HSA_AMD_MODULE)
104 bool (*kgd2kfd_init_p)(unsigned, const struct kfd2kgd_calls*, 105 bool (*kgd2kfd_init_p)(unsigned, const struct kfd2kgd_calls*,
105 const struct kgd2kfd_calls**); 106 const struct kgd2kfd_calls**);
106 107
@@ -117,6 +118,17 @@ bool radeon_kfd_init(void)
117 } 118 }
118 119
119 return true; 120 return true;
121#elif defined(CONFIG_HSA_AMD)
122 if (!kgd2kfd_init(KFD_INTERFACE_VERSION, &kfd2kgd, &kgd2kfd)) {
123 kgd2kfd = NULL;
124
125 return false;
126 }
127
128 return true;
129#else
130 return false;
131#endif
120} 132}
121 133
122void radeon_kfd_fini(void) 134void radeon_kfd_fini(void)