Bug 1861918 - Incorrect orientation of display, touchpad and touchscreen on Samsung Galaxy Book
Summary: Incorrect orientation of display, touchpad and touchscreen on Samsung Galaxy ...
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 34
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Kernel Maintainer List
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-07-29 21:40 UTC by daljit97
Modified: 2022-08-23 05:48 UTC (History)
20 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2022-06-07 22:27:31 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
logs for Kernel 5.6.6 and kernel 5.7.10 (35.73 KB, application/zip)
2020-07-29 21:40 UTC, daljit97
no flags Details

Description daljit97 2020-07-29 21:40:23 UTC
Created attachment 1702867 [details]
logs for Kernel 5.6.6 and kernel 5.7.10

1. Please describe the problem:

I am using a Galaxy Book 10.6 from Samsung with Fedora 32. This device doesn't play great with Linux, but after some digging around the web I was to able to make the basics kind of work (wifi, touchscreen and Samsung S-Pen support). The biggest issue with the device is that automatic orientation of the screen, touchpad and touchscreen is not recognised. So by default the screen orientation is flipped and touchpad/touchscreen also are incorrectly oriented. On Kernel 5.6.6-300 this is somewhat fixable by running the following commands:

 - xrandr -o left (this rotates the screen in landscape)
 - xinput set-prop "STMD1234:00 06CB:1058" "Coordinate Transformation Matrix" 0 1 0 -1 0 1 0 0 1 (this rotates the touchscreen so touch input is correctly taken in landscape)
 - xinput set-prop "WCOM0028:00 2D1F:000C Pen (0)" "Coordinate Transformation Matrix" 0 1 0 -1 0 1 0 0 1 (this rotates the touchscreen for the S-Pen, but it requires the pen to be used at least once before being run).

This is quite frustrating although still manageable. With the new kernel 5.7.10-201, this doesn't work anymore (I just recently updated my Fedora KDE 32 system that I freshly downloaded from the website). I am still able to rotate the screen (but this time I have to use xrandr -o right) and I was even able to rotate the touchpad cursor by using an inverse coordinate matrix, but the problem is that when I click with the touchpad the "location" which is clicked is actually not where the cursor appears. So if I click on the top-left side of the screen, the actual click happens somewhere on the bottom-right of the screen.

2. What is the Version-Release number of the kernel:
5.7.10-201 and 5.6.6-300

3. Did it work previously in Fedora? If so, what kernel version did the issue
   *first* appear?  Old kernels are available for download at
   https://koji.fedoraproject.org/koji/packageinfo?packageID=8 :

   5.6.6-300
4. Can you reproduce this issue? If so, please provide the steps to reproduce
   the issue below:
Just install a fresh version of Fedora 32 and update it.

I am attaching logs for both kernel versions I mentioned

Comment 1 Hans de Goede 2020-08-24 15:06:21 UTC
It sounds like this device is using a portrait panel in landscape mode.

There are more devices like this out there; and I have been working on getting these to work properly.

Unfortunately this requires some coordination between the kernel and userspace.

The kernel has a list of devices with this issue and it will automatically rotate the text console (at CTRL+ALT+F3) the right way up (when not also using an external display).

And it will tell userspace about this by setting a panel-orientation property on the LCD panel's
connector object in the drm/kms API, userspace should then automatically take care of things.

But this requires userspace to know about and honor the panel-orientation property.

The problem is that AFAIK atm only 2 userspace environments take the panel-orientation property into account:

1. plymouth (the boot splash)
2. GNOME3 / mutter

So this may not directly help you. I'm hoping that you are willing to help me to get things to work under GNOME (this will also fix the text-console and the bootsplash) and then once we have that working, then you can file a RFE bug with the 
KDE folks to ask them to support the panel-orientation property. I will happily answer any questions from the KDE folks about this and assuming they are in Germany (or the EU) I can even send them some hw to test.

Anyways lets first try to get things to behave properly at the text-console / plymouth and if you can test with GNOME after that that would be great.

With kernel 5.7 or newer you can add the kernel-quirk for this from the kernel commandline:

First of all do:

ls /sys/class/drm

You will see a number of card0-foo-1 devices there. I expect that one of them will be eDP, but it could also be DSI or even LVDS, that one should be your panel, you can check by doing e.g.:

cat /sys/class/drm/card0-eDP-1/modes 

(replace eDP if necessary) that should show your LCD panels resolution, probably in portrait mode, so with the lower value first, e.g. 1280x1920.

Now add the following to your kernel commandline:

video=eDP-1:panel_orientation=right_side_up

(again replace eDP if necessary)

And then after booting do:

cat /proc/cmdline

And check the option really is there, then go to a text console by pressing CTRL+ALT+F3 and check it now is the right way up.

You may need to use left_side_up instead of right_side_up.

This should also make the Fedora boot spinner show the right way up during boot.

Once you have this but working, it would be ideal if you can give GNOME3 a spin, with the right kernel cmdline + GNOME3
 I expect:

1. The display to be the right way up (except for auto-rotation getting in the way, you may want to blacklist the driver for your accelerometer for now)
2. Hopefully the touchpad will now also just work as it should
3. I'm not sure about the touchscreen though, but we can hope

Note:
1. GNOME3 testing should be done without any further hacks/workaround
2. Ideally use GDM + the "GNOME" desktop session type, not "GNOME on Xorg" so that you are using Wayland you can check that you are using wayland by running "xrandr", the video-output should be named "XWAYLAND0" in xrandr's output.
3. Note the auto-rotation can be easily fixed too, but that requires you to not be using any xrandr / xinput hacks as otherwise we might get it wrong from how it should actually be.

Comment 2 Fedora Program Management 2021-04-29 16:34:42 UTC
This message is a reminder that Fedora 32 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 32 on 2021-05-25.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '32'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 32 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 3 daljit97 2021-05-24 15:19:17 UTC
Hi, sorry for not getting back to this. I've recently tried to install Fedora 34 on my Galaxy Book. Using the recommended kernel parameters the display is in the correct orientation and the touchpad works ok (gestures too). However, the touchscreen is still flipped and has the wrong orientation. I've tested with stock Fedora 34 with Gnome 40 Wayland.

Comment 4 Hans de Goede 2021-05-24 15:50:14 UTC
Thank you for the new info, so it looks like we need 2 things for this device:

1. We need to add a quirk to the kernel for the LCD-panel orientation so that you (and other people trying Linux on the Samsung Galaxy Book 10.6) no longer have to specify "video=eDP-1:panel_orientation=right_side_up" on the kernel-commandline.

2. We need to do something about the touchscreen orientation

1. Is easy the kernel already has support for this, we just need to add the specific info for your model laptop. If you can provide the output of these 2 commands (run as normal user):

cat /sys/class/drm/card0-eDP-1/modes 
grep . /sys/class/dmi/id* 2> /dev/null

Then that will give me the necessary info to write a kernel patch for this.

2. For this I'm also going to need some more info and then we can see from there. 

First of all, with the tablet sitting on its keyboard please run: "monitor-sensor" followed by CTRL+C and provide the output of that command.

Also, please run:

ls -l /sys/bus/i2c/devices/*/driver

And let me know the output of that as well.

Comment 5 daljit97 2021-05-24 16:19:14 UTC
Ok, just to specify that the actual kernel parameter needed for correcting the orientation "video=eDP-1:panel_orientation=left_side_up".

The output of "cat /sys/class/drm/card0-eDP-1/modes" is: 1280x1920

The output of "grep . /sys/class/dmi/id* 2> /dev/null" is: nothing

The command "monitor-sensor" followed by CTRL+C gives:

    Waiting for iio-sensor-proxy to appear
^Z
[1]+  Stopped                 monitor-sensor


The output of "ls -l /sys/bus/i2c/devices/*/driver" is:

lrwxrwxrwx. 1 root root 0 May 24 12:12 /sys/bus/i2c/devices/i2c-STMD1234:00/driver -> ../../../../../../bus/i2c/drivers/i2c_hid_acpi
lrwxrwxrwx. 1 root root 0 May 24 12:12 /sys/bus/i2c/devices/i2c-WCOM0028:00/driver -> ../../../../../../bus/i2c/drivers/i2c_hid_acpi


I forgot to say this but the kernel I'm currently on is 5.12.5-300.fc34.x86_64.

Comment 6 Hans de Goede 2021-05-25 13:39:34 UTC
(In reply to daljit97 from comment #5)
> Ok, just to specify that the actual kernel parameter needed for correcting
> the orientation "video=eDP-1:panel_orientation=left_side_up".
> 
> The output of "cat /sys/class/drm/card0-eDP-1/modes" is: 1280x1920
> 
> The output of "grep . /sys/class/dmi/id* 2> /dev/null" is: nothing

I made a mistake with the command, please run:

grep . /sys/class/dmi/id/* 2> /dev/null

And provide the output of that, sorry.

> 
> The command "monitor-sensor" followed by CTRL+C gives:
> 
>     Waiting for iio-sensor-proxy to appear
> ^Z
> [1]+  Stopped                 monitor-sensor

Ok, so the rotation sensor of your device is not recognized by Linux atm (or your device does not have a rotation sensor), this is good because then we know that GNOME applying some rotation based on that is not an issue here.

> The output of "ls -l /sys/bus/i2c/devices/*/driver" is:
> 
> lrwxrwxrwx. 1 root root 0 May 24 12:12
> /sys/bus/i2c/devices/i2c-STMD1234:00/driver ->
> ../../../../../../bus/i2c/drivers/i2c_hid_acpi
> lrwxrwxrwx. 1 root root 0 May 24 12:12
> /sys/bus/i2c/devices/i2c-WCOM0028:00/driver ->
> ../../../../../../bus/i2c/drivers/i2c_hid_acpi

Ok, so your touchscreen (and pen digitizer) are both using an I2C-HID interface. Unfortunately we don't have support for dealing with rotation inside hid-multitouch yet, adding this will require some work. But first lets see that your touchscreen is actually using hid-multitouch, can you please run:

ls -l /sys/bus/hid/devices/0018\:*/driver

And provide the output of that command?

Comment 7 daljit97 2021-05-25 14:29:03 UTC
>Ok, so the rotation sensor of your device is not recognized by Linux atm (or your device does not have a rotation sensor)

The device does have a rotation sensor, I think it's just not recognised in Linux.

The output of "grep . /sys/class/dmi/id/* 2> /dev/null" is:

/sys/class/dmi/id/bios_date:02/14/2019
/sys/class/dmi/id/bios_release:5.12
/sys/class/dmi/id/bios_vendor:American Megatrends Inc.
/sys/class/dmi/id/bios_version:P05HAD.001.190214.WY.1754
/sys/class/dmi/id/board_asset_tag:No Asset Tag
/sys/class/dmi/id/board_name:SM-W620NZKBBTU
/sys/class/dmi/id/board_vendor:SAMSUNG ELECTRONICS CO., LTD.
/sys/class/dmi/id/board_version:SAMSUNG_SW_REVISION_12345+0.0.0000
/sys/class/dmi/id/chassis_asset_tag:No Asset Tag
/sys/class/dmi/id/chassis_type:32
/sys/class/dmi/id/chassis_vendor:SAMSUNG ELECTRONICS CO., LTD.
/sys/class/dmi/id/chassis_version:N/A
/sys/class/dmi/id/modalias:dmi:bvnAmericanMegatrendsInc.:bvrP05HAD.001.190214.WY.1754:bd02/14/2019:br5.12:svnSAMSUNGELECTRONICSCO.,LTD.:pnGalaxyBook10.6:pvrP05HAD:rvnSAMSUNGELECTRONICSCO.,LTD.:rnSM-W620NZKBBTU:rvrSAMSUNG_SW_REVISION_12345+0.0.0000:cvnSAMSUNGELECTRONICSCO.,LTD.:ct32:cvrN/A:
/sys/class/dmi/id/product_family:Galaxy Book Series
/sys/class/dmi/id/product_name:Galaxy Book 10.6
/sys/class/dmi/id/product_sku:GALAXY A5A5-PHAD
/sys/class/dmi/id/product_version:P05HAD
/sys/class/dmi/id/sys_vendor:SAMSUNG ELECTRONICS CO., LTD.
/sys/class/dmi/id/uevent:MODALIAS=dmi:bvnAmericanMegatrendsInc.:bvrP05HAD.001.190214.WY.1754:bd02/14/2019:br5.12:svnSAMSUNGELECTRONICSCO.,LTD.:pnGalaxyBook10.6:pvrP05HAD:rvnSAMSUNGELECTRONICSCO.,LTD.:rnSM-W620NZKBBTU:rvrSAMSUNG_SW_REVISION_12345+0.0.0000:cvnSAMSUNGELECTRONICSCO.,LTD.:ct32:cvrN/A:


The output of "ls -l /sys/bus/hid/devices/0018\:*/driver" is:


lrwxrwxrwx. 1 root root 0 May 25 10:24 /sys/bus/hid/devices/0018:06CB:1058.0005/driver -> ../../../../../../../bus/hid/drivers/hid-multitouch
lrwxrwxrwx. 1 root root 0 May 25 10:24 /sys/bus/hid/devices/0018:2D1F:000C.0004/driver -> ../../../../../../../bus/hid/drivers/hid-generic

Comment 8 Hans de Goede 2021-08-12 14:02:13 UTC
Sorry for the slow reply. So your "ls -l /sys/bus/hid/devices/0018\:*/driver" output shows that your touchscreen is using hid-multitouch.

Your device is the first device with a hid-multitouch touchscreen, where the touchscreen-coordinates are not a 1:1 match with the screen-coordinates. This means no-one has added support for coordinate conversion (swapping / mirroring) the hid-multitouch driver yet. Standard userspace expects a 1:1 mapping and we normally fix this by adding a quirk to the kernel to fixup the coordinates there.

But in this case that requires some non-trivial work to the hid-multitouch driver and I'm afraid that I don't have time to work on this.

Comment 9 Ben Cotton 2022-05-12 15:37:32 UTC
This message is a reminder that Fedora Linux 34 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 34 on 2022-06-07.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '34'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 34 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 10 Ben Cotton 2022-06-07 22:27:31 UTC
Fedora Linux 34 entered end-of-life (EOL) status on 2022-06-07.

Fedora Linux 34 is no longer maintained, which means that it
will not receive any further security or bug fix updates. As a result we
are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.