forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 20
Real panel driver for lavender-tianma and nvt-ts as touch driver #88
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
Closed
minlexx
wants to merge
9
commits into
qcom-sdm660-6.15.0-rc6
from
alexeymin/6.15-lavender-panel-test
Closed
Real panel driver for lavender-tianma and nvt-ts as touch driver #88
minlexx
wants to merge
9
commits into
qcom-sdm660-6.15.0-rc6
from
alexeymin/6.15-lavender-panel-test
Conversation
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
Introduce reference counted allocations for panels to avoid use-after-free. The patch adds the macro devm_drm_bridge_alloc() to allocate a new refcounted panel. Followed the documentation for drmm_encoder_alloc() and devm_drm_dev_alloc and other similar implementations for this purpose. Reviewed-by: Maxime Ripard <[email protected]> Signed-off-by: Anusha Srivatsa <[email protected]>
Allocate panel via reference counting. Add _get() and _put() helper functions to ensure panel allocations are refcounted. Avoid use after free by ensuring panel pointer is valid and can be usable till the last reference is put. Reviewed-by: Luca Ceresoli <[email protected]> Reviewed-by: Maxime Ripard <[email protected]> Signed-off-by: Anusha Srivatsa <[email protected]>
Start moving to the new refcounted allocations using the new API devm_drm_panel_alloc(). Deprecate any other allocation. Reviewed-by: Luca Ceresoli <[email protected]> Reviewed-by: Maxime Ripard <[email protected]> Signed-off-by: Anusha Srivatsa <[email protected]>
…evm_kzalloc() Start using the new helper that does the refcounted allocations. Reviewed-by: Luca Ceresoli <[email protected]> Reviewed-by: Maxime Ripard <[email protected]> Signed-off-by: Anusha Srivatsa <[email protected]>
1bedd34
to
1c49cd8
Compare
Signed-off-by: Barnabás Czémán <[email protected]>
Signed-off-by: Barnabás Czémán <[email protected]>
1c49cd8
to
0e933db
Compare
The driver was made with extensibility in mind, but it is not enough. In preparation for extending the driver with support for more panels, stop using arrays of nt36672a_panel_cmd, which incorrectly assumed that all panels will have init sequences consisting of 2 bytes. This is not true for all panels using nt36672a controller. Instead, use dedicated init and shutdown functions for each panel. This allows for more flexibility, solving at least 2 problems: * different DSI commands length for different panels * different delays for msleep() calls for different panels Make it so that each panel can initialize the way it prefers. Combine init sequences in .on_cmds_1 and .on_cmds_2 into a new init finction, and code from .off_cmds to new off_cmds function. Struct nt36672a_panel_cmd and function nt36672a_send_cmds() are no longer needed, remove them. While doing this, also switch to moderm multi-api for sending commands, which greatly simplifies error handling using accumulated error counter. This refactoring change should have no functional effect on existing devices. Signed-off-by: Alexey Minnekhanov <[email protected]>
Add support for Tianma video mode panel based on nt36672a, used in Xiaomi Redmi Note 7 smartphone (xiaomi-lavender). Tianma panel is one of the 3 panel variants that you can find inside xiaomi-lavender. Signed-off-by: Alexey Minnekhanov <[email protected]>
Signed-off-by: Alexey Minnekhanov <[email protected]>
0e933db
to
7b3ab5b
Compare
This was just for testing. It will be done properly and fully in PR #89 |
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.
Thx @barni2000
dmesg of booting with this https://paste.sr.ht/~minlexx/6562b0f71c18e0560e471ff9bc0db6214d227c80