Skip to content

fix: re-add ModelPressurePad quirk for Lenovo ThinkBook 14/16 G8+ IPH - #15

Open
Zeno-sole wants to merge 1 commit into
masterfrom
fix/thinkbook-g8plus-iph-pressurepad
Open

Zeno-sole wants to merge 1 commit into
masterfrom
fix/thinkbook-g8plus-iph-pressurepad

Conversation

@Zeno-sole

Copy link
Copy Markdown
Contributor

背景

PR #7 为 Lenovo ThinkBook G8+ IPH(Goodix GXTP5100,27C6:01E7)添加了压力板 quirk,随后 PR #8 因"部分机型触摸板失效"整体回退。本 PR 在 1.28.1 基线上重新提交修正后的版本。

原补丁的根因

原补丁使用 AttrInputProp=+INPUT_PROP_PRESSUREPAD,存在两个问题:

  1. libevdev < 1.13.6 不认识 INPUT_PROP_PRESSUREPAD 这个属性名。 parse_input_prop_property() 返回失败后,错误经 parse_file() / parse_files() 一路上抛,quirks_init_subsystem() 直接返回 NULL,libinput 日志报 Failed to load the device quirks ... This will negatively affect device behavior,整个 quirks 数据库被丢弃。HONOR MagicBook Art 14、ThinkBook 14+ G6/G7 等依赖 quirk 的机型随之失效——这就是"部分机型触摸板失效"的原因。已用 libinput-quirks validate 复现:

    quirks parser error: 30-vendor-goodix.quirks:9: failed to parse AttrInputProp=+INPUT_PROP_PRESSUREPAD
    Failed to initialize the device quirks.
    
  2. 原补丁仅按 VID/PID(27C6:01E7/27C6:01E8)匹配,这两个 ID 被多款 Lenovo 机型共用,其中包含并非压力板的触摸板。

另外,INPUT_PROP_PRESSUREPAD 在 libinput 1.28.1 中并未被任何代码消费(该支持在 1.31 才引入),所以原补丁在 1.26/1.28 上即使解析成功也没有实际作用。

修复

  • 使用 1.28.1 支持的 ModelPressurePad=1(等价于后续版本的 pressure pad 处理),不依赖 libevdev 的属性名表。
  • 按 DMI modalias + GXTP5100 设备名精确匹配,只影响两个机型:
    • dmi:*svnLENOVO:*pvrThinkBook14G8+IPH*:*
    • dmi:*svnLENOVO:*pvrThinkBook16G8+IPH*:*
  • 不再按 27C6:01E7/01E8 全局匹配,其他 Lenovo 机型完全不受影响。

验证

  • patch -p1 --dry-run 通过;
  • 对打补丁后的 quirks 目录运行 libinput-quirks validate:exit=0;
  • test/test_quirks_files.py:100 passed;
  • 用 fnmatch 模拟验证:14/16 G8+ IPH 命中;ThinkBook 14 G8+ IMH、G7+ IAH、G6+ IMH、HONOR 均不命中;
  • 已用 libevdev 1.13.4 实测 libevdev_property_from_name("INPUT_PROP_PRESSUREPAD") == -1,佐证原补丁的解析失败路径。

测试建议

  1. ThinkBook 14/16 G8+ IPH:触摸板可移动 + 可点击;
  2. 共用 27C6:01E7/27C6:01E8 的其他 Lenovo 机型:触摸板行为无变化;
  3. HONOR MagicBook Art 14、ThinkBook 14+ G6/G7:quirk 仍生效(验证整个 quirks 数据库正常加载);
  4. sudo libinput quirks validate。

Ref: https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1442

The Goodix GXTP5100 touchpads on the Lenovo ThinkBook 14 G8+ IPH and
ThinkBook 16 G8+ IPH report pressure as contact size. Without a
pressure pad quirk libinput can only click but cannot move the pointer.
Add a ModelPressurePad quirk for these two exact models.

The reverted patch (PR #8) used AttrInputProp=+INPUT_PROP_PRESSUREPAD.
That property name is unknown to libevdev < 1.13.6, so the quirks parser
fails and libinput discards the entire quirks database. Machines whose
touchpad relies on a quirk (HONOR MagicBook Art 14, ThinkBook 14+ G6/G7,
etc.) then lose it, which is why touchpads stopped working on some
models.

ModelPressurePad is the quirk supported by libinput 1.28.1 and does not
depend on libevdev's property name table. Match the exact DMI modalias
and the GXTP5100 device name instead of the shared Goodix USB IDs
27C6:01E7/27C6:01E8, so other Lenovo models are never affected.

Log: Added a safe DMI-scoped pressure pad quirk for ThinkBook 14/16 G8+ IPH

Influence:
1. Verify touchpad movement and click on ThinkBook 14 G8+ IPH
2. Verify touchpad movement and click on ThinkBook 16 G8+ IPH
3. Verify touchpads on other Lenovo models sharing 27C6:01E7/27C6:01E8
4. Verify HONOR MagicBook Art 14 and ThinkBook 14+ G6/G7 keep working
5. Run libinput quirks validate

fix: 为 Lenovo ThinkBook 14/16 G8+ IPH 添加 ModelPressurePad quirk

Lenovo ThinkBook 14/16 G8+ IPH 上的 Goodix GXTP5100 触摸板将压力值
上报为接触面积。缺少压力板 quirk 时 libinput 只能点击而无法移动指针,
因此为这两个具体机型添加 ModelPressurePad quirk。

被回退的补丁(PR #8)使用 AttrInputProp=+INPUT_PROP_PRESSUREPAD。
libevdev < 1.13.6 不认识该属性名,quirk 解析失败后 libinput 会丢弃
整个 quirks 数据库,依赖 quirk 的机型(HONOR MagicBook Art 14、
ThinkBook 14+ G6/G7 等)随之丢失 quirk,这正是部分机型触摸板失效的
原因。

ModelPressurePad 是 libinput 1.28.1 支持的 quirk,不依赖 libevdev
的属性名表。匹配时使用精确的 DMI modalias 和 GXTP5100 设备名,而不是
共用的 Goodix USB ID 27C6:01E7/27C6:01E8,避免影响其他 Lenovo 机型。

Log: 新增按 DMI 精确匹配的 ThinkBook 14/16 G8+ IPH 压力板 quirk

Influence:
1. 验证 ThinkBook 14 G8+ IPH 触摸板移动和点击
2. 验证 ThinkBook 16 G8+ IPH 触摸板移动和点击
3. 验证共用 27C6:01E7/27C6:01E8 的其他 Lenovo 机型触摸板正常
4. 验证 HONOR MagicBook Art 14、ThinkBook 14+ G6/G7 不受影响
5. 运行 libinput quirks validate

repo: libinput #master
@deepin-ci-robot

Copy link
Copy Markdown
Contributor

/hold
因为该quilt包的上游版本号变更,详情见: deepin-community/infra-settings#134

@deepin-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from zeno-sole. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@github-actions

Copy link
Copy Markdown

TAG Bot

TAG: 1.28.1-1+deb13u1deepin2
EXISTED: no
DISTRIBUTION: unstable

@Zeno-sole

Copy link
Copy Markdown
Contributor Author

/integrate

@github-actions

Copy link
Copy Markdown

AutoIntegrationPr Bot
auto integrate with pr url: deepin-community/Repository-Integration#4754
PrNumber: 4754
PrBranch: auto-integration-43855198011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants