[platforms/drm] Rotate screen if requested from KScreen
ClosedPublic

Authored by graesslin on Nov 1 2017, 2:58 PM.

Details

Summary

This change hooks up the drm plane rotate with the rotation requests
from KScreen. Our requests support more than what KScreen exposes in the
UI, that is all the flipped variants. I do not really understand what
the flip means, so this is not implemented yet.

Furthermore this only implements the visual rotation and not the input
rotation. This means mouse movement and touch input is currently broken
on a rotated screen.

Please note that the hardware I used seems to not support the vertical
rotation. I'm not sure whether my code works. On my system it just
results in atomic commit errors and we need to go back to a previous
working state. This is not yet implemented. I need to test the vertical
rotation on my notebook, which should (in theory) support it.

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
graesslin created this revision.Nov 1 2017, 2:58 PM
Restricted Application added a project: KWin. · View Herald TranscriptNov 1 2017, 2:58 PM
Restricted Application added subscribers: kwin, plasma-devel. · View Herald Transcript

Furthermore this only implements the visual rotation and not the input rotation.

For mouse I think this is the correct behaviour. If I flip a monitor, I would expect moving the mouse up should make it go down.
This means mouse movement and touch input is currently broken on a rotated screen.

and so if I have mounted my TV upside down like an idiot we have two inversions, a physical and virtual one, so moving the mouse up makes the cursor go up)


That does mean we need to make sure we flip the cursor plane too.

Furthermore this only implements the visual rotation and not the input rotation.

For mouse I think this is the correct behaviour. If I flip a monitor, I would expect moving the mouse up should make it go down.
This means mouse movement and touch input is currently broken on a rotated screen.

and so if I have mounted my TV upside down like an idiot we have two inversions, a physical and virtual one, so moving the mouse up makes the cursor go up)


That does mean we need to make sure we flip the cursor plane too.

One thing is flipping the cursor plane, another is that I saw that the position of the cursor is wrong. Maybe flipping the cursor plane will fix that, maybe the position needs to be translated. But it was clearly wrong. With mouse mark effect I got the true position and that one was correct, the cursor position not.

I tried rotating the cursor plane: that does not help unfortunately.

I tried rotating the cursor plane: that does not help unfortunately.

Which is no surprise, the API seems not to use atomic commits, so it just never gets populated.

ngraham added a subscriber: ngraham.Nov 1 2017, 6:48 PM
This revision was automatically updated to reflect the committed changes.