mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Maximilian Luz <luzmaximilian@gmail.com>
To: Hans de Goede <hdegoede@redhat.com>
Cc: Mark Gross <markgross@kernel.org>,
	platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/4] platform/surface: Add KIP/POS tablet-mode switch driver
Date: Sun, 3 Jul 2022 15:44:42 +0200	[thread overview]
Message-ID: <3c5e8227-8110-a949-8045-54206357d63c@gmail.com> (raw)
In-Reply-To: <a49c84ed-c885-fe9b-5971-681a43edb560@redhat.com>

On 7/2/22 11:05, Hans de Goede wrote:

[...]

>> A few more notes on the Surface Laptop Studio:
>>
>> A peculiarity of the Surface Laptop Studio is its "slate/tent" mode
>> (symbolized: user> _/\). In this mode, the screen covers the keyboard
>> but leaves the touchpad exposed. This is essentially a mode in-between
>> tablet and laptop, and it is debatable whether tablet-mode should be
>> enabled in this mode. We therefore let the user decide this via a module
>> parameter.
>>
>> In particular, tablet-mode may bring up the on-screen touch keyboard
>> more easily, which would be desirable in this mode. However, some
>> user-space software currently also decides to disable keyboard and, more
>> importantly, touchpad input, while the touchpad is still accessible in
>> the "slate/tent" mode. Furthermore, this mode shares its identifier with
>> "slate/flipped" mode where the screen is flipped 180° and the keyboard
>> points away from the user (symbolized: user> /_). In this mode we would
>> like to enable auto-rotation, something that user-space software may
>> only do when tablet-mode is enabled. We therefore default to the
>> slate-mode enabling the tablet-mode switch.
> 
> Note that you could add a libinput quirk to ignore the tablet-switch
> for keybd/touchpad event suprression since when not used the keyboard /
> touchpad are covered I expect them to not send false input events so
> this should be fine. Then the touchpad will keep working in "slate/tent"
> mode while still enabling the onscreen-kbd since you are reporting
> sw_tablet_mode=1.
> 
> The onscreen-kbd and auto-rotation enabling/disabling lives outside of
> ibinput. Although gnome-shell does use libinput to read the touchpad and
> currently I think the only way to get libinput to ignore the tablet-mode-sw
> is to mark it as unreliable, which I guess might also stop it from reporting
> it to gnome-shell.
> 
> Another option would be to mark the touchpad as "external" with a libinput
> quirk (so not build into the hw) then it also won't suppress events based
> on the tablet-mode-sw state. TL;DR: this can be fixed with a quirk on
> the libinput side, how best to do that needs to be discussed with the libinput
> devs.
> 
> And once solved at the libinput side, you probably don't need
> the module-parameter. Note I'm fine with keeping it, but feel free to
> submit a follow-up patch to remove it, explaining that this is fixed
> in libinput now...

Thanks for that hint!

Turns out libinput has a quirk for that (ModelTabletModeNoSuspend). I'm
working with someone actually owning a SLS and we will submit an entry
to the libinput hwdb once we've fleshed that out.

I'll yet have to think some more about whether it makes sense to keep
the module parameter or not. I think ideally there would be a way to
notify user-space for more states than just tablet/laptop, but that is
very device specific.

Regards,
Max

  reply	other threads:[~2022-07-03 13:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-24 18:36 [PATCH 0/4] platform/surface: Add support for tablet mode switch via Surface Aggregator Module Maximilian Luz
2022-06-24 18:36 ` [PATCH 1/4] platform/surface: aggregator: Add helper macros for requests with argument and return value Maximilian Luz
2022-06-24 18:36 ` [PATCH 2/4] platform/surface: Add KIP/POS tablet-mode switch driver Maximilian Luz
2022-06-25  2:59   ` kernel test robot
2022-06-25 12:58     ` Maximilian Luz
2022-07-02  9:05   ` Hans de Goede
2022-07-03 13:44     ` Maximilian Luz [this message]
2022-06-24 18:36 ` [PATCH 3/4] platform/surface: aggregator_registry: Add support for tablet mode switch on Surface Pro 8 Maximilian Luz
2022-06-24 18:36 ` [PATCH 4/4] platform/surface: aggregator_registry: Add support for tablet mode switch on Surface Laptop Studio Maximilian Luz
2022-07-02  9:13 ` [PATCH 0/4] platform/surface: Add support for tablet mode switch via Surface Aggregator Module Hans de Goede

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3c5e8227-8110-a949-8045-54206357d63c@gmail.com \
    --to=luzmaximilian@gmail.com \
    --cc=hdegoede@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=markgross@kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®