FreeBSD Bugzilla – Attachment 227443 Details for
Bug 257992
Touchpad buttons don't work on Dell Precision 7550 laptop
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
missing_button_type.patch
hmt.patch (text/plain), 2.72 KB, created by
Vladimir Kondratyev
on 2021-08-26 09:11:53 UTC
(
hide
)
Description:
missing_button_type.patch
Filename:
MIME Type:
Creator:
Vladimir Kondratyev
Created:
2021-08-26 09:11:53 UTC
Size:
2.72 KB
patch
obsolete
>commit c2fec1a3b7642d03f0b3fe18b8ba5858a00f52f9 >Author: Vladimir Kondratyev <wulf@FreeBSD.org> >Date: Tue Aug 24 18:28:02 2021 +0300 > > hmt(4): Add support for touchpads with no "button type" or > > "maximum number of contacts" usages. > > Assume touchpad to be a clickpad if it has only internal button. > Set number of contacts to 5 for touchpads and to 10 for touchscreens. > Check for fetched report length to avoid reading of stalled data. > Fixes Dell Precision 7550 laptop. > > PR: 257992 > >diff --git a/sys/dev/hid/hmt.c b/sys/dev/hid/hmt.c >index cb7afe7290d..dcf360bcffb 100644 >--- a/sys/dev/hid/hmt.c >+++ b/sys/dev/hid/hmt.c >@@ -300,7 +300,7 @@ hmt_attach(device_t dev) > const struct hid_device_info *hw = hid_get_device_info(dev); > void *d_ptr; > uint8_t *fbuf = NULL; >- hid_size_t d_len, fsize; >+ hid_size_t d_len, fsize, rsize; > uint32_t cont_count_max; > int nbuttons, btn; > size_t i; >@@ -321,9 +321,10 @@ hmt_attach(device_t dev) > > /* Fetch and parse "Contact count maximum" feature report */ > if (sc->cont_max_rlen > 1) { >- err = hid_get_report(dev, fbuf, sc->cont_max_rlen, NULL, >+ err = hid_get_report(dev, fbuf, sc->cont_max_rlen, &rsize, > HID_FEATURE_REPORT, sc->cont_max_rid); >- if (err == 0) { >+ if (err == 0 && (rsize - 1) * 8 >= >+ sc->cont_max_loc.pos + sc->cont_max_loc.size) { > cont_count_max = hid_get_udata(fbuf + 1, > sc->cont_max_rlen - 1, &sc->cont_max_loc); > /* >@@ -334,23 +335,24 @@ hmt_attach(device_t dev) > sc->cont_count_max = cont_count_max; > } else > DPRINTF("hid_get_report error=%d\n", err); >- } else >- DPRINTF("Feature report %hhu size invalid: %u\n", >- sc->cont_max_rid, sc->cont_max_rlen); >+ } >+ if (sc->cont_count_max == 0) >+ sc->cont_count_max = sc->type == HMT_TYPE_TOUCHSCREEN ? 10 : 5; > > /* Fetch and parse "Button type" feature report */ > if (sc->btn_type_rlen > 1 && sc->btn_type_rid != sc->cont_max_rid) { > bzero(fbuf, fsize); >- err = hid_get_report(dev, fbuf, sc->btn_type_rlen, NULL, >+ err = hid_get_report(dev, fbuf, sc->btn_type_rlen, &rsize, > HID_FEATURE_REPORT, sc->btn_type_rid); >- } >- if (sc->btn_type_rlen > 1) { >- if (err == 0) >- sc->is_clickpad = hid_get_udata(fbuf + 1, >- sc->btn_type_rlen - 1, &sc->btn_type_loc) == 0; >- else >+ if (err != 0) > DPRINTF("hid_get_report error=%d\n", err); > } >+ if (sc->btn_type_rlen > 1 && err == 0 && (rsize - 1) * 8 >= >+ sc->btn_type_loc.pos + sc->btn_type_loc.size) >+ sc->is_clickpad = hid_get_udata(fbuf + 1, sc->btn_type_rlen - 1, >+ &sc->btn_type_loc) == 0; >+ else >+ sc->is_clickpad = sc->max_button == 0 && sc->has_int_button; > > /* Fetch THQA certificate to enable some devices like WaveShare */ > if (sc->thqa_cert_rlen > 1 && sc->thqa_cert_rid != sc->cont_max_rid)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 257992
:
227361
|
227362
|
227390
|
227391
|
227402
|
227403
|
227415
|
227434
| 227443 |
227452