keep restarting - virtual bool IOAccelLegacyDisplayMachine::display_mode_did_change(uint32_t)
view issue in gist -> https://gist.github.com/huahuayu/75e3b27e4a744de549e76377318c0478
## Issue
Macbook Pro keeps freezing (especially when sleep and reopen, the keyboard have light but the screen keep black) and after few seconds, restart automaticly.
## Environment
Macbook Pro
```text
Hardware Overview:
Model Name: MacBook Pro
Model Identifier: MacBookPro15,1
Processor Name: 6-Core Intel Core i7
Processor Speed: 2.6 GHz
Number of Processors: 1
Total Number of Cores: 6
L2 Cache (per Core): 256 KB
L3 Cache: 9 MB
Hyper-Threading Technology: Enabled
Memory: 16 GB
System Firmware Version: 1731.120.10.0.0 (iBridge: 19.16.15071.0.0,0)
OS Loader Version: 540.120.3~6
```
MacOS version: 12.4
Apple Diagnostic
```text
Power On Self-Test:
Last Run: 6/28/22, 10:40 PM
Result: Passed
```
## Error report
```text
panic(cpu 0 caller 0xffffff7fa25fee60): "virtual bool IOAccelLegacyDisplayMachine::display_mode_did_change(uint32_t): AMDRadeonAccelerator driver returns false" @IOAccelLegacyDisplayMachine.cpp:267
Panicked task 0xffffff952bf88030: 8 threads: pid 150: WindowServer
Backtrace (CPU 0), panicked thread: 0xffffff905f2e9000, Frame : Return Address
```
## Reproduce
I don't know what's the issue trigger, but from the error log, it seem GPU problem, may be a hardware problem.
Most of the time it happend when wake from sleep. But it will also happen when I am using it.
## Other info
This is a same issue, Help please! Frequent "panic" reports aft… - Apple Community and it is suggested that use https://codyschrank.github.io/gSwitch to use integrated gpu only, I am trying it.
MacBook Pro 15″, macOS 12.4
