Re: [PATCH v5 0/7] drm/mgag200: Implement VBLANK support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

Am 11.10.24 um 18:44 schrieb Luck, Tony:
Posted too soon. Some time (kernel timestamps say a few minutes) after the
successful boot the console spewed another stack dump and the machine hung.

This warning is OK for the quick workaround.

Attached is a full revert of the vblank support for you to test. If that undoes the bug, I'll post it for review to the list.

Best regards
Thomas



-Tony


brk-bdx-01 login: [  364.922549] ------------[ cut here ]------------
[  364.927987] mgag200 0000:08:00.0: [drm] drm_WARN_ON(pipe >= dev->num_crtcs)
[  364.928157] WARNING: CPU: 46 PID: 3556 at drivers/gpu/drm/drm_vblank.c:1347 drm_crtc_vblank_off+0x250/0x270 [drm]
[  364.947651] Modules linked in: snd_seq_dummy snd_hrtimer snd_seq snd_seq_device snd_timer snd soundcore xt_CHECKSUM xt_MASQUERADE xt_conntrack ipt_REJECT nf_nat_tftp nf_conntrack_tftp bridge stp llc nf_conntrack_netbios_ns nf_conntrack_broadcast nft_fib_inet nft_fib_ipv4 nft_fib_ipv6 nft_fib nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject nft_ct nft_chain_nat ip6table_nat ip6table_mangle ip6table_raw ip6table_security iptable_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 iptable_mangle iptable_raw iptable_security ip_set rfkill nf_tables nfnetlink ip6table_filter ip6_tables iptable_filter sunrpc vfat fat intel_rapl_msr intel_rapl_common intel_uncore_frequency intel_uncore_frequency_common sb_edac x86_pkg_temp_thermal intel_powerclamp coretemp iTCO_wdt intel_pmc_bxt iTCO_vendor_support rapl ipmi_ssif intel_cstate intel_uncore acpi_ipmi joydev pcspkr ipmi_si i2c_i801 mei_me ipmi_devintf i2c_smbus lpc_ich mei ioatdma wmi ipmi_msghandler acpi_pad zram ip_tables crct10dif_pclmul crc32_pclmul mgag200
[  364.948006]  crc32c_intel i2c_algo_bit ghash_clmulni_intel drm_shmem_helper sha512_ssse3 drm_kms_helper sha256_ssse3 sha1_ssse3 mpt3sas ixgbe raid_class mdio drm scsi_transport_sas dca fuse
[  365.066964] CPU: 46 UID: 42 PID: 3556 Comm: gnome-shell Tainted: G        W          6.12.0-rc2+ #171
[  365.077283] Tainted: [W]=WARN
[  365.080617] Hardware name: Intel Corporation BRICKLAND/BRICKLAND, BIOS BRBDXSD1.86B.0338.V01.1603162127 03/16/2016
[  365.092189] RIP: 0010:drm_crtc_vblank_off+0x250/0x270 [drm]
[  365.098473] Code: 4c 8b 67 50 4d 85 e4 75 03 4c 8b 27 e8 e9 be 01 d6 48 c7 c1 78 9b b1 c0 4c 89 e2 48 c7 c7 1e d6 b1 c0 48 89 c6 e8 f0 8f 60 d5 <0f> 0b 48 83 c4 20 5b 5d 41 5c 41 5d 41 5e 41 5f c3 cc cc cc cc 66
[  365.119464] RSP: 0018:ffffbd1ca3d87b20 EFLAGS: 00010282
[  365.125316] RAX: 000000000000003f RBX: ffff9ddf0a498000 RCX: 0000000000000000
[  365.133297] RDX: 0000000000000002 RSI: ffffffff97a00e78 RDI: 00000000ffffffff
[  365.141283] RBP: 0000000000000000 R08: 0000000000000000 R09: ffffbd1ca3d879e0
[  365.149274] R10: ffffbd1ca3d879d8 R11: ffff9e12011fffe8 R12: ffff9df257758df0
[  365.157266] R13: ffff9ddf0a4993f0 R14: ffff9ddf05087a00 R15: ffffffffc0b726c0
[  365.165244] FS:  00007f2ae47fad80(0000) GS:ffff9deb61d00000(0000) knlGS:0000000000000000
[  365.174299] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  365.180736] CR2: 00000be199403000 CR3: 00000000127a8001 CR4: 00000000003706f0
[  365.188726] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[  365.196718] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[  365.204709] Call Trace:
[  365.207462]  <TASK>
[  365.209829]  ? __warn+0x90/0x1a0
[  365.213469]  ? drm_crtc_vblank_off+0x250/0x270 [drm]
[  365.219104]  ? report_bug+0x1c3/0x1d0
[  365.223226]  ? handle_bug+0x5b/0xa0
[  365.227150]  ? exc_invalid_op+0x14/0x70
[  365.231455]  ? asm_exc_invalid_op+0x16/0x20
[  365.236159]  ? drm_crtc_vblank_off+0x250/0x270 [drm]
[  365.241762]  ? _raw_spin_unlock_irq+0x24/0x50
[  365.246653]  ? lockdep_hardirqs_on+0x7b/0x100
[  365.251549]  mgag200_crtc_helper_atomic_disable+0xf/0x160 [mgag200]
[  365.258576]  disable_outputs+0x246/0x360 [drm_kms_helper]
[  365.264671]  drm_atomic_helper_commit_tail+0x1a/0x80 [drm_kms_helper]
[  365.271896]  mgag200_mode_config_helper_atomic_commit_tail+0x28/0x40 [mgag200]
[  365.279998]  commit_tail+0x94/0x130 [drm_kms_helper]
[  365.285578]  drm_atomic_helper_commit+0x13e/0x170 [drm_kms_helper]
[  365.292513]  drm_atomic_commit+0x97/0xb0 [drm]
[  365.297533]  ? __pfx___drm_printfn_info+0x10/0x10 [drm]
[  365.303439]  drm_mode_atomic_ioctl+0x995/0xb80 [drm]
[  365.309061]  ? __pfx_drm_mode_atomic_ioctl+0x10/0x10 [drm]
[  365.315245]  drm_ioctl_kernel+0x85/0xf0 [drm]
[  365.320183]  drm_ioctl+0x23a/0x450 [drm]
[  365.324640]  ? __pfx_drm_mode_atomic_ioctl+0x10/0x10 [drm]
[  365.330825]  ? __pfx___fget_files+0xb/0x10
[  365.335438]  __x64_sys_ioctl+0x8a/0xc0
[  365.339656]  do_syscall_64+0x73/0x190
[  365.343780]  entry_SYSCALL_64_after_hwframe+0x76/0x7e
[  365.349445] RIP: 0033:0x7f2ae87280ab
[  365.353462] Code: ff ff ff 85 c0 79 9b 49 c7 c4 ff ff ff ff 5b 5d 4c 89 e0 41 5c c3 66 0f 1f 84 00 00 00 00 00 f3 0f 1e fa b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 9d bd 0c 00 f7 d8 64 89 01 48
[  365.374448] RSP: 002b:00007ffc89bc33c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
[  365.382925] RAX: ffffffffffffffda RBX: 00007ffc89bc3410 RCX: 00007f2ae87280ab
[  365.390908] RDX: 00007ffc89bc3410 RSI: 00000000c03864bc RDI: 000000000000000b
[  365.398904] RBP: 00000000c03864bc R08: 0000000000000002 R09: 0000000000000002
[  365.406901] R10: 00007f2ae87f4a00 R11: 0000000000000246 R12: 0000564bfe3dcc80
[  365.414889] R13: 000000000000000b R14: 0000564bfdead540 R15: 0000564bfdb6b5d0
[  365.422914]  </TASK>
[  365.425379] irq event stamp: 1043639
[  365.429393] hardirqs last  enabled at (1043651): [<ffffffff96183fae>] __up_console_sem+0x5e/0x70
[  365.439231] hardirqs last disabled at (1043662): [<ffffffff96183f93>] __up_console_sem+0x43/0x70
[  365.449074] softirqs last  enabled at (1043676): [<ffffffff960dac91>] __irq_exit_rcu+0xa1/0x110
[  365.458818] softirqs last disabled at (1043671): [<ffffffff960dac91>] __irq_exit_rcu+0xa1/0x110
[  365.468548] ---[ end trace 0000000000000000 ]---


-----Original Message-----
From: Luck, Tony
Sent: Friday, October 11, 2024 9:37 AM
To: Thomas Zimmermann <tzimmermann@xxxxxxx>
Cc: jfalempe@xxxxxxxxxx; airlied@xxxxxxxxxx; sam@xxxxxxxxxxxx; emil.l.velikov@xxxxxxxxx; maarten.lankhorst@xxxxxxxxxxxxxxx; mripard@xxxxxxxxxx; airlied@xxxxxxxxx; daniel@xxxxxxxx; dri-devel@xxxxxxxxxxxxxxxxxxxxx
Subject: RE: [PATCH v5 0/7] drm/mgag200: Implement VBLANK support

Progress! My system now boots. But there's one WARN_ON dump along the way to the "login:" prompt.

Thanks

-Tony

---

[   33.111505] Console: switching to colour dummy device 80x25
[   33.119581] mgag200 0000:08:00.0: vgaarb: deactivate vga console
[   33.139574] [drm] Initialized mgag200 1.0.0 for 0000:08:00.0 on minor 0
[   33.157665] fbcon: mgag200drmfb (fb0) is primary device
[   33.196490] ixgbe 0000:03:00.1: Multiqueue Enabled: Rx Queue count = 63, Tx Queue count = 63 XDP Queue count = 0
[   33.281367] ixgbe 0000:03:00.1: 16.000 Gb/s available PCIe bandwidth, limited by 5.0 GT/s PCIe x4 link at 0000:00:03.2 (capable of 32.000 Gb/s with 5.0 GT/s PCIe x8 link)
[   33.282519] ------------[ cut here ]------------
[   33.282550] mgag200 0000:08:00.0: [drm] drm_WARN_ON(pipe >= dev->num_crtcs)
[   33.282610] WARNING: CPU: 123 PID: 1774 at drivers/gpu/drm/drm_vblank.c:1488 drm_crtc_vblank_on_config+0x1b5/0x210 [drm]
[   33.282687] Modules linked in: crct10dif_pclmul crc32_pclmul mgag200(+) crc32c_intel i2c_algo_bit ghash_clmulni_intel drm_shmem_helper sha512_ssse3 drm_kms_helper sha256_ssse3 sha1_ssse3 mpt3sas ixgbe(+) raid_class mdio drm scsi_transport_sas dca fuse
[   33.282712] CPU: 123 UID: 0 PID: 1774 Comm: systemd-udevd Not tainted 6.12.0-rc2+ #171
[   33.282716] Hardware name: Intel Corporation BRICKLAND/BRICKLAND, BIOS BRBDXSD1.86B.0338.V01.1603162127 03/16/2016
[   33.282718] RIP: 0010:drm_crtc_vblank_on_config+0x1b5/0x210 [drm]
[   33.282743] Code: 4c 8b 67 50 4d 85 e4 75 03 4c 8b 27 e8 34 ce 01 d6 48 c7 c1 78 9b b1 c0 4c 89 e2 48 c7 c7 1e d6 b1 c0 48 89 c6 e8 3b 9f 60 d5 <0f> 0b 48 83 c4 18 5b 5d 41 5c 41 5d 41 5e 41 5f c3 cc cc cc cc 48
[   33.282745] RSP: 0018:ffffbd1ca3f8f660 EFLAGS: 00010282
[   33.282749] RAX: 000000000000003f RBX: ffff9ddf0a498000 RCX: 0000000000000000
[   33.282751] RDX: 0000000000000002 RSI: ffffffff97a00e78 RDI: 00000000ffffffff
[   33.282753] RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000000
[   33.282755] R10: 0000000000000001 R11: 0000000000000001 R12: ffff9df257758df0
[   33.282757] R13: ffff9ddf0a4993f0 R14: ffffffffc0b726c0 R15: ffff9ddf05d33450
[   33.282758] FS:  00007f66ab8e2b40(0000) GS:ffff9deb61f80000(0000) knlGS:0000000000000000
[   33.282761] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   33.282763] CR2: 00007f66ab8c7c4b CR3: 000000000bc04003 CR4: 00000000003706f0
[   33.282765] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[   33.282766] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[   33.282768] Call Trace:
[   33.282771]  <TASK>
[   33.282773]  ? __warn+0x90/0x1a0
[   33.282785]  ? drm_crtc_vblank_on_config+0x1b5/0x210 [drm]
[   33.282808]  ? report_bug+0x1c3/0x1d0
[   33.282819]  ? handle_bug+0x5b/0xa0
[   33.282824]  ? exc_invalid_op+0x14/0x70
[   33.282827]  ? asm_exc_invalid_op+0x16/0x20
[   33.282839]  ? drm_crtc_vblank_on_config+0x1b5/0x210 [drm]
[   33.282862]  ? mgag200_crtc_set_gamma_linear+0x17a/0x190 [mgag200]
[   33.282868]  ? mgag200_enable_display+0x13b/0x160 [mgag200]
[   33.282876]  drm_crtc_vblank_on+0x28/0x40 [drm]
[   33.282898]  drm_atomic_helper_commit_modeset_enables+0xa6/0x240 [drm_kms_helper]
[   33.282920]  drm_atomic_helper_commit_tail+0x50/0x80 [drm_kms_helper]
[   33.282931]  mgag200_mode_config_helper_atomic_commit_tail+0x28/0x40 [mgag200]
[   33.282951]  commit_tail+0x94/0x130 [drm_kms_helper]
[   33.282963]  drm_atomic_helper_commit+0x13e/0x170 [drm_kms_helper]
[   33.282975]  drm_atomic_commit+0x97/0xb0 [drm]
[   33.282996]  ? __pfx___drm_printfn_info+0x10/0x10 [drm]
[   33.283027]  drm_client_modeset_commit_atomic+0x207/0x250 [drm]
[   33.283060]  drm_client_modeset_commit_locked+0x5b/0x190 [drm]
[   33.283086]  drm_client_modeset_commit+0x24/0x50 [drm]
[   33.283109]  __drm_fb_helper_restore_fbdev_mode_unlocked+0x95/0xd0 [drm_kms_helper]
[   33.283122]  drm_fb_helper_set_par+0x2e/0x40 [drm_kms_helper]
[   33.283132]  fbcon_init+0x2a8/0x560
[   33.283143]  visual_init+0xc4/0x120
[   33.283150]  do_bind_con_driver.isra.0+0x1a1/0x3d0
[   33.283158]  do_take_over_console+0x10b/0x1a0
[   33.283164]  do_fbcon_takeover+0x5c/0xc0
[   33.283167]  fbcon_fb_registered+0x49/0x70
[   33.283170]  do_register_framebuffer+0x184/0x230
[   33.283179]  register_framebuffer+0x20/0x40
[   33.283182]  __drm_fb_helper_initial_config_and_unlock+0x33e/0x590 [drm_kms_helper]
[   33.283193]  ? drm_client_register+0x33/0xc0 [drm]
[   33.283222]  drm_fbdev_shmem_client_hotplug+0x6c/0xc0 [drm_shmem_helper]
[   33.283228]  drm_client_register+0x7b/0xc0 [drm]
[   33.283254]  mgag200_pci_probe+0x90/0x180 [mgag200]
[   33.283262]  local_pci_probe+0x46/0xa0
[   33.283269]  pci_device_probe+0xb5/0x220
[   33.283277]  really_probe+0xd9/0x380
[   33.283288]  __driver_probe_device+0x78/0x150
[   33.283293]  driver_probe_device+0x1e/0x90
[   33.283297]  __driver_attach+0xd6/0x1d0
[   33.283301]  ? __pfx___driver_attach+0x10/0x10
[   33.283305]  bus_for_each_dev+0x66/0xa0
[   33.283311]  bus_add_driver+0x111/0x240
[   33.283317]  driver_register+0x5c/0x120
[   33.283320]  ? __pfx_mgag200_pci_driver_init+0x10/0x10 [mgag200]
[   33.283326]  do_one_initcall+0x62/0x3a0
[   33.283333]  ? __kmalloc_cache_noprof+0x240/0x300
[   33.283343]  do_init_module+0x64/0x240
[   33.283354]  init_module_from_file+0x7a/0xa0
[   33.283366]  idempotent_init_module+0x15f/0x260
[   33.283378]  __x64_sys_finit_module+0x5a/0xb0
[   33.283383]  do_syscall_64+0x73/0x190
[   33.283396]  entry_SYSCALL_64_after_hwframe+0x76/0x7e
[   33.283399] RIP: 0033:0x7f66ac527e0d
[   33.283403] Code: c8 0c 00 0f 05 eb a9 66 0f 1f 44 00 00 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 3b 80 0c 00 f7 d8 64 89 01 48
[   33.283406] RSP: 002b:00007ffff0c752b8 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
[   33.283410] RAX: ffffffffffffffda RBX: 0000557cd3b38d00 RCX: 00007f66ac527e0d
[   33.283412] RDX: 0000000000000000 RSI: 00007f66ac68132c RDI: 0000000000000010
[   33.283414] RBP: 0000000000020000 R08: 0000000000000000 R09: 0000000000000000
[   33.283416] R10: 0000000000000010 R11: 0000000000000246 R12: 00007f66ac68132c
[   33.283418] R13: 0000557cd3b18eb0 R14: 0000000000000007 R15: 0000557cd3b38f80
[   33.283429]  </TASK>
[   33.283431] irq event stamp: 45133
[   33.283433] hardirqs last  enabled at (45139): [<ffffffff96187784>] vprintk_emit+0x3d4/0x3e0
[   33.283444] hardirqs last disabled at (45144): [<ffffffff96187737>] vprintk_emit+0x387/0x3e0
[   33.283448] softirqs last  enabled at (44822): [<ffffffff960dac91>] __irq_exit_rcu+0xa1/0x110
[   33.283456] softirqs last disabled at (44817): [<ffffffff960dac91>] __irq_exit_rcu+0xa1/0x110
[   33.283459] ---[ end trace 0000000000000000 ]---
[   33.283494] Console: switching to colour frame buffer device 128x48
[   33.379557] ixgbe 0000:03:00.1: MAC: 3, PHY: 0, PBA No: G36748-005
[   33.399852] mgag200 0000:08:00.0: [drm] fb0: mgag200drmfb frame buffer device

--
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)

From 896aae63cd80fa7d5d19ae6965c512c1365ad778 Mon Sep 17 00:00:00 2001
From: Thomas Zimmermann <tzimmermann@xxxxxxx>
Date: Mon, 14 Oct 2024 14:16:01 +0200
Subject: [PATCH] Revert "drm/mgag200: Add vblank support"

This reverts commit 6c9e14ee9f519ee605a3694fbfa4711284781d22.
This reverts commit d5070c9b29440c270b534bbacd636b8fa558e82b.
This reverts commit 89c6ea2006e2d39b125848fb0195c08fa0b354be.
---
 drivers/gpu/drm/mgag200/mgag200_drv.c     | 38 -----------
 drivers/gpu/drm/mgag200/mgag200_drv.h     | 14 +----
 drivers/gpu/drm/mgag200/mgag200_g200.c    |  5 --
 drivers/gpu/drm/mgag200/mgag200_g200eh.c  |  5 --
 drivers/gpu/drm/mgag200/mgag200_g200eh3.c |  5 --
 drivers/gpu/drm/mgag200/mgag200_g200er.c  | 10 +--
 drivers/gpu/drm/mgag200/mgag200_g200ev.c  | 10 +--
 drivers/gpu/drm/mgag200/mgag200_g200ew3.c |  5 --
 drivers/gpu/drm/mgag200/mgag200_g200se.c  | 10 +--
 drivers/gpu/drm/mgag200/mgag200_g200wb.c  |  5 --
 drivers/gpu/drm/mgag200/mgag200_mode.c    | 77 +----------------------
 11 files changed, 6 insertions(+), 178 deletions(-)

diff --git a/drivers/gpu/drm/mgag200/mgag200_drv.c b/drivers/gpu/drm/mgag200/mgag200_drv.c
index 29087e2398df..8c5557ca3226 100644
--- a/drivers/gpu/drm/mgag200/mgag200_drv.c
+++ b/drivers/gpu/drm/mgag200/mgag200_drv.c
@@ -20,7 +20,6 @@
 #include <drm/drm_managed.h>
 #include <drm/drm_module.h>
 #include <drm/drm_pciids.h>
-#include <drm/drm_vblank.h>
 
 #include "mgag200_drv.h"
 
@@ -87,34 +86,6 @@ resource_size_t mgag200_probe_vram(void __iomem *mem, resource_size_t size)
 	return offset - 65536;
 }
 
-static irqreturn_t mgag200_irq_handler(int irq, void *arg)
-{
-	struct drm_device *dev = arg;
-	struct mga_device *mdev = to_mga_device(dev);
-	struct drm_crtc *crtc;
-	u32 status, ien;
-
-	status = RREG32(MGAREG_STATUS);
-
-	if (status & MGAREG_STATUS_VLINEPEN) {
-		ien = RREG32(MGAREG_IEN);
-		if (!(ien & MGAREG_IEN_VLINEIEN))
-			goto out;
-
-		crtc = drm_crtc_from_index(dev, 0);
-		if (WARN_ON_ONCE(!crtc))
-			goto out;
-		drm_crtc_handle_vblank(crtc);
-
-		WREG32(MGAREG_ICLEAR, MGAREG_ICLEAR_VLINEICLR);
-
-		return IRQ_HANDLED;
-	}
-
-out:
-	return IRQ_NONE;
-}
-
 /*
  * DRM driver
  */
@@ -199,7 +170,6 @@ int mgag200_device_init(struct mga_device *mdev,
 			const struct mgag200_device_funcs *funcs)
 {
 	struct drm_device *dev = &mdev->base;
-	struct pci_dev *pdev = to_pci_dev(dev->dev);
 	u8 crtcext3, misc;
 	int ret;
 
@@ -226,14 +196,6 @@ int mgag200_device_init(struct mga_device *mdev,
 	mutex_unlock(&mdev->rmmio_lock);
 
 	WREG32(MGAREG_IEN, 0);
-	WREG32(MGAREG_ICLEAR, MGAREG_ICLEAR_VLINEICLR);
-
-	ret = devm_request_irq(&pdev->dev, pdev->irq, mgag200_irq_handler, IRQF_SHARED,
-			       dev->driver->name, dev);
-	if (ret) {
-		drm_err(dev, "Failed to acquire interrupt, error %d\n", ret);
-		return ret;
-	}
 
 	return 0;
 }
diff --git a/drivers/gpu/drm/mgag200/mgag200_drv.h b/drivers/gpu/drm/mgag200/mgag200_drv.h
index 4760ba92871b..988967eafbf2 100644
--- a/drivers/gpu/drm/mgag200/mgag200_drv.h
+++ b/drivers/gpu/drm/mgag200/mgag200_drv.h
@@ -391,24 +391,17 @@ int mgag200_crtc_helper_atomic_check(struct drm_crtc *crtc, struct drm_atomic_st
 void mgag200_crtc_helper_atomic_flush(struct drm_crtc *crtc, struct drm_atomic_state *old_state);
 void mgag200_crtc_helper_atomic_enable(struct drm_crtc *crtc, struct drm_atomic_state *old_state);
 void mgag200_crtc_helper_atomic_disable(struct drm_crtc *crtc, struct drm_atomic_state *old_state);
-bool mgag200_crtc_helper_get_scanout_position(struct drm_crtc *crtc, bool in_vblank_irq,
-					      int *vpos, int *hpos,
-					      ktime_t *stime, ktime_t *etime,
-					      const struct drm_display_mode *mode);
 
 #define MGAG200_CRTC_HELPER_FUNCS \
 	.mode_valid = mgag200_crtc_helper_mode_valid, \
 	.atomic_check = mgag200_crtc_helper_atomic_check, \
 	.atomic_flush = mgag200_crtc_helper_atomic_flush, \
 	.atomic_enable = mgag200_crtc_helper_atomic_enable, \
-	.atomic_disable = mgag200_crtc_helper_atomic_disable, \
-	.get_scanout_position = mgag200_crtc_helper_get_scanout_position
+	.atomic_disable = mgag200_crtc_helper_atomic_disable
 
 void mgag200_crtc_reset(struct drm_crtc *crtc);
 struct drm_crtc_state *mgag200_crtc_atomic_duplicate_state(struct drm_crtc *crtc);
 void mgag200_crtc_atomic_destroy_state(struct drm_crtc *crtc, struct drm_crtc_state *crtc_state);
-int mgag200_crtc_enable_vblank(struct drm_crtc *crtc);
-void mgag200_crtc_disable_vblank(struct drm_crtc *crtc);
 
 #define MGAG200_CRTC_FUNCS \
 	.reset = mgag200_crtc_reset, \
@@ -416,10 +409,7 @@ void mgag200_crtc_disable_vblank(struct drm_crtc *crtc);
 	.set_config = drm_atomic_helper_set_config, \
 	.page_flip = drm_atomic_helper_page_flip, \
 	.atomic_duplicate_state = mgag200_crtc_atomic_duplicate_state, \
-	.atomic_destroy_state = mgag200_crtc_atomic_destroy_state, \
-	.enable_vblank = mgag200_crtc_enable_vblank, \
-	.disable_vblank = mgag200_crtc_disable_vblank, \
-	.get_vblank_timestamp = drm_crtc_vblank_helper_get_vblank_timestamp
+	.atomic_destroy_state = mgag200_crtc_atomic_destroy_state
 
 void mgag200_set_mode_regs(struct mga_device *mdev, const struct drm_display_mode *mode,
 			   bool set_vidrst);
diff --git a/drivers/gpu/drm/mgag200/mgag200_g200.c b/drivers/gpu/drm/mgag200/mgag200_g200.c
index 77ce8d36cef0..f874e2949840 100644
--- a/drivers/gpu/drm/mgag200/mgag200_g200.c
+++ b/drivers/gpu/drm/mgag200/mgag200_g200.c
@@ -8,7 +8,6 @@
 #include <drm/drm_drv.h>
 #include <drm/drm_gem_atomic_helper.h>
 #include <drm/drm_probe_helper.h>
-#include <drm/drm_vblank.h>
 
 #include "mgag200_drv.h"
 
@@ -404,9 +403,5 @@ struct mga_device *mgag200_g200_device_create(struct pci_dev *pdev, const struct
 	drm_mode_config_reset(dev);
 	drm_kms_helper_poll_init(dev);
 
-	ret = drm_vblank_init(dev, 1);
-	if (ret)
-		return ERR_PTR(ret);
-
 	return mdev;
 }
diff --git a/drivers/gpu/drm/mgag200/mgag200_g200eh.c b/drivers/gpu/drm/mgag200/mgag200_g200eh.c
index 09ced65c1d2f..e2305f8e00f8 100644
--- a/drivers/gpu/drm/mgag200/mgag200_g200eh.c
+++ b/drivers/gpu/drm/mgag200/mgag200_g200eh.c
@@ -8,7 +8,6 @@
 #include <drm/drm_drv.h>
 #include <drm/drm_gem_atomic_helper.h>
 #include <drm/drm_probe_helper.h>
-#include <drm/drm_vblank.h>
 
 #include "mgag200_drv.h"
 
@@ -276,9 +275,5 @@ struct mga_device *mgag200_g200eh_device_create(struct pci_dev *pdev, const stru
 	drm_mode_config_reset(dev);
 	drm_kms_helper_poll_init(dev);
 
-	ret = drm_vblank_init(dev, 1);
-	if (ret)
-		return ERR_PTR(ret);
-
 	return mdev;
 }
diff --git a/drivers/gpu/drm/mgag200/mgag200_g200eh3.c b/drivers/gpu/drm/mgag200/mgag200_g200eh3.c
index 5daa469137bd..11ae76eb081d 100644
--- a/drivers/gpu/drm/mgag200/mgag200_g200eh3.c
+++ b/drivers/gpu/drm/mgag200/mgag200_g200eh3.c
@@ -7,7 +7,6 @@
 #include <drm/drm_drv.h>
 #include <drm/drm_gem_atomic_helper.h>
 #include <drm/drm_probe_helper.h>
-#include <drm/drm_vblank.h>
 
 #include "mgag200_drv.h"
 
@@ -181,9 +180,5 @@ struct mga_device *mgag200_g200eh3_device_create(struct pci_dev *pdev,
 	drm_mode_config_reset(dev);
 	drm_kms_helper_poll_init(dev);
 
-	ret = drm_vblank_init(dev, 1);
-	if (ret)
-		return ERR_PTR(ret);
-
 	return mdev;
 }
diff --git a/drivers/gpu/drm/mgag200/mgag200_g200er.c b/drivers/gpu/drm/mgag200/mgag200_g200er.c
index 09cfffafe130..c20ed0ab50ec 100644
--- a/drivers/gpu/drm/mgag200/mgag200_g200er.c
+++ b/drivers/gpu/drm/mgag200/mgag200_g200er.c
@@ -8,7 +8,6 @@
 #include <drm/drm_drv.h>
 #include <drm/drm_gem_atomic_helper.h>
 #include <drm/drm_probe_helper.h>
-#include <drm/drm_vblank.h>
 
 #include "mgag200_drv.h"
 
@@ -206,8 +205,6 @@ static void mgag200_g200er_crtc_helper_atomic_enable(struct drm_crtc *crtc,
 		mgag200_crtc_set_gamma_linear(mdev, format);
 
 	mgag200_enable_display(mdev);
-
-	drm_crtc_vblank_on(crtc);
 }
 
 static const struct drm_crtc_helper_funcs mgag200_g200er_crtc_helper_funcs = {
@@ -215,8 +212,7 @@ static const struct drm_crtc_helper_funcs mgag200_g200er_crtc_helper_funcs = {
 	.atomic_check = mgag200_crtc_helper_atomic_check,
 	.atomic_flush = mgag200_crtc_helper_atomic_flush,
 	.atomic_enable = mgag200_g200er_crtc_helper_atomic_enable,
-	.atomic_disable = mgag200_crtc_helper_atomic_disable,
-	.get_scanout_position = mgag200_crtc_helper_get_scanout_position,
+	.atomic_disable = mgag200_crtc_helper_atomic_disable
 };
 
 static const struct drm_crtc_funcs mgag200_g200er_crtc_funcs = {
@@ -312,9 +308,5 @@ struct mga_device *mgag200_g200er_device_create(struct pci_dev *pdev, const stru
 	drm_mode_config_reset(dev);
 	drm_kms_helper_poll_init(dev);
 
-	ret = drm_vblank_init(dev, 1);
-	if (ret)
-		return ERR_PTR(ret);
-
 	return mdev;
 }
diff --git a/drivers/gpu/drm/mgag200/mgag200_g200ev.c b/drivers/gpu/drm/mgag200/mgag200_g200ev.c
index 3d48baa91d8b..78be964eb97c 100644
--- a/drivers/gpu/drm/mgag200/mgag200_g200ev.c
+++ b/drivers/gpu/drm/mgag200/mgag200_g200ev.c
@@ -8,7 +8,6 @@
 #include <drm/drm_drv.h>
 #include <drm/drm_gem_atomic_helper.h>
 #include <drm/drm_probe_helper.h>
-#include <drm/drm_vblank.h>
 
 #include "mgag200_drv.h"
 
@@ -207,8 +206,6 @@ static void mgag200_g200ev_crtc_helper_atomic_enable(struct drm_crtc *crtc,
 		mgag200_crtc_set_gamma_linear(mdev, format);
 
 	mgag200_enable_display(mdev);
-
-	drm_crtc_vblank_on(crtc);
 }
 
 static const struct drm_crtc_helper_funcs mgag200_g200ev_crtc_helper_funcs = {
@@ -216,8 +213,7 @@ static const struct drm_crtc_helper_funcs mgag200_g200ev_crtc_helper_funcs = {
 	.atomic_check = mgag200_crtc_helper_atomic_check,
 	.atomic_flush = mgag200_crtc_helper_atomic_flush,
 	.atomic_enable = mgag200_g200ev_crtc_helper_atomic_enable,
-	.atomic_disable = mgag200_crtc_helper_atomic_disable,
-	.get_scanout_position = mgag200_crtc_helper_get_scanout_position,
+	.atomic_disable = mgag200_crtc_helper_atomic_disable
 };
 
 static const struct drm_crtc_funcs mgag200_g200ev_crtc_funcs = {
@@ -317,9 +313,5 @@ struct mga_device *mgag200_g200ev_device_create(struct pci_dev *pdev, const stru
 	drm_mode_config_reset(dev);
 	drm_kms_helper_poll_init(dev);
 
-	ret = drm_vblank_init(dev, 1);
-	if (ret)
-		return ERR_PTR(ret);
-
 	return mdev;
 }
diff --git a/drivers/gpu/drm/mgag200/mgag200_g200ew3.c b/drivers/gpu/drm/mgag200/mgag200_g200ew3.c
index dabc778e64e8..31624c9ab7b7 100644
--- a/drivers/gpu/drm/mgag200/mgag200_g200ew3.c
+++ b/drivers/gpu/drm/mgag200/mgag200_g200ew3.c
@@ -7,7 +7,6 @@
 #include <drm/drm_drv.h>
 #include <drm/drm_gem_atomic_helper.h>
 #include <drm/drm_probe_helper.h>
-#include <drm/drm_vblank.h>
 
 #include "mgag200_drv.h"
 
@@ -199,9 +198,5 @@ struct mga_device *mgag200_g200ew3_device_create(struct pci_dev *pdev,
 	drm_mode_config_reset(dev);
 	drm_kms_helper_poll_init(dev);
 
-	ret = drm_vblank_init(dev, 1);
-	if (ret)
-		return ERR_PTR(ret);
-
 	return mdev;
 }
diff --git a/drivers/gpu/drm/mgag200/mgag200_g200se.c b/drivers/gpu/drm/mgag200/mgag200_g200se.c
index 9dcbe8304271..7a32d3b1d226 100644
--- a/drivers/gpu/drm/mgag200/mgag200_g200se.c
+++ b/drivers/gpu/drm/mgag200/mgag200_g200se.c
@@ -8,7 +8,6 @@
 #include <drm/drm_drv.h>
 #include <drm/drm_gem_atomic_helper.h>
 #include <drm/drm_probe_helper.h>
-#include <drm/drm_vblank.h>
 
 #include "mgag200_drv.h"
 
@@ -338,8 +337,6 @@ static void mgag200_g200se_crtc_helper_atomic_enable(struct drm_crtc *crtc,
 		mgag200_crtc_set_gamma_linear(mdev, format);
 
 	mgag200_enable_display(mdev);
-
-	drm_crtc_vblank_on(crtc);
 }
 
 static const struct drm_crtc_helper_funcs mgag200_g200se_crtc_helper_funcs = {
@@ -347,8 +344,7 @@ static const struct drm_crtc_helper_funcs mgag200_g200se_crtc_helper_funcs = {
 	.atomic_check = mgag200_crtc_helper_atomic_check,
 	.atomic_flush = mgag200_crtc_helper_atomic_flush,
 	.atomic_enable = mgag200_g200se_crtc_helper_atomic_enable,
-	.atomic_disable = mgag200_crtc_helper_atomic_disable,
-	.get_scanout_position = mgag200_crtc_helper_get_scanout_position,
+	.atomic_disable = mgag200_crtc_helper_atomic_disable
 };
 
 static const struct drm_crtc_funcs mgag200_g200se_crtc_funcs = {
@@ -517,9 +513,5 @@ struct mga_device *mgag200_g200se_device_create(struct pci_dev *pdev, const stru
 	drm_mode_config_reset(dev);
 	drm_kms_helper_poll_init(dev);
 
-	ret = drm_vblank_init(dev, 1);
-	if (ret)
-		return ERR_PTR(ret);
-
 	return mdev;
 }
diff --git a/drivers/gpu/drm/mgag200/mgag200_g200wb.c b/drivers/gpu/drm/mgag200/mgag200_g200wb.c
index 83a24aedbf2f..a0e7b9ad46cd 100644
--- a/drivers/gpu/drm/mgag200/mgag200_g200wb.c
+++ b/drivers/gpu/drm/mgag200/mgag200_g200wb.c
@@ -8,7 +8,6 @@
 #include <drm/drm_drv.h>
 #include <drm/drm_gem_atomic_helper.h>
 #include <drm/drm_probe_helper.h>
-#include <drm/drm_vblank.h>
 
 #include "mgag200_drv.h"
 
@@ -323,9 +322,5 @@ struct mga_device *mgag200_g200wb_device_create(struct pci_dev *pdev, const stru
 	drm_mode_config_reset(dev);
 	drm_kms_helper_poll_init(dev);
 
-	ret = drm_vblank_init(dev, 1);
-	if (ret)
-		return ERR_PTR(ret);
-
 	return mdev;
 }
diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c
index 7159909aca1e..fb71658c3117 100644
--- a/drivers/gpu/drm/mgag200/mgag200_mode.c
+++ b/drivers/gpu/drm/mgag200/mgag200_mode.c
@@ -22,7 +22,6 @@
 #include <drm/drm_gem_framebuffer_helper.h>
 #include <drm/drm_panic.h>
 #include <drm/drm_print.h>
-#include <drm/drm_vblank.h>
 
 #include "mgag200_ddc.h"
 #include "mgag200_drv.h"
@@ -227,14 +226,7 @@ void mgag200_set_mode_regs(struct mga_device *mdev, const struct drm_display_mod
 	vblkstr = mode->crtc_vblank_start;
 	vblkend = vtotal + 1;
 
-	/*
-	 * There's no VBLANK interrupt on Matrox chipsets, so we use
-	 * the VLINE interrupt instead. It triggers when the current
-	 * <linecomp> has been reached. For VBLANK, this is the first
-	 * non-visible line at the bottom of the screen. Therefore,
-	 * keep <linecomp> in sync with <vblkstr>.
-	 */
-	linecomp = vblkstr;
+	linecomp = vdispend;
 
 	misc = RREG8(MGA_MISC_IN);
 
@@ -645,8 +637,6 @@ void mgag200_crtc_helper_atomic_flush(struct drm_crtc *crtc, struct drm_atomic_s
 	struct mgag200_crtc_state *mgag200_crtc_state = to_mgag200_crtc_state(crtc_state);
 	struct drm_device *dev = crtc->dev;
 	struct mga_device *mdev = to_mga_device(dev);
-	struct drm_pending_vblank_event *event;
-	unsigned long flags;
 
 	if (crtc_state->enable && crtc_state->color_mgmt_changed) {
 		const struct drm_format_info *format = mgag200_crtc_state->format;
@@ -656,18 +646,6 @@ void mgag200_crtc_helper_atomic_flush(struct drm_crtc *crtc, struct drm_atomic_s
 		else
 			mgag200_crtc_set_gamma_linear(mdev, format);
 	}
-
-	event = crtc->state->event;
-	if (event) {
-		crtc->state->event = NULL;
-
-		spin_lock_irqsave(&dev->event_lock, flags);
-		if (drm_crtc_vblank_get(crtc) != 0)
-			drm_crtc_send_vblank_event(crtc, event);
-		else
-			drm_crtc_arm_vblank_event(crtc, event);
-		spin_unlock_irqrestore(&dev->event_lock, flags);
-	}
 }
 
 void mgag200_crtc_helper_atomic_enable(struct drm_crtc *crtc, struct drm_atomic_state *old_state)
@@ -692,44 +670,15 @@ void mgag200_crtc_helper_atomic_enable(struct drm_crtc *crtc, struct drm_atomic_
 		mgag200_crtc_set_gamma_linear(mdev, format);
 
 	mgag200_enable_display(mdev);
-
-	drm_crtc_vblank_on(crtc);
 }
 
 void mgag200_crtc_helper_atomic_disable(struct drm_crtc *crtc, struct drm_atomic_state *old_state)
 {
 	struct mga_device *mdev = to_mga_device(crtc->dev);
 
-	drm_crtc_vblank_off(crtc);
-
 	mgag200_disable_display(mdev);
 }
 
-bool mgag200_crtc_helper_get_scanout_position(struct drm_crtc *crtc, bool in_vblank_irq,
-					      int *vpos, int *hpos,
-					      ktime_t *stime, ktime_t *etime,
-					      const struct drm_display_mode *mode)
-{
-	struct mga_device *mdev = to_mga_device(crtc->dev);
-	u32 vcount;
-
-	if (stime)
-		*stime = ktime_get();
-
-	if (vpos) {
-		vcount = RREG32(MGAREG_VCOUNT);
-		*vpos = vcount & GENMASK(11, 0);
-	}
-
-	if (hpos)
-		*hpos = mode->htotal >> 1; // near middle of scanline on average
-
-	if (etime)
-		*etime = ktime_get();
-
-	return true;
-}
-
 void mgag200_crtc_reset(struct drm_crtc *crtc)
 {
 	struct mgag200_crtc_state *mgag200_crtc_state;
@@ -774,30 +723,6 @@ void mgag200_crtc_atomic_destroy_state(struct drm_crtc *crtc, struct drm_crtc_st
 	kfree(mgag200_crtc_state);
 }
 
-int mgag200_crtc_enable_vblank(struct drm_crtc *crtc)
-{
-	struct mga_device *mdev = to_mga_device(crtc->dev);
-	u32 ien;
-
-	WREG32(MGAREG_ICLEAR, MGAREG_ICLEAR_VLINEICLR);
-
-	ien = RREG32(MGAREG_IEN);
-	ien |= MGAREG_IEN_VLINEIEN;
-	WREG32(MGAREG_IEN, ien);
-
-	return 0;
-}
-
-void mgag200_crtc_disable_vblank(struct drm_crtc *crtc)
-{
-	struct mga_device *mdev = to_mga_device(crtc->dev);
-	u32 ien;
-
-	ien = RREG32(MGAREG_IEN);
-	ien &= ~(MGAREG_IEN_VLINEIEN);
-	WREG32(MGAREG_IEN, ien);
-}
-
 /*
  * Mode config
  */
-- 
2.46.0


[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux