Skip to content

Commit 362b86a

Browse files
committed
Merge tag 'amd-drm-fixes-5.6-2020-03-19' of git://people.freedesktop.org/~agd5f/linux into drm-fixes
amd-drm-fixes-5.6-2020-03-19: amdgpu: - Pageflip fix - VCN clockgating fixes - GPR debugfs fix for umr - GPU reset fix - eDP fix for MBP - DCN2.x fix Signed-off-by: Dave Airlie <[email protected]> From: Alex Deucher <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents 0f08b31 + eb916a5 commit 362b86a

File tree

11 files changed

+38
-13
lines changed

11 files changed

+38
-13
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -781,11 +781,11 @@ static ssize_t amdgpu_debugfs_gpr_read(struct file *f, char __user *buf,
781781
ssize_t result = 0;
782782
uint32_t offset, se, sh, cu, wave, simd, thread, bank, *data;
783783

784-
if (size & 3 || *pos & 3)
784+
if (size > 4096 || size & 3 || *pos & 3)
785785
return -EINVAL;
786786

787787
/* decode offset */
788-
offset = *pos & GENMASK_ULL(11, 0);
788+
offset = (*pos & GENMASK_ULL(11, 0)) >> 2;
789789
se = (*pos & GENMASK_ULL(19, 12)) >> 12;
790790
sh = (*pos & GENMASK_ULL(27, 20)) >> 20;
791791
cu = (*pos & GENMASK_ULL(35, 28)) >> 28;
@@ -823,7 +823,7 @@ static ssize_t amdgpu_debugfs_gpr_read(struct file *f, char __user *buf,
823823
while (size) {
824824
uint32_t value;
825825

826-
value = data[offset++];
826+
value = data[result >> 2];
827827
r = put_user(value, (uint32_t *)buf);
828828
if (r) {
829829
result = r;

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3913,6 +3913,8 @@ static int amdgpu_do_asic_reset(struct amdgpu_hive_info *hive,
39133913
if (r)
39143914
goto out;
39153915

3916+
amdgpu_fbdev_set_suspend(tmp_adev, 0);
3917+
39163918
/* must succeed. */
39173919
amdgpu_ras_resume(tmp_adev);
39183920

@@ -4086,6 +4088,8 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev,
40864088
*/
40874089
amdgpu_unregister_gpu_instance(tmp_adev);
40884090

4091+
amdgpu_fbdev_set_suspend(adev, 1);
4092+
40894093
/* disable ras on ALL IPs */
40904094
if (!(in_ras_intr && !use_baco) &&
40914095
amdgpu_device_ip_need_full_reset(tmp_adev))

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ static int jpeg_v2_0_set_clockgating_state(void *handle,
693693
bool enable = (state == AMD_CG_STATE_GATE);
694694

695695
if (enable) {
696-
if (jpeg_v2_0_is_idle(handle))
696+
if (!jpeg_v2_0_is_idle(handle))
697697
return -EBUSY;
698698
jpeg_v2_0_enable_clock_gating(adev);
699699
} else {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ static int jpeg_v2_5_set_clockgating_state(void *handle,
477477
continue;
478478

479479
if (enable) {
480-
if (jpeg_v2_5_is_idle(handle))
480+
if (!jpeg_v2_5_is_idle(handle))
481481
return -EBUSY;
482482
jpeg_v2_5_enable_clock_gating(adev, i);
483483
} else {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1352,7 +1352,7 @@ static int vcn_v1_0_set_clockgating_state(void *handle,
13521352

13531353
if (enable) {
13541354
/* wait for STATUS to clear */
1355-
if (vcn_v1_0_is_idle(handle))
1355+
if (!vcn_v1_0_is_idle(handle))
13561356
return -EBUSY;
13571357
vcn_v1_0_enable_clock_gating(adev);
13581358
} else {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1217,7 +1217,7 @@ static int vcn_v2_0_set_clockgating_state(void *handle,
12171217

12181218
if (enable) {
12191219
/* wait for STATUS to clear */
1220-
if (vcn_v2_0_is_idle(handle))
1220+
if (!vcn_v2_0_is_idle(handle))
12211221
return -EBUSY;
12221222
vcn_v2_0_enable_clock_gating(adev);
12231223
} else {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1672,7 +1672,7 @@ static int vcn_v2_5_set_clockgating_state(void *handle,
16721672
return 0;
16731673

16741674
if (enable) {
1675-
if (vcn_v2_5_is_idle(handle))
1675+
if (!vcn_v2_5_is_idle(handle))
16761676
return -EBUSY;
16771677
vcn_v2_5_enable_clock_gating(adev);
16781678
} else {

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -522,8 +522,9 @@ static void dm_dcn_crtc_high_irq(void *interrupt_params)
522522

523523
acrtc_state = to_dm_crtc_state(acrtc->base.state);
524524

525-
DRM_DEBUG_DRIVER("crtc:%d, vupdate-vrr:%d\n", acrtc->crtc_id,
526-
amdgpu_dm_vrr_active(acrtc_state));
525+
DRM_DEBUG_DRIVER("crtc:%d, vupdate-vrr:%d, planes:%d\n", acrtc->crtc_id,
526+
amdgpu_dm_vrr_active(acrtc_state),
527+
acrtc_state->active_planes);
527528

528529
amdgpu_dm_crtc_handle_crc_irq(&acrtc->base);
529530
drm_crtc_handle_vblank(&acrtc->base);
@@ -543,7 +544,18 @@ static void dm_dcn_crtc_high_irq(void *interrupt_params)
543544
&acrtc_state->vrr_params.adjust);
544545
}
545546

546-
if (acrtc->pflip_status == AMDGPU_FLIP_SUBMITTED) {
547+
/*
548+
* If there aren't any active_planes then DCH HUBP may be clock-gated.
549+
* In that case, pageflip completion interrupts won't fire and pageflip
550+
* completion events won't get delivered. Prevent this by sending
551+
* pending pageflip events from here if a flip is still pending.
552+
*
553+
* If any planes are enabled, use dm_pflip_high_irq() instead, to
554+
* avoid race conditions between flip programming and completion,
555+
* which could cause too early flip completion events.
556+
*/
557+
if (acrtc->pflip_status == AMDGPU_FLIP_SUBMITTED &&
558+
acrtc_state->active_planes == 0) {
547559
if (acrtc->event) {
548560
drm_crtc_send_vblank_event(&acrtc->base, acrtc->event);
549561
acrtc->event = NULL;

drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3401,6 +3401,17 @@ static bool retrieve_link_cap(struct dc_link *link)
34013401
sink_id.ieee_device_id,
34023402
sizeof(sink_id.ieee_device_id));
34033403

3404+
/* Quirk Apple MBP 2017 15" Retina panel: Wrong DP_MAX_LINK_RATE */
3405+
{
3406+
uint8_t str_mbp_2017[] = { 101, 68, 21, 101, 98, 97 };
3407+
3408+
if ((link->dpcd_caps.sink_dev_id == 0x0010fa) &&
3409+
!memcmp(link->dpcd_caps.sink_dev_id_str, str_mbp_2017,
3410+
sizeof(str_mbp_2017))) {
3411+
link->reported_link_cap.link_rate = 0x0c;
3412+
}
3413+
}
3414+
34043415
core_link_read_dpcd(
34053416
link,
34063417
DP_SINK_HW_REVISION_START,

drivers/gpu/drm/amd/display/dc/dcn20/dcn20_init.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ static const struct hwseq_private_funcs dcn20_private_funcs = {
108108
.enable_power_gating_plane = dcn20_enable_power_gating_plane,
109109
.dpp_pg_control = dcn20_dpp_pg_control,
110110
.hubp_pg_control = dcn20_hubp_pg_control,
111-
.dsc_pg_control = NULL,
112111
.update_odm = dcn20_update_odm,
113112
.dsc_pg_control = dcn20_dsc_pg_control,
114113
.get_surface_visual_confirm_color = dcn10_get_surface_visual_confirm_color,

drivers/gpu/drm/amd/display/dc/dcn21/dcn21_init.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ static const struct hwseq_private_funcs dcn21_private_funcs = {
116116
.enable_power_gating_plane = dcn20_enable_power_gating_plane,
117117
.dpp_pg_control = dcn20_dpp_pg_control,
118118
.hubp_pg_control = dcn20_hubp_pg_control,
119-
.dsc_pg_control = NULL,
120119
.update_odm = dcn20_update_odm,
121120
.dsc_pg_control = dcn20_dsc_pg_control,
122121
.get_surface_visual_confirm_color = dcn10_get_surface_visual_confirm_color,

0 commit comments

Comments
 (0)