https://bugs.kde.org/show_bug.cgi?id=447792

            Bug ID: 447792
           Summary: cmdline video option "reflect_x" isn't applied
           Product: kwin
           Version: 5.23.4
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: platform-drm
          Assignee: kwin-bugs-n...@kde.org
          Reporter: ja...@rocketmail.com
  Target Milestone: ---

Created attachment 145025
  --> https://bugs.kde.org/attachment.cgi?id=145025&action=edit
Screenshot showing the issue

SUMMARY
On device samsung-serranove, the screen natively shows a mirrored image.
Flipping the screen in the kernel is not implemented yet. In distribution
postmarketOS we compensate this by adding "video=540x960,reflect_x" to the boot
cmdline [1].

On Plasma Mobile with KWin version 5.22.4, the screen is ok after boot. When
rotating the device, auto-rotate rotates the screen. This results in a mirrored
image.

With KWin version 5.23.4, the screen shows a mirrored image right after boot.
It remains mirrored after auto-rotation.

Between those versions, at 5.22.90, there was a commit "drm: Use KScreen's json
files to set up the initial output composition" [2]. So I guess in KWin 5.22.4
the configuration was first read from ~/.config/kwinrc and upon auto-rotation
it was read from ~/.local/share/kscreen/. In KWin 5.23.4 it's read from
~/.local/share/kscreen/. right away.

Using the package "drm_info" to have a better insight, I can see that on KWin
5.22.4 after boot the "rotation" property of the drm plane 0 is at "(rotate-0 |
reflect-x)". After auto-rotation it's changed to "(rotate-0)" only. On KWin
5.23.4 it's on "(rotate-0)" only from the beginning.

As far as I can see, KScreen doesn't support screen flipping/reflecting [3]
[4]. Presumably because of this, the reflect-x of the drm plane get's lost as
soon as KScreen comes in.

Well, I guess this comes down to KScreen missing this feature.

[1] https://www.kernel.org/doc/html/v5.15/fb/modedb.html
[2] https://invent.kde.org/plasma/kwin/-/merge_requests/944
[3]
https://invent.kde.org/plasma/libkscreen/-/blob/v5.23.4/backends/kwayland/waylandoutputdevice.cpp#L101
[4]
https://invent.kde.org/plasma/kwin/-/blob/v5.23.4/src/plugins/platforms/drm/drm_backend.cpp#L445-467


STEPS TO REPRODUCE
Unfortunately, this cannot be reproduced on many desktops or laptops. Many
cards don't support refect-x. Whether it's supported can be checked by
installing package drm-info, type "drm_info | less", checking if "rotation"
property is listed for plane 0 and if it's capable to do "reflect-x". On Debian
or Ubuntu, the package is available on bullseye and hirsute or higher.

If the card is able to do reflect-x, the issue can be reproduced artificiallly.
I could not test this because my desktop/laptop cards don't support
"reflect-x".
1. Make sure in Plasma Settings -> Display -> the rotation is set to "No
Roation".
2. Get the screen resolution, e.g. by something like cat
/sys/class/graphics/fb0/modes.
3. Add something like "video=1280x1024,reflect_x" to the boot cmdline.
4a. On KWin 5.22.4, after reboot, the screen should be
flipped/reflected/mirrored. When now going to Plasma Settings -> Display ->
change the rotation to something, the "reflect-x" will get lost and the screen
isn't mirrored anymore.
4b. On KWin 5.23.4, when reaching Plasma after reboot, "reflect-x" will get
lost directly.


OBSERVED RESULT
On KWin 5.23.4, boot cmdline video parameter "reflect_x" gets lost. Also there
seems no other possibility to flip the screen.

On KWin 5.22.4, this happens after rotating the screen (KScreen).


EXPECTED RESULT
Ability to reflect/flip the screeen if needed, e.g. by cmdline video parameter
"reflect_x".


SOFTWARE/OS VERSIONS
Operating System: postmarketOS v21.12 / Plasma Mobile
KDE Plasma Version: 5.23.4
KDE Frameworks Version: 5.89.0
Qt Version: 5.15.3
Kernel Version: 5.15.0-msm8916 (armv7)
OS Type: 32-bit
Graphics Platform: Wayland
Processors: 4 × 1.2 GHz Quad-core Cortex-A53
Memory: 1.4 GiB of RAM
Graphics Processor: Adreno 305


ADDITIONAL INFORMATION
none

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to