-
Notifications
You must be signed in to change notification settings - Fork 612
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IGFX: Convert existing patches to submodules #78
Merged
Merged
Conversation
This file contains 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
…o global framebuffer controllers or not.
…ss to MMIO registers.
… depend on this one.
Does not seem to have really obvious flaws and contains fairly important changes. Merging as is, let's get it tested for longer time before the release. Thank you. |
@0xFireWolf acidanthera/bugtracker#2241 On beta 13.3 recurs problem of backlighting |
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.
Abstract:
This PR converts more existing IGFX patches to submodules, revises the backlight fix to support ICL platforms, and introduces the concept of coordinated injections.
Coordinated Injections
Introduction:
The Coordinated Injections module allows multiple submodules to inject code into a shared function. We classify common patterns of code injection as three categories, prologue injection, replacer injection and epilogue injection. The prologue injector injects code before calling the original function, while the epilogue one injects code after calling the original function. The replacer injector overwrites the original implementation and thus does not call the original function. As such, the coordinator maintains three lists of injection descriptors.
An injection descriptor describes how to inject the code. It defines a trigger value that will be monitored by the coordinator, an injector function that will be called by the coordinator when the trigger value is observed, and a pointer to the next element in the linked list. Both trigger and injector function type are defined by a concrete submodule. Take the shared
ReadRegister32()
submodule as an example, we define the trigger as the register address, so if the graphics driver tries to read a value from that register, the coordinator would invoke the injector function. As a result, we can separate a giant wrapper function into multiple tiny ones where each of them deals with a specific register.Implementation:
Submodules inherited from the
InjectionCoordinator
class get support of coordinated injections automatically, and patch developers do not need write any additional code. Currently, bothReadRegister32()
andWriteRegister32()
implement this feature and expose convenient helper functions to access the original implementation. Submodules that require access to these two functions must set theirrequiresMMIORegistersReadAccess
andrequiresMMIORegistersWriteAccess
properties totrue
respectively.Related Changes:
requiresGlobalFramebufferControllersAccess
totrue
. As a result, all TODO items proposed in the pull request Enhanced maximum link rate fix, Fixed the page fault in the LSPCON driver, Submodules refactoring. #72 (comment) are now completed.Future Changes:
We will probably need to separate AUX registers-related functions into separate shared submodules as well. The maximum link rate fix is the only one that injects code to the
ReadAUX()
function. If separations are necessary, I will probably submit another PR along with a new fix that relies on it.Thanks for your time,
FireWolf