aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2017-10-08 21:00:16 -0400
committerDave Airlie <airlied@redhat.com>2017-10-08 21:00:16 -0400
commitbb7a9c8d712f37385a706a594d6edf6e6d2669d0 (patch)
tree701a317ca8ecc2bedc40577b657dcdda3e7428c5 /drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
parent15438ab06515b093d61e2f35bb27d21e5e7f966e (diff)
parentd3f04c98ead2b89887e1e3c09b26e4917bacdd9e (diff)
Merge branch 'drm-next-4.15' of git://people.freedesktop.org/~agd5f/linux into drm-next
More new stuff for 4.15. Highlights: - Add clock query interface for raven - Add new FENCE_TO_HANDLE ioctl - UVD video encode ring support on polaris - transparent huge page DMA support - deadlock fixes - compute pipe lru tweaks - powerplay cleanups and regression fixes - fix duplicate symbol issue with radeon and amdgpu - misc bug fixes * 'drm-next-4.15' of git://people.freedesktop.org/~agd5f/linux: (72 commits) drm/radeon/dp: make radeon_dp_get_dp_link_config static drm/radeon: move ci_send_msg_to_smc to where it's used drm/amd/sched: fix deadlock caused by unsignaled fences of deleted jobs drm/amd/sched: NULL out the s_fence field after run_job drm/amd/sched: move adding finish callback to amd_sched_job_begin drm/amd/sched: fix an outdated comment drm/amd/sched: rename amd_sched_entity_pop_job drm/amdgpu: minor coding style fix drm/ttm: add transparent huge page support for DMA allocations v2 drm/ttm: add support for different pool sizes drm/ttm: remove unsued options from ttm_mem_global_alloc_page drm/amdgpu: add uvd enc irq drm/amdgpu: add uvd enc ib test drm/amdgpu: add uvd enc ring test drm/amdgpu: add uvd enc vm functions (v2) drm/amdgpu: add uvd enc into run queue drm/amdgpu: add uvd enc rings drm/amdgpu: add new uvd enc ring methods drm/amdgpu: add uvd enc command in header drm/amdgpu: add uvd enc registers in header ...
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
index 4fcd98e65998..83435ccbad44 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
@@ -109,9 +109,26 @@ void amdgpu_gfx_parse_disable_cu(unsigned *mask, unsigned max_se, unsigned max_s
109 } 109 }
110} 110}
111 111
112static bool amdgpu_gfx_is_multipipe_capable(struct amdgpu_device *adev)
113{
114 if (amdgpu_compute_multipipe != -1) {
115 DRM_INFO("amdgpu: forcing compute pipe policy %d\n",
116 amdgpu_compute_multipipe);
117 return amdgpu_compute_multipipe == 1;
118 }
119
120 /* FIXME: spreading the queues across pipes causes perf regressions
121 * on POLARIS11 compute workloads */
122 if (adev->asic_type == CHIP_POLARIS11)
123 return false;
124
125 return adev->gfx.mec.num_mec > 1;
126}
127
112void amdgpu_gfx_compute_queue_acquire(struct amdgpu_device *adev) 128void amdgpu_gfx_compute_queue_acquire(struct amdgpu_device *adev)
113{ 129{
114 int i, queue, pipe, mec; 130 int i, queue, pipe, mec;
131 bool multipipe_policy = amdgpu_gfx_is_multipipe_capable(adev);
115 132
116 /* policy for amdgpu compute queue ownership */ 133 /* policy for amdgpu compute queue ownership */
117 for (i = 0; i < AMDGPU_MAX_COMPUTE_QUEUES; ++i) { 134 for (i = 0; i < AMDGPU_MAX_COMPUTE_QUEUES; ++i) {
@@ -125,8 +142,7 @@ void amdgpu_gfx_compute_queue_acquire(struct amdgpu_device *adev)
125 if (mec >= adev->gfx.mec.num_mec) 142 if (mec >= adev->gfx.mec.num_mec)
126 break; 143 break;
127 144
128 /* FIXME: spreading the queues across pipes causes perf regressions */ 145 if (multipipe_policy) {
129 if (0) {
130 /* policy: amdgpu owns the first two queues of the first MEC */ 146 /* policy: amdgpu owns the first two queues of the first MEC */
131 if (mec == 0 && queue < 2) 147 if (mec == 0 && queue < 2)
132 set_bit(i, adev->gfx.mec.queue_bitmap); 148 set_bit(i, adev->gfx.mec.queue_bitmap);