X86 platform drivers
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: "Mark Gross" <mgross@linux.intel.com>,
	"Andy Shevchenko" <andy@infradead.org>,
	"Elia Devito" <eliadevito@gmail.com>,
	"Platform Driver" <platform-driver-x86@vger.kernel.org>,
	"Stefan Brüns" <stefan.bruens@rwth-aachen.de>
Subject: Re: [PATCH] platform/x86: hp-wmi: Disable tablet-mode reporting by default
Date: Wed, 20 Jan 2021 14:43:00 +0100	[thread overview]
Message-ID: <74257696-12df-ff95-bcd9-2a30efb860b0@redhat.com> (raw)
In-Reply-To: <CAHp75VcCX6z+AGn5EhTRq4LudWg+7vUwzU7sb4tGiLPaw4z0Sg@mail.gmail.com>

Hi,

Thank you for the review.

Unrelated, but I would really appreciate a review of the series stating with:
"[PATCH 1/4] platform/x86: intel-vbtn: Rework wakeup handling in notify_handler()"

On 1/20/21 2:10 PM, Andy Shevchenko wrote:
> On Wed, Jan 20, 2021 at 2:49 PM Hans de Goede <hdegoede@redhat.com> wrote:
>>
>> Recently userspace has started making more use of SW_TABLET_MODE
>> (when an input-dev reports this).
>>
>> Specifically recent GNOME3 versions will:
>>
>> 1.  When SW_TABLET_MODE is reported and is reporting 0:
>> 1.1 Disable accelerometer-based screen auto-rotation
>> 1.2 Disable automatically showing the on-screen keyboard when a
>>     text-input field is focussed
>>
>> 2.  When SW_TABLET_MODE is reported and is reporting 1:
>> 2.1 Ignore input-events from the builtin keyboard and touchpad
>>     (this is for 360° hinges style 2-in-1s where the keyboard and
>>      touchpads are accessible on the back of the tablet when folded
>>      into tablet-mode)
>>
>> This means that claiming to support SW_TABLET_MODE when it does not
>> actually work / reports correct values has bad side-effects.
>>
>> The check in the hp-wmi code which is used to decide if the input-dev
>> should claim SW_TABLET_MODE support, only checks if the
>> HPWMI_HARDWARE_QUERY is supported. It does *not* check if the hardware
>> actually is capable of reporting SW_TABLET_MODE.
>>
>> This leads to the hp-wmi input-dev claming SW_TABLET_MODE support,
> 
> claiming

Ack, I will fix this up before merging this into review-hans.

>> while in reality it will always report 0 as SW_TABLET_MODE value.
>> This has been seen on a "HP ENVY x360 Convertible 15-cp0xxx" and
>> this likely is the case on a whole lot of other HP models.
>>
>> This problem causes both auto-rotation and on-screen keyboard
>> support to not work on affected x360 models.
>>
>> There is no easy fix for this, but since userspace expects
>> SW_TABLET_MODE reporting to be reliable when advertised it is
>> better to not claim/report SW_TABLET_MODE support at all, then
>> to claim to support it while it does not work.
>>
>> To avoid the mentioned problems, add a new enable_tablet_mode_sw
>> module-parameter which defaults to false.
>>
>> Note I've made this an int using the standard -1=auto, 0=off, 1=on
>> tripplet, with the hope that in the future we can come up with a
> 
> triplett

Ack, I will fix this up before merging this into review-hans.

>> better way to detect SW_TABLET_MODE support. ATM the default
>> auto option just does the same as off.
> 
> ...
> 
>> +static int enable_tablet_mode_sw = -1;
>> +module_param(enable_tablet_mode_sw, int, 0444);
>> +MODULE_PARM_DESC(enable_tablet_mode_sw, "Enable SW_TABLET_MODE reporting (-1=auto, 0=no, 1=yes)");
> 
> Does it need any documentation update?
> 

There is no documentation for this driver:

[hans@x1 linux]$ find Documentation -name '*wmi*'
Documentation/ABI/testing/sysfs-platform-intel-wmi-sbl-fw-update
Documentation/ABI/testing/sysfs-platform-asus-wmi
Documentation/ABI/testing/dell-smbios-wmi
Documentation/ABI/testing/sysfs-platform-intel-wmi-thunderbolt


> ...
> 
>> +       if (enable_tablet_mode_sw > 0) {
>> +               val = hp_wmi_hw_state(HPWMI_TABLET_MASK);
> 
>> +               if (!(val < 0)) {
> 
> Perhaps while at it you may change it to more natural
>   if (val >= 0)
> ?

Ack, I will fix this up before merging this into review-hans.

Note I plan to let this patch sit for a while before merging it
to give people time to complain about me just outright disabing
the SW_TABLET_MODE reporting by default.

Regards,

Hans



> 
>> +                       __set_bit(SW_TABLET_MODE, hp_wmi_input_dev->swbit);
>> +                       input_report_switch(hp_wmi_input_dev, SW_TABLET_MODE, val);
>> +               }
>>         }
> 


  reply	other threads:[~2021-01-20 21:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-20 12:49 [PATCH] platform/x86: hp-wmi: Disable tablet-mode reporting by default Hans de Goede
2021-01-20 13:10 ` Andy Shevchenko
2021-01-20 13:43   ` Hans de Goede [this message]
2021-01-21 23:48 ` mark gross
2021-01-22  0:15   ` Hans de Goede
2021-01-25 19:43     ` mark gross
2021-01-25 20:28       ` 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=74257696-12df-ff95-bcd9-2a30efb860b0@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=andy@infradead.org \
    --cc=eliadevito@gmail.com \
    --cc=mgross@linux.intel.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=stefan.bruens@rwth-aachen.de \
    /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