-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
modules: lvgl: Fix coordinate handling for invert-{x,y} and swap-xy #70541
modules: lvgl: Fix coordinate handling for invert-{x,y} and swap-xy #70541
Conversation
I have tested the fix on my side, it works great 👍️ |
8b50367
to
a0f40e7
Compare
@fabiobaltieri finally had some cycles to come back to this, can you take a peek if thats what you had in mind? I put the additional x and y coordinate into a specialized struct for the pointer to not waste space on the other indevs. :^) |
Yes I think this is good, can you squash the commits? |
2bf5a0a
to
0cc55f2
Compare
ping @fabiobaltieri I did the rebase :^) |
@faxe1008 hey just noticed you left the squased commit comment in the commit message, wanna clean that up? I'll try to not miss the notification and reapprove immediately this time :-) (that's because you used squash when squashing, git merges the comments, you could have used "fixup" instead, it would have discarded the message of the fixup commit) |
This patch fixes two issues in the coordinate handling of the `zephyr,lvgl-pointer-input` compatible: - If the swap-xy flag is set the coordinates need to be swapped even before the sync event is received. - The coordinates are stored into an additional variable instead of the pending_event. This is done to prevent the double inversion for touch release events. Resolves issue zephyrproject-rtos#70539. Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
0cc55f2
to
0f3266b
Compare
This breaks the adafruit_2_8_tft_touch_v2 shield. Touch presses are now rotated 180 degrees (top-left is bottom right, etc.) |
zephyrproject-rtos#70541 has an issue where if the screen has been rotated, values calculated if invert-x or invert-y are set will be overwritten. This breaks the adafruit_2_8_tft_touch_v2 touchscreen as the display is rotated by 90 degrees but uses invert-x and invert-y. This change makes the invert-x and invert-y options independent of screen rotation. Signed-off-by: Glenn Andrews <glenn.andrews.42@gmail.com>
tmp = point->x; | ||
point->x = point->y; | ||
point->y = cap->y_resolution - tmp; | ||
point->x = data->point_y; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't look right. If cfg->invert_x
or cfg->invert_y
are set, AND the display orientation is rotated, you overwrite the inversion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this is what breaks input for me too. I am using the Adafruit 2.8 shield and trying to just do a simple tab view. The input seems to "work" by pressing the inverse x & y positions (like the input detection is rotated 180 degrees).
FYI, I am just using the default 90 degree orientation set in the devicetree defs for the shield
zephyrproject-rtos#70541 has an issue where if the screen has been rotated, values calculated if invert-x or invert-y are set will be overwritten. This breaks the adafruit_2_8_tft_touch_v2 touchscreen as the display is rotated by 90 degrees but uses invert-x and invert-y. This change makes the invert-x and invert-y options independent of screen rotation. Signed-off-by: Glenn Andrews <glenn.andrews.42@gmail.com>
Scrolling to find this comment after I made mine on the same ;) But yes, .. probably good to have the touch test sample in #67508 |
#70541 has an issue where if the screen has been rotated, values calculated if invert-x or invert-y are set will be overwritten. This breaks the adafruit_2_8_tft_touch_v2 touchscreen as the display is rotated by 90 degrees but uses invert-x and invert-y. This change makes the invert-x and invert-y options independent of screen rotation. Signed-off-by: Glenn Andrews <glenn.andrews.42@gmail.com>
This commit should take care of the changes introduced in zephyrproject-rtos#70541. Signed-off-by: Ioannis Karachalios <ioannis.karachalios.px@renesas.com>
zephyrproject-rtos/zephyr#70541 has an issue where if the screen has been rotated, values calculated if invert-x or invert-y are set will be overwritten. This breaks the adafruit_2_8_tft_touch_v2 touchscreen as the display is rotated by 90 degrees but uses invert-x and invert-y. This change makes the invert-x and invert-y options independent of screen rotation. (cherry picked from commit a70bf0e) Original-Signed-off-by: Glenn Andrews <glenn.andrews.42@gmail.com> GitOrigin-RevId: a70bf0e Change-Id: I889c7159335bd913b3c94b86ac98e7b86bdcbff3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/5575345 Tested-by: ChromeOS Prod (Robot) <chromeos-ci-prod@chromeos-bot.iam.gserviceaccount.com> Commit-Queue: Tristan Honscheid <honscheid@google.com> Tested-by: Tristan Honscheid <honscheid@google.com> Reviewed-by: Tristan Honscheid <honscheid@google.com>
zephyrproject-rtos#70541 has an issue where if the screen has been rotated, values calculated if invert-x or invert-y are set will be overwritten. This breaks the adafruit_2_8_tft_touch_v2 touchscreen as the display is rotated by 90 degrees but uses invert-x and invert-y. This change makes the invert-x and invert-y options independent of screen rotation. Signed-off-by: Glenn Andrews <glenn.andrews.42@gmail.com>
This patch fixes two issue in the coordinate handling of the
zephyr,lvgl-pointer-input
compatible:Resolves issue #70539.