Your message dated Fri, 5 Dec 2008 23:29:28 +0000
with message-id <[EMAIL PROTECTED]>
and subject line Re: [Pkg-xfce-devel] Bug#507607: xfce4-battery-plugin: 
2.6.28-rc7 breaks time remaining
has caused the Debian Bug report #507607,
regarding xfce4-battery-plugin: 2.6.28-rc7 breaks time remaining
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [EMAIL PROTECTED]
immediately.)


-- 
507607: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=507607
Debian Bug Tracking System
Contact [EMAIL PROTECTED] with problems
--- Begin Message ---
Package: xfce4-battery-plugin
Version: 0.5.0-7
Severity: normal
Tags: patch

The following kernel patch corrects the meaning of the contents of the 
sysfs battery status directory, but breaks the "time remaining" 
calculation in xfce4-battery-plugin.

current_now is should contain a value of the current being drawn at this 
instant, but in older kernels would contain whatever units the ACPI 
interface reported, which could be either current or power.

The attached patch fixes things, but may break existing installations 
with older kernels.


commit 558073dd56707864f09d563b64e7c37c021e89d2
Author: Alexey Starikovskiy <[EMAIL PROTECTED]>
Date:   Fri Nov 21 22:41:01 2008 +0800

    ACPI: battery: Convert discharge energy rate to current properly

    ACPI battery interface reports its state either in mW or in mA, and
    discharge rate in your case is reported in mW. power_supply interface
    does not have such a parameter, so current_now parameter is used
    for all cases. But in case of mW, reported discharge should
    be converted into mA.

    Signed-off-by: Alexey Starikovskiy <[EMAIL PROTECTED]>
    Tested-by: Ferenc Wagner <[EMAIL PROTECTED]>
    Signed-off-by: Len Brown <[EMAIL PROTECTED]>


-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (99, 
'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.28-rc7
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages xfce4-battery-plugin depends on:
ii  libatk1.0-0                   1.22.0-1   The ATK accessibility toolkit
ii  libc6                         2.7-16     GNU C Library: Shared libraries
ii  libcairo2                     1.6.4-6.1  The Cairo 2D vector graphics libra
ii  libglib2.0-0                  2.16.6-1   The GLib library of C routines
ii  libgtk2.0-0                   2.12.11-4  The GTK+ graphical user interface 
ii  libpango1.0-0                 1.20.5-3   Layout and rendering of internatio
ii  libxfce4util4                 4.4.2-3    Utility functions library for Xfce
ii  libxfcegui4-4                 4.4.2-4    Basic GUI C functions for Xfce4
ii  xfce4-panel                   4.4.2-6    The Xfce4 desktop environment pane

xfce4-battery-plugin recommends no packages.

xfce4-battery-plugin suggests no packages.

-- no debconf information
--- xfce4-battery-plugin-0.5.0.old/panel-plugin/libacpi.c	2008-12-02 21:58:22.195437494 +0000
+++ xfce4-battery-plugin-0.5.0/panel-plugin/libacpi.c	2008-12-02 21:56:43.200260028 +0000
@@ -726,6 +726,7 @@
 	DIR *sysfs;
 	struct dirent *propety;
 	char *name;
+	int energy_in_watts = 0;
 
 	sysfs = opendir(batteries[battery]);
 	if (sysfs == 0)
@@ -769,6 +770,9 @@
 			sprintf(buf,"%s/%s",batteries[battery], name);
 			acpistate->rcapacity = read_sysfs_int(buf);
 			acpistate->percentage = (((float) acpistate->rcapacity)/acpiinfo->last_full_capacity) * 100;
+			if (strcmp(name,"energy_now") == 0) {
+				energy_in_watts = 1;
+			}
 		}
 		if (strcmp(name,"current_now") == 0)
 		{
@@ -776,8 +780,6 @@
 			acpistate->prate = read_sysfs_int(buf);
 			if ( acpistate->prate < 0 )
 				acpistate->prate = 0;
-			if ( acpistate->prate > 0 )
-				acpistate->rtime = (((float) acpistate->rcapacity) / acpistate->prate) * 60;
 		}
 		if (strcmp(name,"voltage_now") == 0)
 		{
@@ -785,6 +787,14 @@
 			acpistate->pvoltage = read_sysfs_int(buf);
 		}
 	}
+
+	if ( acpistate->prate > 0 ) {
+		if (energy_in_watts) {
+			acpistate->prate = (((float) acpistate->prate) * ((float) acpistate->pvoltage) / 1000000.0);
+		}
+		acpistate->rtime = (((float) acpistate->rcapacity) / acpistate->prate) * 60;
+	}
+
 	closedir(sysfs);
 	return acpiinfo->present;
 }

--- End Message ---
--- Begin Message ---
On Tue, Dec 02, 2008 at 11:38:52PM +0100, Yves-Alexis Perez wrote:
> Don't hold your breath. At the time 2.6.28 enters Debian unstable, maybe

Linus has reverted the commit.

commit f10a3a32ae2edbe94920ce6827f4c2550eb6ed48
Author: Linus Torvalds <[EMAIL PROTECTED]>
Date:   Fri Dec 5 13:30:03 2008 -0800

    Revert "ACPI: battery: Convert discharge energy rate to current properly"

    This reverts commit 558073dd56707864f09d563b64e7c37c021e89d2, along with
    the failed try to fix the regression it caused ("ACPI: Fix ACPI battery
    regression introduced by commit 558073"), which just made things worse.

    Commit aaad077638be1a25871bcae5e43952d6b63abfca (that failed "Fix ACPI
    battery regression") got the voltage conversion confused, and fixed the
    problem with Rafael's battery monitor apparently just by mistake.

    So revert them both, getting us back to the 2.6.27 state in this, and
    let's revisit it when people understand what's going on.

    Noted-by: Paul Martin <[EMAIL PROTECTED]>
    Requested-by: Rafael J. Wysocki <[EMAIL PROTECTED]>
    Cc: Len Brown <[EMAIL PROTECTED]>
    Cc: Alexey Starikovskiy <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>


-- 
Paul Martin <[EMAIL PROTECTED]>

Attachment: signature.asc
Description: Digital signature


--- End Message ---
_______________________________________________
Pkg-xfce-devel mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/pkg-xfce-devel

Reply via email to