Age | Commit message (Collapse) | Author | Files | Lines |
|
The GUdev API was declared stable in udev release 147.
Bump the version in the configure check and drop the
G_UDEV_API_IS_SUBJECT_TO_CHANGE defines.
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
|
In up_input_coldplug(), some checks are done on the input device found in order
to detect if it's a lid switch or not.
The following one is problematic :
/* convert to a bitmask */
num_bits = up_input_str_to_bitmask (contents, bitmask, sizeof (bitmask));
if (num_bits != 1) {
g_debug ("not one bitmask entry for %s", native_path);
ret = FALSE;
goto out;
}
Checking if there's only 1 bit set is wrong. It's nice if you have a x86 with
acpi using 1 input device for the lid switch but it's not always nice.
One can create input devices with gpios-keys like this:
static struct gpio_keys_button keys[] = {
{
.code = SW_LID,
.gpio = ...,
.type = EV_SW,
.desc = "Lid Switch",
},
{
.code = SW_RFKILL_ALL,
.gpio = ...,
.type = EV_SW,
.desc = "rfkill",
},
};
The resulting SW bitmap will be 9 and thus there are 2 bits sets and due to the
mentionned check, the device is ignored by upower.
As a fix, I'm checking if the number of bits is between 0 and SW_CNT
bits.
Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
|
|
|
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
|
We still need to add the DMI quirks, but I'm waiting for the
community to supply them now.
|
|
status
Not ideal, but better than relying on ACPI.
|
|
|
|
The kernel has removed the insanity of providing current_now in either
(and unspecified) units of uVh or uWh and instead provides power_now
for the power rate value.
Related commits:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=b137b9942a07843c64a934cfdb7d43155e507e13
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=7faa144a518c456e2057918f030f50100144ccc6
Thanks to Florian Eitel for the initial patch.
|
|
Previously we set the "max age" to seconds and then waited for exactly 2
seconds until we wrote the history data back to files. In a lot of cases this
actually took a tad more than 2 seconds, which caused the second-last history
entry to disappear as well.
Reduce the waiting to 1.1 seconds, which will now give us 900 ms to write back
the history file. Still not ideal, but the best we can do in the test suite.
|
|
In our test suite, create and use a temporary directory for our history. This
makes the history check work as non-root.
Consequently, drop the skipping of the history check for "make distcheck".
|
|
Add up_history_set_directory() method to change the directory for history
files. This is mainly useful for our test suite.
|
|
Include <stdint.h> so that <linux/fs.h> can use uint64_t. Arguably a bug in the
kernel headers, but it costs us nothing to safeguard against it.
CC libupshared_la-up-device-idevice.lo
In file included from sysfs-utils.c:39:0:
/usr/include/linux/fs.h:37:2: error: expected specifier-qualifier-list before ‘uint64_t’
|
|
|
|
|
|
When a full battery starts to discharge, but reports its status as 'Unknown',
it takes a few minutes before g-p-m notices any change.
upowerd guesses the battery is fully charged as long as it has over 90% charge.
I see no reason to delay the reporting of discharging of the battery.
Let's remove this heuristic.
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
|
Fixes a fail to detect keyboard backlight when initial value is zero
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
|
Add a new DBus interface based on the QoS one to provide for controlling a
keyboard backlight via the Linux leds interface.
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
|
|
|
rh#634228
Parsing huge log files at startup will demolish startup time. Cull old
entries when the file is resaved to keep them sane. Also add the needed
self tests to check this in the future.
|
|
|
|
All callers of up_polkit_get_subject() just exit without returning an error to
the D-BUS caller if they fail to get the PolicyKit subject. Do that in
up_polkit_get_subject() itself now, for convenience.
Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
|
|
Do not send a D-BUS return message any more in up_polkit_is_allowed(), since
this makes it hard for callers to ensure that they return exactly one result to
the D-BUS caller. Instead, just pass a GError to the caller.
Update up_daemon_suspend_allowed() and up_daemon_hibernate_allowed()
accordingly, to always return either a result or an error.
Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
|
|
Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
|
|
This reverts commit 1fc5aae71f474f82ba62c7a92be3aef05cc7ebef.
|
|
Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
|
|
dbus_g_method_return_error() does not free or take ownership of the passed
GError, we need to free it ourselves.
Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
|
|
|
|
|
|
|
|
Checking for enough hibernation swap space at the daemon startup is not
sufficient, since both active memory as well as swap space change over time.
Now check whenever we receive a hibernate request or read the can-hibernate
property.
|
|
*brown paperbag*
|
|
Commmit fc7c6e003 had a thinko, UP_DAEMON_WATERLINE specifies (active
memory)/(available swap), not the other way around. So replace it with 99%
instead.
Also update the documentation of up_backend_get_used_swap() to explain what the
returned percentage actually means.
|
|
We need sys/wait.h to get the WEXITSTATUS (and related) macros.
|
|
Native Linux suspend-to-disk does not use compression, and needs 2 KB of page
meta information for each MB of active memory. So bump the previous waterline
of 80% of active memory to 100.2%. Add an extra .05% to prevent rounding errors.
This should make the prediction whether hibernate is going to work very
accurate. However, it might prevent hibernate for folks who use an alternative
userspace solution like uswsusp which do support compression.
http://lists.freedesktop.org/archives/devkit-devel/2010-July/000867.html
|
|
specifics
|
|
In linux backend, g_object_set was called with wrong
argument types for time-to-empty,time-to-full and percentage
properties. This patch uses explicit casts in the same way as freebsd
backend.
Signed-off-by: Mariusz Ceier <mceier@gmail.com>
|
|
pm-is-supported does all the work upower was duplicating, and it handles more
use cases than the old upower code did. No point in duplicating functionality.
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
|
GCC was complaining about int and ssize_t being differnt types.
Make it quit doing that.
|
|
|
|
This makes it possible to profile more accurately using systemtap
|
|
tablets
|
|
up_daemon_check_swap_space uses the Active: line from /proc/meminfo to
determine the amount of swap the system needs to be able to suspend. However,
because Active: includes both anonymous and file-backed pages, this greatly
overestimates the amount of swap needed. File-backed pages can be written back
to disk and so do not consume swap.
Instead, up_daemon_check_swap_space should use Active(anon): from /proc/meminfo
because only anonymous pages need to be written out to swap during a suspend.
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
|
|
|
|
|
|
|
My fault :(
|
|
Signed-off-by: Richard Hughes <richard@hughsie.com>
|
|
value
|
|
|
|
https://bugs.freedesktop.org/show_bug.cgi?id=28286
Signed-off-by: Richard Hughes <richard@hughsie.com>
|