ati: Correct VBL status and interrupt handling - #208
Merged
Conversation
insert_bits expects its final argument to be the field width, but both ATI VBL callbacks passed the current VBL state. When VBL ended, that meant using zero as the width, so the update was a no-op. After the first vertical blank began, the ATI_CRTC_VBLANK status bit was never cleared, confusing guest code that polls the live VBL state.
More accurately model the VBL interrupt behavior of ATI chips. When VBL begins, set the interrupt-pending bits and derive the PCI IRQ from each pending bit and its matching enable bit. Keep the pending state and PCI IRQ asserted until the guest driver acknowledges the event, even if VBL has already ended. The interrupt may therefore be asserted for less or more time than the physical VBL interval, depending on when the guest acknowledges it. This allows the driver to acknowledge the interrupt and resume other work while VBL may still be active. Previously the PCI IRQ followed the entire VBL interval, so it could remain asserted after the pending event had been acknowledged. Track the PCI IRQ output level and notify the interrupt controller only when that level changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Correct two issues with ATI vertical blank handling:
This improves Mac OS X 10.4 Tiger booting on the iMac G3. The ATI driver can complete more of its display initialization, allowing the guest to progress past the apparent "Waiting for IFC" hang and into WindowServer startup.
A separate CPU timing fix is still needed for
loginwindowto connect before WindowServer's timeout.See commit messages for details.