What's the build date of the image? (in yyyy-mm-dd format)
2021-12-12
Additional information
I expect this to be specific to samsung-serranove.
Its screen seems to be wired like this. We handle this by adding a reflect_x to the video parameter in the boot cmdline of the deviceinfo file (link). This works generally well.
It also worked for Plasma Mobile so far. Although this flipping/mirroring did happen after automatic screen rotation before. Now after some upgrade recently it's like this permanently.
I had a try by removing the reflect_x from cmdline and creating a new initramfs but that didn't help. The boot screen was mirrored, still Plasma Mobile remained flipped/mirrored as well. It seems to hande it independently.
I looked for a flipping option in the Settings -> Displays, in kscreen-doctor and in folder ~/.local/share/kscreen/. I see options for rotation and scale but not for flipping/mirroring.
Does anyone has an idea how to flip/mirror a screen in Plasma Mobile? If so, we can include that in a config file and install it with the device package.
4 of 21 checklist items completed
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items ...
Show closed items
Linked items 0
Link issues together to show that they're related.
Learn more.
Related merge requests 3
When these merge requests are accepted, this issue will be closed automatically.
Other UIs are ok. They work fine with the cmdline option "video=540x960,reflect_x" in /etc/deviceinfo.
On Plasma, KWin seems to handle it differently. I'm not familiar with the path of video from userspace via kernel to hardware, though. Especially KWin is new to me.
To keep it easy, I thought of changing some config to tell KWin to flip the screen. I'm currently digging around. Looks like kscreen doesn't support flipping [1]. It's not yet clear to me if KWin itself does support it [2] [3] [4]. I'm trying to set some options in ~/.config/kwinrc, no success so far but I keep on trying.
Changing this to "Transform=flip" flipped the screen after reboot. Well, this wouldn't solve the problem because in v21.06 the screen was actually ok after boot (until when rotating the device, auto-rotate made the screen flip to mirrored). Using "Transform=flip" makes it mirrored from the beginning, which doesn't help, but: flipping was possible.
In pmOS v21.12 (KWin 5.23.4), this block doesn't exist anymore. Searching for the reason I found a commit that changes the setup of "the initial output composition" to use "KScreen's json files" [1] [2]. KScreen handles rotation only, no flips [3].
It looks to me like in v21.06 the initial setup was read from ~/.config/kwinrc and upon auto-rotation it was read from ~/.local/share/kscreen. Something like this is also descibed at the beginning of [4]. In v21.12 it reads from ~/.local/share/kscreen right away.
So it looks like Plasma is actually changing the "rotation" property in the drm driver.
On Plasma Mobile at v21.06, it's first with "reflect-x" and after auto-rotating it's without. I think this is because KScreen handles the auto-rotation thing. As KScreen is not capable to manage flips/reflects, this information gets "lost". In v21.12 the information gets derived from KScreen from the beginning, so the "reflect-x" is missig from the beginning as well.
Currently I don't have a good idea how to proceed on this.
Your bug reports are absolutely amazing! Have you tried providing this information to a new issue in kwin? The way you describe it, it totally looks like an upstream issue and hopefully with a description like yours they'll be able to help you :)
I guess it would be quite some work to implement it correctly. Unfortunately, I currently don't have time to take care of this and have other priorities on my list.
It's possible that the panel controller could also flip the image for us (and that would be a much more convenient solution), but without documentation it's pretty much impossible to say how to do this. :(
Thanks for reporting, sorry the late reply. What device do you use, samsung-serranove?
gnome mobile, that's new to me, haven't tested yet. I'm rather optimistic there is a solution mirroring the screen in software for this case, as I'd expect its Wayland compositor to be able to do this. (Whereas in KWin, the Wayland compositor of Plasma Mobile, this feature got lost due to some refactoring).
To solve it properly for samsung-serranove, there needs to be invested some work in the panel kernel driver. Until then, we rely on the mirroring ability of the Wayland compositors.
I had a try with GNOME mobile on samsung-serranove. Indeed the screen is mirrored. I went to settings -> display – but there is no option to flip the screen.
Looking for the Wayland compositor, I realized that it doesn't use package "mutter" like Phosh but "mutter-mobile" instead. That likely explains the different behaviour.
Concerning samsung-serranove, the display is natively flipped for some reason. We flip it back by adding "video=540x960,reflect_x" to the kernel command line (source). The window manager or compositor needs to take care of this, X11 user interfaces and GNOME/Phosh are able to handle it.
Next step would probably be finding out how GNOME/Phosh actually flips the screen. Whether this happens within "mutter" or some other component. Keywords might be "reflect, flip, mirror", though there is some overlap with other meanings like "screen mirroring" or "page flip".
Just for information, I won't work actively on this issue in near future, unfortunately. Kernel-wise I'm working on other things for samsung-serranove on very slow pace (magnetometer/compass, proximity/light sensor, charging driver). User-interface-wise I'm busy with keeping Xfce4 and MATE in shape.
Hello Jakko,
indeed I am using a samsung-serranove device. Thank you very much for your input. This goes way over my knowledge, so I am not able to be any helpful at this :( Of course using phosh on this device is IMHO very usable and I must say process on the charging driver will make this device nevertheless more capable for daily driving it rather than supporting another UI (but I have to admit gnome mobile looks very promising!)
To solve it properly, work would need to be invested in the panel driver or the panel controller.
(Btw and off-topic, there is another issue with the samsung-serranove panel. On X11 desktop envorimnents, the panel does not wake up after being turned off by power manager. Issue #1570 (closed).)
In parallel, I might have found a way to flip the screen in the panel driver of samsung-serranove. That way it could also be solved for gnome-mobile. I searched for the panel driver of the similar device Samsung Galaxy S4 mini LTE "samsung-serranolte" (the one without "Value Edition"). I think it's the following one. It contains code to flip the panel (in dependence of the panel clock rate):
This panel driver also supports brightness control. However, it's not yet sure the screen flip and brightness control can be adapted just like that into the samsung-serranove panel driver. Trying to implement this is one of the next things on my list. It will take some time, though.
Doing it on the kernel level is definitely the right way to go, but in the meantime you could try out the Plasma Mobile nightly repository and see if the option is indeed there and works around the issue for you.
I haven't tried Plasma Mobile on samsung-serranove for a long time. I now had a try on pmOS edge. Actually KWin in Plasma 6 should be able to flip the screen. Unfortunately, the problem still persists. I don't know why exactly. The automatic screen flip by samsung-serranove kernel cmdline "video=540x960,reflect_x" doesn't get applied. And in the Plasma Mobile settings I couldn't* find an option to flip the screen. This would need more investigation on the Plasma Mobile side – but currently I'm short on time.
*) fixed a typo on "couldn't"
Some while ago I started to work on the kernel panel driver for samsung-serranove for screen flip and also brightness control. Unfortunately I got stuck halfway and, again, I didn't find the time to progress on this. If I have news to report on this, I'll post them here.
And in the Plasma Mobile settings I couldn't* find an option to flip the screen.
By commmand line, kscreen-doctor output.1.rotation.flipped flips the screen and kscreen-doctor output.1.rotation.normal turns it back. Instead of output "1" it can also be used the name of the output given by kscreen-doctor -o. However, I haven't found out how to apply these commands via ssh (I did it native on the device, via ssh it can't connect to the display). And neither I have found out how to save that config permanently.
Alternatively, after logging out from Plasma Mobile, the file ~/.config/kwinoutputconfig.json can be edited via ssh or by other means, changing "transform" from "Normal" to "Flipped".
For the time being I won't invest more time into fixing this on the level of Plasma Mobile. Instead I'll try to continue working on the kernel panel driver of samsung-serranove.
For completeness, sharing some more experiecne. The above post was based on testing Plasma Desktop on Qemu. I now tried that on samsung-serranove and Plasma Mobile with an sd-card. After setting up the sd-card with pmboostrap and booting it in the device, shutting down again, I edited the file /home/user/.config/kwinoutputconfig.json on a PC. Putting it back into samsung-serranove did not flip the screen at first, to my surprise. Confusingly, another log out and log in did the job.
Independent from flipping or not flipping the screen, there are some graphical issues with samsung-serranove on Plasma Mobile. Foreground elements like application icons sometimes dissapear, the screen doesn't always get updated, sometimes there are tearing issues. I tried some options in the Settings without success. Also the terminal application refuses to start up. I don't think these graphical issues are device-related, maybe rather gpu-type related.
In parallel I'll try to upstream the panel driver and the devicetree panel snippet. This will take time...
Independent from the changes on the panel driver, there are some graphical glitches when running Plasma Mobile or GNOME mobile on samsung-serranove. By now there is an issue report about this: #3212