We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 5532 - [KMS/DRM] Disable cursor position correction since it's not needed anymore. FIX included.
Summary: [KMS/DRM] Disable cursor position correction since it's not needed anymore. F...
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: 2.0.15
Hardware: All Linux
: P2 normal
Assignee: Manuel Alfayate Corchete
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-05 00:53 UTC by Manuel Alfayate Corchete
Modified: 2021-02-06 11:06 UTC (History)
0 users

See Also:


Attachments
Disables cursor position correction because all windows are fullscreen now. (2.01 KB, patch)
2021-02-05 00:53 UTC, Manuel Alfayate Corchete
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Manuel Alfayate Corchete 2021-02-05 00:53:26 UTC
Created attachment 4763 [details]
Disables cursor position correction because all windows are fullscreen now.

Hi,

Since all windows are now fullscreen in the KMSDRM backend, because of this commit: 

https://hg.libsdl.org/SDL/rev/34bccff9c8e1

...cursor position correction is not needed anymore, because window is always inside the screen.

It was needed before because GBM cursor vertical zero is at the top of the screen, and when the windows appeared in a small area of the screen, the cursor vertical position was always wrong. It's not happening anymore because windows always start at the top of the screen.

I just forgot to do this on the aforementioned commit. Please review so I can merge, thanks.
Comment 1 Sam Lantinga 2021-02-05 01:28:59 UTC
Looks good!
Comment 2 Sam Lantinga 2021-02-05 01:29:55 UTC
Wait, what happens if the window that is created doesn't actually match an available resolution? If I create a 1024x512 window, for example? Or 512x1024?
Comment 3 Manuel Alfayate Corchete 2021-02-05 01:50:38 UTC
@Sam

Ín that case, the display's native resolution is used:

https://hg.libsdl.org/SDL/file/60b9ce4ee73e/src/video/kmsdrm/SDL_kmsdrmvideo.c#l1201

...but aspect ratio is not guaranteed to be correct, that's all.
Comment 4 Sam Lantinga 2021-02-05 14:03:43 UTC
Normally in a case like that we would set the correct aspect ratio and use black bars on the sides. Is that possible here?
Comment 5 Manuel Alfayate Corchete 2021-02-05 16:18:17 UTC
(In reply to Sam Lantinga from comment #4)
> Normally in a case like that we would set the correct aspect ratio and use
> black bars on the sides. Is that possible here?

No, that's no possible without planes.
And that's because, without planes, the buffer presented on screen AND the video mode must match (if they don't, the CRTC would be reading out of bounds, or not having enough pixels to read, and in both cases the DRM system would show us it's middle finger. If I had received 1 euro for each time I got that in my face, I would be rich by now).
Comment 6 Sam Lantinga 2021-02-05 16:48:12 UTC
Okay, go ahead and commit. We may revisit this in the future if we re-add optional support for planes, etc.
Comment 7 Manuel Alfayate Corchete 2021-02-05 21:19:29 UTC
@Sam. Ok, commit done. Closing this.
Comment 8 Sam Lantinga 2021-02-05 22:21:16 UTC
Reopening this, since you did not include the commit in the bug report.
Comment 9 Manuel Alfayate Corchete 2021-02-06 11:05:26 UTC
Sorry! I did the opposite: I included the bug on the commit, instead of including the commit on the bug. XD

Closing this via commit https://hg.libsdl.org/SDL/rev/fe9a63c67fc5
Comment 10 Manuel Alfayate Corchete 2021-02-06 11:06:11 UTC
Closing this via commit: https://hg.libsdl.org/SDL/rev/fe9a63c67fc5