aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorJammy Zhou <Jammy.Zhou@amd.com>2015-07-30 04:44:05 -0400
committerAlex Deucher <alexander.deucher@amd.com>2015-08-17 16:50:42 -0400
commit4afcb30383bef8bf972c6aae47995ef314e5f8a1 (patch)
treee903b75b92873341efa915b59af3c011d2040b72 /drivers/gpu
parent1333f723fb6f1356a54135586f1ede44dcaa9652 (diff)
drm/amdgpu: add amdgpu.sched_hw_submission option
This option can be used to specify the max number of submissions in the active HW queue. The default value is 2 now. Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu.h1
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c4
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c3
-rw-r--r--drivers/gpu/drm/amd/scheduler/gpu_scheduler.c5
-rw-r--r--drivers/gpu/drm/amd/scheduler/gpu_scheduler.h5
5 files changed, 12 insertions, 6 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index 4de114711951..6e1fea473a66 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -81,6 +81,7 @@ extern int amdgpu_vm_size;
81extern int amdgpu_vm_block_size; 81extern int amdgpu_vm_block_size;
82extern int amdgpu_enable_scheduler; 82extern int amdgpu_enable_scheduler;
83extern int amdgpu_sched_jobs; 83extern int amdgpu_sched_jobs;
84extern int amdgpu_sched_hw_submission;
84 85
85#define AMDGPU_WAIT_IDLE_TIMEOUT_IN_MS 3000 86#define AMDGPU_WAIT_IDLE_TIMEOUT_IN_MS 3000
86#define AMDGPU_MAX_USEC_TIMEOUT 100000 /* 100 ms */ 87#define AMDGPU_MAX_USEC_TIMEOUT 100000 /* 100 ms */
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index 319de441e907..8bb5610c2d25 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -77,6 +77,7 @@ int amdgpu_vm_block_size = -1;
77int amdgpu_exp_hw_support = 0; 77int amdgpu_exp_hw_support = 0;
78int amdgpu_enable_scheduler = 0; 78int amdgpu_enable_scheduler = 0;
79int amdgpu_sched_jobs = 16; 79int amdgpu_sched_jobs = 16;
80int amdgpu_sched_hw_submission = 2;
80 81
81MODULE_PARM_DESC(vramlimit, "Restrict VRAM for testing, in megabytes"); 82MODULE_PARM_DESC(vramlimit, "Restrict VRAM for testing, in megabytes");
82module_param_named(vramlimit, amdgpu_vram_limit, int, 0600); 83module_param_named(vramlimit, amdgpu_vram_limit, int, 0600);
@@ -147,6 +148,9 @@ module_param_named(enable_scheduler, amdgpu_enable_scheduler, int, 0444);
147MODULE_PARM_DESC(sched_jobs, "the max number of jobs supported in the sw queue (default 16)"); 148MODULE_PARM_DESC(sched_jobs, "the max number of jobs supported in the sw queue (default 16)");
148module_param_named(sched_jobs, amdgpu_sched_jobs, int, 0444); 149module_param_named(sched_jobs, amdgpu_sched_jobs, int, 0444);
149 150
151MODULE_PARM_DESC(sched_hw_submission, "the max number of HW submissions (default 2)");
152module_param_named(sched_hw_submission, amdgpu_sched_hw_submission, int, 0444);
153
150static struct pci_device_id pciidlist[] = { 154static struct pci_device_id pciidlist[] = {
151#ifdef CONFIG_DRM_AMDGPU_CIK 155#ifdef CONFIG_DRM_AMDGPU_CIK
152 /* Kaveri */ 156 /* Kaveri */
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
index b0e15b574606..67d9277d6168 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
@@ -926,7 +926,8 @@ void amdgpu_fence_driver_init_ring(struct amdgpu_ring *ring)
926 if (amdgpu_enable_scheduler) { 926 if (amdgpu_enable_scheduler) {
927 ring->scheduler = amd_sched_create((void *)ring->adev, 927 ring->scheduler = amd_sched_create((void *)ring->adev,
928 &amdgpu_sched_ops, 928 &amdgpu_sched_ops,
929 ring->idx, 5, 0); 929 ring->idx, 5, 0,
930 amdgpu_sched_hw_submission);
930 if (!ring->scheduler) 931 if (!ring->scheduler)
931 DRM_ERROR("Failed to create scheduler on ring %d.\n", 932 DRM_ERROR("Failed to create scheduler on ring %d.\n",
932 ring->idx); 933 ring->idx);
diff --git a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
index 87993e06ba37..042da7ddf8db 100644
--- a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
+++ b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
@@ -468,7 +468,8 @@ struct amd_gpu_scheduler *amd_sched_create(void *device,
468 struct amd_sched_backend_ops *ops, 468 struct amd_sched_backend_ops *ops,
469 unsigned ring, 469 unsigned ring,
470 unsigned granularity, 470 unsigned granularity,
471 unsigned preemption) 471 unsigned preemption,
472 unsigned hw_submission)
472{ 473{
473 struct amd_gpu_scheduler *sched; 474 struct amd_gpu_scheduler *sched;
474 char name[20] = "gpu_sched[0]"; 475 char name[20] = "gpu_sched[0]";
@@ -495,7 +496,7 @@ struct amd_gpu_scheduler *amd_sched_create(void *device,
495 496
496 init_waitqueue_head(&sched->wait_queue); 497 init_waitqueue_head(&sched->wait_queue);
497 if(kfifo_alloc(&sched->active_hw_rq, 498 if(kfifo_alloc(&sched->active_hw_rq,
498 AMD_MAX_ACTIVE_HW_SUBMISSION * sizeof(void *), 499 hw_submission * sizeof(void *),
499 GFP_KERNEL)) { 500 GFP_KERNEL)) {
500 kfree(sched); 501 kfree(sched);
501 return NULL; 502 return NULL;
diff --git a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h
index 52577a88b054..7f6bc26d2d29 100644
--- a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h
+++ b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h
@@ -26,8 +26,6 @@
26 26
27#include <linux/kfifo.h> 27#include <linux/kfifo.h>
28 28
29#define AMD_MAX_ACTIVE_HW_SUBMISSION 2
30
31#define AMD_KERNEL_CONTEXT_ID 0 29#define AMD_KERNEL_CONTEXT_ID 0
32#define AMD_KERNEL_PROCESS_ID 0 30#define AMD_KERNEL_PROCESS_ID 0
33 31
@@ -127,7 +125,8 @@ struct amd_gpu_scheduler *amd_sched_create(void *device,
127 struct amd_sched_backend_ops *ops, 125 struct amd_sched_backend_ops *ops,
128 uint32_t ring, 126 uint32_t ring,
129 uint32_t granularity, 127 uint32_t granularity,
130 uint32_t preemption); 128 uint32_t preemption,
129 uint32_t hw_submission);
131 130
132int amd_sched_destroy(struct amd_gpu_scheduler *sched); 131int amd_sched_destroy(struct amd_gpu_scheduler *sched);
133 132