Skip to content

Commit 4f8ad40

Browse files
committed
Merge tag 'amd-drm-next-5.12-2021-02-18' of https://gitlab.freedesktop.org/agd5f/linux into drm-next
amd-drm-next-5.12-2021-02-18: amdgpu: - Prefer Bhawan's unused variable fix - Fixes for high priority queues on gfx8,9 - swSMU fixes for sienna cichlid - swSMU fixes for renoir - mmhub client id fixes for arcturus - SMUIO fixes for navi family - swSMU fixes for vangogh - GPU reset cleanup - Display fixes - GFX harvesting fix for sienna cichlid - Fix reference clock on Renoir - Misc fixes and cleanups amdkfd: - Fix for unique id query - Fix recursive lock warnings radeon: - Remove confusing VCE messages on Oland Signed-off-by: Dave Airlie <airlied@redhat.com> From: Alex Deucher <alexdeucher@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210218221531.3870-1-alexander.deucher@amd.com
2 parents ef23d50 + 6e80fb8 commit 4f8ad40

86 files changed

Lines changed: 1147 additions & 342 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

drivers/gpu/drm/amd/amdgpu/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,8 @@ amdgpu-y += \
171171
# add SMUIO block
172172
amdgpu-y += \
173173
smuio_v9_0.o \
174-
smuio_v11_0.o
174+
smuio_v11_0.o \
175+
smuio_v11_0_6.o
175176

176177
# add amdkfd interfaces
177178
amdgpu-y += amdgpu_amdkfd.o

drivers/gpu/drm/amd/amdgpu/amdgpu.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ enum amdgpu_kiq_irq {
287287

288288
#define MAX_KIQ_REG_WAIT 5000 /* in usecs, 5ms */
289289
#define MAX_KIQ_REG_BAILOUT_INTERVAL 5 /* in msecs, 5ms */
290-
#define MAX_KIQ_REG_TRY 80 /* 20 -> 80 */
290+
#define MAX_KIQ_REG_TRY 1000
291291

292292
int amdgpu_device_ip_set_clockgating_state(void *dev,
293293
enum amd_ip_block_type block_type,
@@ -579,7 +579,8 @@ enum amd_reset_method {
579579
AMD_RESET_METHOD_MODE0,
580580
AMD_RESET_METHOD_MODE1,
581581
AMD_RESET_METHOD_MODE2,
582-
AMD_RESET_METHOD_BACO
582+
AMD_RESET_METHOD_BACO,
583+
AMD_RESET_METHOD_PCI,
583584
};
584585

585586
/*
@@ -891,6 +892,7 @@ struct amdgpu_device {
891892
/* For pre-DCE11. DCE11 and later are in "struct amdgpu_device->dm" */
892893
struct work_struct hotplug_work;
893894
struct amdgpu_irq_src crtc_irq;
895+
struct amdgpu_irq_src vline0_irq;
894896
struct amdgpu_irq_src vupdate_irq;
895897
struct amdgpu_irq_src pageflip_irq;
896898
struct amdgpu_irq_src hpd_irq;
@@ -1227,6 +1229,7 @@ bool amdgpu_device_should_recover_gpu(struct amdgpu_device *adev);
12271229
int amdgpu_device_gpu_recover(struct amdgpu_device *adev,
12281230
struct amdgpu_job* job);
12291231
void amdgpu_device_pci_config_reset(struct amdgpu_device *adev);
1232+
int amdgpu_device_pci_reset(struct amdgpu_device *adev);
12301233
bool amdgpu_device_need_post(struct amdgpu_device *adev);
12311234

12321235
void amdgpu_cs_report_moved_bytes(struct amdgpu_device *adev, u64 num_bytes,

drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,7 @@ static int amdgpu_cs_bo_handles_chunk(struct amdgpu_cs_parser *p,
9898
return 0;
9999

100100
error_free:
101-
if (info)
102-
kvfree(info);
101+
kvfree(info);
103102

104103
return r;
105104
}

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -929,6 +929,18 @@ void amdgpu_device_pci_config_reset(struct amdgpu_device *adev)
929929
pci_write_config_dword(adev->pdev, 0x7c, AMDGPU_ASIC_RESET_DATA);
930930
}
931931

932+
/**
933+
* amdgpu_device_pci_reset - reset the GPU using generic PCI means
934+
*
935+
* @adev: amdgpu_device pointer
936+
*
937+
* Resets the GPU using generic pci reset interfaces (FLR, SBR, etc.).
938+
*/
939+
int amdgpu_device_pci_reset(struct amdgpu_device *adev)
940+
{
941+
return pci_reset_function(adev->pdev);
942+
}
943+
932944
/*
933945
* GPU doorbell aperture helpers function.
934946
*/
@@ -1433,10 +1445,8 @@ static void amdgpu_switcheroo_set_state(struct pci_dev *pdev,
14331445
amdgpu_device_resume(dev, true);
14341446

14351447
dev->switch_power_state = DRM_SWITCH_POWER_ON;
1436-
drm_kms_helper_poll_enable(dev);
14371448
} else {
14381449
pr_info("switched off\n");
1439-
drm_kms_helper_poll_disable(dev);
14401450
dev->switch_power_state = DRM_SWITCH_POWER_CHANGING;
14411451
amdgpu_device_suspend(dev, true);
14421452
amdgpu_device_cache_pci_state(pdev);
@@ -3724,7 +3734,7 @@ int amdgpu_device_suspend(struct drm_device *dev, bool fbcon)
37243734

37253735
r = amdgpu_device_ip_suspend_phase1(adev);
37263736

3727-
amdgpu_amdkfd_suspend(adev, !fbcon);
3737+
amdgpu_amdkfd_suspend(adev, adev->in_runpm);
37283738

37293739
/* evict vram memory */
37303740
amdgpu_bo_evict_vram(adev);
@@ -3808,7 +3818,7 @@ int amdgpu_device_resume(struct drm_device *dev, bool fbcon)
38083818
}
38093819
}
38103820
}
3811-
r = amdgpu_amdkfd_resume(adev, !fbcon);
3821+
r = amdgpu_amdkfd_resume(adev, adev->in_runpm);
38123822
if (r)
38133823
return r;
38143824

@@ -4211,6 +4221,7 @@ bool amdgpu_device_should_recover_gpu(struct amdgpu_device *adev)
42114221
case CHIP_NAVI12:
42124222
case CHIP_SIENNA_CICHLID:
42134223
case CHIP_NAVY_FLOUNDER:
4224+
case CHIP_DIMGREY_CAVEFISH:
42144225
break;
42154226
default:
42164227
goto disabled;

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,12 @@ uint amdgpu_pg_mask = 0xffffffff;
132132
uint amdgpu_sdma_phase_quantum = 32;
133133
char *amdgpu_disable_cu = NULL;
134134
char *amdgpu_virtual_display = NULL;
135-
/* OverDrive(bit 14) disabled by default*/
136-
uint amdgpu_pp_feature_mask = 0xffffbfff;
135+
136+
/*
137+
* OverDrive(bit 14) disabled by default
138+
* GFX DCS(bit 19) disabled by default
139+
*/
140+
uint amdgpu_pp_feature_mask = 0xfff7bfff;
137141
uint amdgpu_force_long_training;
138142
int amdgpu_job_hang_limit;
139143
int amdgpu_lbpw = -1;
@@ -789,9 +793,9 @@ module_param_named(tmz, amdgpu_tmz, int, 0444);
789793

790794
/**
791795
* DOC: reset_method (int)
792-
* GPU reset method (-1 = auto (default), 0 = legacy, 1 = mode0, 2 = mode1, 3 = mode2, 4 = baco)
796+
* GPU reset method (-1 = auto (default), 0 = legacy, 1 = mode0, 2 = mode1, 3 = mode2, 4 = baco, 5 = pci)
793797
*/
794-
MODULE_PARM_DESC(reset_method, "GPU reset method (-1 = auto (default), 0 = legacy, 1 = mode0, 2 = mode1, 3 = mode2, 4 = baco/bamaco)");
798+
MODULE_PARM_DESC(reset_method, "GPU reset method (-1 = auto (default), 0 = legacy, 1 = mode0, 2 = mode1, 3 = mode2, 4 = baco/bamaco, 5 = pci)");
795799
module_param_named(reset_method, amdgpu_reset_method, int, 0444);
796800

797801
/**
@@ -1344,11 +1348,12 @@ static int amdgpu_pmops_runtime_suspend(struct device *dev)
13441348
adev->in_runpm = true;
13451349
if (amdgpu_device_supports_atpx(drm_dev))
13461350
drm_dev->switch_power_state = DRM_SWITCH_POWER_CHANGING;
1347-
drm_kms_helper_poll_disable(drm_dev);
13481351

13491352
ret = amdgpu_device_suspend(drm_dev, false);
1350-
if (ret)
1353+
if (ret) {
1354+
adev->in_runpm = false;
13511355
return ret;
1356+
}
13521357

13531358
if (amdgpu_device_supports_atpx(drm_dev)) {
13541359
/* Only need to handle PCI state in the driver for ATPX
@@ -1401,7 +1406,6 @@ static int amdgpu_pmops_runtime_resume(struct device *dev)
14011406
amdgpu_device_baco_exit(drm_dev);
14021407
}
14031408
ret = amdgpu_device_resume(drm_dev, false);
1404-
drm_kms_helper_poll_enable(drm_dev);
14051409
if (amdgpu_device_supports_atpx(drm_dev))
14061410
drm_dev->switch_power_state = DRM_SWITCH_POWER_ON;
14071411
adev->in_runpm = false;

drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -193,15 +193,16 @@ static bool amdgpu_gfx_is_multipipe_capable(struct amdgpu_device *adev)
193193
}
194194

195195
bool amdgpu_gfx_is_high_priority_compute_queue(struct amdgpu_device *adev,
196-
int pipe, int queue)
196+
struct amdgpu_ring *ring)
197197
{
198-
bool multipipe_policy = amdgpu_gfx_is_multipipe_capable(adev);
199-
int cond;
200-
/* Policy: alternate between normal and high priority */
201-
cond = multipipe_policy ? pipe : queue;
202-
203-
return ((cond % 2) != 0);
198+
/* Policy: use 1st queue as high priority compute queue if we
199+
* have more than one compute queue.
200+
*/
201+
if (adev->gfx.num_compute_rings > 1 &&
202+
ring == &adev->gfx.compute_ring[0])
203+
return true;
204204

205+
return false;
205206
}
206207

207208
void amdgpu_gfx_compute_queue_acquire(struct amdgpu_device *adev)

drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ void amdgpu_queue_mask_bit_to_mec_queue(struct amdgpu_device *adev, int bit,
380380
bool amdgpu_gfx_is_mec_queue_enabled(struct amdgpu_device *adev, int mec,
381381
int pipe, int queue);
382382
bool amdgpu_gfx_is_high_priority_compute_queue(struct amdgpu_device *adev,
383-
int pipe, int queue);
383+
struct amdgpu_ring *ring);
384384
int amdgpu_gfx_me_queue_to_bit(struct amdgpu_device *adev, int me,
385385
int pipe, int queue);
386386
void amdgpu_gfx_bit_to_me_queue(struct amdgpu_device *adev, int bit,

drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,10 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs,
195195
if ((ib->flags & AMDGPU_IB_FLAG_EMIT_MEM_SYNC) && ring->funcs->emit_mem_sync)
196196
ring->funcs->emit_mem_sync(ring);
197197

198+
if (ring->funcs->emit_wave_limit &&
199+
ring->hw_prio == AMDGPU_GFX_PIPE_PRIO_HIGH)
200+
ring->funcs->emit_wave_limit(ring, true);
201+
198202
if (ring->funcs->insert_start)
199203
ring->funcs->insert_start(ring);
200204

@@ -295,6 +299,11 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs,
295299
ring->current_ctx = fence_ctx;
296300
if (vm && ring->funcs->emit_switch_buffer)
297301
amdgpu_ring_emit_switch_buffer(ring);
302+
303+
if (ring->funcs->emit_wave_limit &&
304+
ring->hw_prio == AMDGPU_GFX_PIPE_PRIO_HIGH)
305+
ring->funcs->emit_wave_limit(ring, false);
306+
298307
amdgpu_ring_commit(ring);
299308
return 0;
300309
}

drivers/gpu/drm/amd/amdgpu/amdgpu_nbio.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ struct amdgpu_nbio_funcs {
8888
int (*ras_late_init)(struct amdgpu_device *adev);
8989
void (*enable_aspm)(struct amdgpu_device *adev,
9090
bool enable);
91+
void (*program_aspm)(struct amdgpu_device *adev);
9192
};
9293

9394
struct amdgpu_nbio {

drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring,
166166
unsigned int max_dw, struct amdgpu_irq_src *irq_src,
167167
unsigned int irq_type, unsigned int hw_prio)
168168
{
169-
int r, i;
169+
int r;
170170
int sched_hw_submission = amdgpu_sched_hw_submission;
171171
u32 *num_sched;
172172
u32 hw_ip;
@@ -258,8 +258,7 @@ int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring,
258258
}
259259

260260
ring->max_dw = max_dw;
261-
ring->priority = DRM_SCHED_PRIORITY_NORMAL;
262-
mutex_init(&ring->priority_mutex);
261+
ring->hw_prio = hw_prio;
263262

264263
if (!ring->no_scheduler) {
265264
hw_ip = ring->funcs->type;
@@ -268,9 +267,6 @@ int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring,
268267
&ring->sched;
269268
}
270269

271-
for (i = DRM_SCHED_PRIORITY_MIN; i < DRM_SCHED_PRIORITY_COUNT; ++i)
272-
atomic_set(&ring->num_jobs[i], 0);
273-
274270
return 0;
275271
}
276272

0 commit comments

Comments
 (0)