Bug 101828 - Correctly detect lid on freebsd
Summary: Correctly detect lid on freebsd
Status: RESOLVED FIXED
Alias: None
Product: upower
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Richard Hughes
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-18 09:49 UTC by Ali Abdallah
Modified: 2017-09-08 13:40 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Patch to fix lid detection on freebsd (408 bytes, patch)
2017-07-18 09:49 UTC, Ali Abdallah
Details | Splinter Review
freebsd: Fix lid detection on FreeBSD (1.16 KB, patch)
2017-09-08 13:39 UTC, Bastien Nocera
Details | Splinter Review

Description Ali Abdallah 2017-07-18 09:49:06 UTC
Created attachment 132743 [details] [review]
Patch to fix lid detection on freebsd

Please see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=175531

On freebsd, if hw.acpi.lid_switch_state is present (its default value is NONE), then a lid is detected by the kernel. Upower does the opposite and sets lid present only when hw.acpi.lid_switch_state is not NONE (which only happens when the lid is closed).

This has been fixed previously downstream, but for some reason in recent version of freebsd the fix is not applied to upower. 

The attached patch solves the issue.
Comment 1 Bastien Nocera 2017-09-08 13:39:07 UTC
Created attachment 134085 [details] [review]
freebsd: Fix lid detection on FreeBSD

UPower sets property LidIsPresent to true only if hw.acpi.lid_switch_state
is different from "NONE", "NONE" being the default value for FreeBSD.
Thus, the property is always false on default configurations.

Force UPower not to care about the value of the sysctl, making it check
only for its existence.

See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=175531
Comment 2 Bastien Nocera 2017-09-08 13:40:16 UTC
Attachment 134085 [details] pushed as 71ba27a - freebsd: Fix lid detection on FreeBSD

Please attach git-formatted patches with the correct authorship and commit message in the future, it makes it much easier (and thus quicker) to commit.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.