Alex Hung
3ce62c1896
drm/amd/display: Check NULL before accessing
[WHAT]
IGT kms_cursor_legacy's long-nonblocking-modeset-vs-cursor-atomic
fails with NULL pointer dereference. This can be reproduced with
both an eDP panel and a DP monitors connected.
BUG: kernel NULL pointer dereference, address: 0000000000000000
#PF: supervisor read access in kernel mode
#PF: error_code(0x0000) - not-present page
PGD 0 P4D 0
Oops: Oops: 0000 [#1] SMP NOPTI
CPU: 13 UID: 0 PID: 2960 Comm: kms_cursor_lega Not tainted
6.16.0-99-custom #8 PREEMPT(voluntary)
Hardware name: AMD ........
RIP: 0010:dc_stream_get_scanoutpos+0x34/0x130 [amdgpu]
Code: 57 4d 89 c7 41 56 49 89 ce 41 55 49 89 d5 41 54 49
89 fc 53 48 83 ec 18 48 8b 87 a0 64 00 00 48 89 75 d0 48 c7 c6 e0 41 30
c2 <48> 8b 38 48 8b 9f 68 06 00 00 e8 8d d7 fd ff 31 c0 48 81 c3 e0 02
RSP: 0018:ffffd0f3c2bd7608 EFLAGS: 00010292
RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffd0f3c2bd7668
RDX: ffffd0f3c2bd7664 RSI: ffffffffc23041e0 RDI: ffff8b32494b8000
RBP: ffffd0f3c2bd7648 R08: ffffd0f3c2bd766c R09: ffffd0f3c2bd7760
R10: ffffd0f3c2bd7820 R11: 0000000000000000 R12: ffff8b32494b8000
R13: ffffd0f3c2bd7664 R14: ffffd0f3c2bd7668 R15: ffffd0f3c2bd766c
FS: 000071f631b68700(0000) GS:ffff8b399f114000(0000)
knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 00000001b8105000 CR4: 0000000000f50ef0
PKRU: 55555554
Call Trace:
<TASK>
dm_crtc_get_scanoutpos+0xd7/0x180 [amdgpu]
amdgpu_display_get_crtc_scanoutpos+0x86/0x1c0 [amdgpu]
? __pfx_amdgpu_crtc_get_scanout_position+0x10/0x10[amdgpu]
amdgpu_crtc_get_scanout_position+0x27/0x50 [amdgpu]
drm_crtc_vblank_helper_get_vblank_timestamp_internal+0xf7/0x400
drm_crtc_vblank_helper_get_vblank_timestamp+0x1c/0x30
drm_crtc_get_last_vbltimestamp+0x55/0x90
drm_crtc_next_vblank_start+0x45/0xa0
drm_atomic_helper_wait_for_fences+0x81/0x1f0
...
Cc: Mario Limonciello <mario.limonciello@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 621e55f191)
Cc: stable@vger.kernel.org
2025-11-26 12:17:38 -05:00
..
2025-10-14 08:56:31 -06:00
2025-11-19 13:36:29 +01:00
2025-10-22 08:04:15 +02:00
2025-11-20 13:37:18 +01:00
2025-11-18 15:47:55 +01:00
2025-10-20 13:54:15 +02:00
2025-10-31 12:57:19 -07:00
2025-11-11 09:06:57 -05:00
2025-10-04 16:26:32 -07:00
2025-09-11 19:13:21 +01:00
2025-10-04 16:26:32 -07:00
2025-10-18 14:33:22 +03:00
2025-10-23 02:06:47 +08:00
2025-10-07 08:40:15 -07:00
2025-10-22 08:03:52 +02:00
2025-11-12 17:59:37 +01:00
2025-11-06 15:44:18 -08:00
2025-11-06 14:29:49 +08:00
2025-11-07 09:22:10 -07:00
2025-09-15 16:09:42 +02:00
2025-10-15 10:39:54 -04:00
2025-09-26 15:10:59 -07:00
2025-10-06 10:37:06 -07:00
2025-10-24 16:56:37 +01:00
2025-10-28 18:54:48 -07:00
2025-11-11 14:59:04 +01:00
2025-11-16 21:30:26 +09:00
2025-10-23 22:30:01 +02:00
2025-09-22 10:33:10 -03:00
2025-11-19 12:00:28 +01:00
2025-11-26 12:17:38 -05:00
2025-11-22 09:58:41 -08:00
2025-10-01 00:00:45 +00:00
2025-11-12 11:54:37 -08:00
2025-10-04 16:26:32 -07:00
2025-11-03 18:04:15 +01:00
2025-09-29 00:17:22 +02:00
2025-09-23 14:15:25 +02:00
2025-11-11 15:12:18 +01:00
2025-11-17 23:16:55 -08:00
2025-09-12 13:54:17 +03:00
2025-11-05 15:11:26 -04:00
2025-11-14 16:52:34 +01:00
2025-10-31 17:39:14 -07:00
2025-09-16 16:49:28 +01:00
2025-10-08 11:44:21 -07:00
2025-10-03 18:48:02 -07:00
2025-10-24 11:16:26 +02:00
2025-10-23 15:32:21 +02:00
2025-10-02 18:18:33 -07:00
2025-10-03 10:38:23 -05:00
2025-10-26 10:33:46 -07:00
2025-11-11 17:47:47 +01:00
2025-10-22 08:04:43 +02:00
2025-11-03 11:37:57 +01:00
2025-11-20 07:39:54 -08:00
2025-09-22 09:35:21 -04:00
2025-10-06 11:17:18 -07:00
2025-11-17 09:00:42 -08:00
2025-10-22 08:02:38 +02:00
2025-10-24 07:44:09 -05:00
2025-11-14 15:45:31 -08:00
2025-11-16 10:37:38 -07:00
2025-10-06 10:34:22 -07:00
2025-11-18 23:56:11 +01:00
2025-11-20 09:39:34 -08:00
2025-11-04 17:29:00 +01:00
2025-10-01 13:02:59 -07:00
2025-10-31 16:27:40 -07:00
2025-11-14 11:55:56 +01:00
2025-09-15 16:20:29 +02:00
2025-11-05 11:56:16 +00:00
2025-10-04 15:45:17 -07:00
2025-11-05 16:12:28 +01:00
2025-09-20 21:29:48 -05:00
2025-11-08 20:56:12 +01:00
2025-11-17 16:58:25 -08:00
2025-11-19 22:46:36 -05:00
2025-09-12 15:47:38 +02:00
2025-11-04 19:15:36 -08:00
2025-10-06 10:32:22 -07:00
2025-11-10 14:03:53 +00:00
2025-10-13 10:55:03 +02:00
2025-11-08 12:30:02 -05:00
2025-10-17 15:26:52 +02:00
2025-10-02 10:41:58 +02:00
2025-09-23 17:16:38 +02:00
2025-10-22 12:13:54 +02:00
2025-10-29 23:20:19 -04:00
2025-10-07 08:40:15 -07:00
2025-10-24 13:52:58 +02:00
2025-11-11 15:12:18 +01:00
2025-10-28 15:54:41 -06:00
2025-10-01 07:24:43 -04:00
2025-10-28 22:59:19 +01:00
2025-09-29 18:48:39 -07:00
2025-10-04 08:48:16 -07:00
2025-10-06 11:00:30 -07:00
2025-10-03 17:41:12 -07:00
2025-09-15 14:30:17 +02:00
2025-10-07 08:40:15 -07:00