public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* Integrating OS power management with the X server
@ 2004-10-25 17:26 Nate Lawson
       [not found] ` <417D372C.3000107-Y6VGUYTwhu0@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Nate Lawson @ 2004-10-25 17:26 UTC (permalink / raw)
  To: xorg-CC+yJ3UmIYqDUpFQwHEjaQ; +Cc: Linux ACPI Developers

[-- Attachment #1: Type: text/plain, Size: 878 bytes --]

Apologies for cross-posting this to two lists.  I am the FreeBSD ACPI 
maintainer and recently someone brought to my attention that the X 
server expects notification/control over the suspend/resume process. 
This event is implemented in this file:

xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_apm.c

This interface works for apm (except that it only has NetBSD defines 
currently) but is not implemented for ACPI.  I'd like more information 
as to what the X server actually does with this event.  Is there any 
situation where it actually needs to veto a suspend?  Does it 
potentially take seconds to save state?  Does it need to access other 
running subsystems or is it self-contained?

I've started by adding some compat defines for FreeBSD, in the attached 
patch.  Please let me know more about the expected semantics of this 
event and any caveats.

Thanks,
Nate

[-- Attachment #2: bsd_apm.diff --]
[-- Type: text/plain, Size: 1153 bytes --]

--- bsd_apm.c.orig	Sat Oct  9 12:14:26 2004
+++ bsd_apm.c	Sat Oct  9 12:24:32 2004
@@ -8,12 +8,36 @@
 #include "xf86_OSproc.h"
 #include "xf86_OSlib.h"
 
+#ifdef __FreeBSD__
+#include <machine/apm_bios.h>
+#else
 #include <machine/apmvar.h>
+#endif
 
 #define APM_DEVICE "/dev/apm"
 
 static pointer APMihPtr = NULL;
 static void bsdCloseAPM(void);
+
+/* Compat defines for FreeBSD APM. */
+#ifdef __FreeBSD__
+#define APM_STANDBY_REQ		PMEV_STANDBYREQ
+#define APM_SUSPEND_REQ		PMEV_SUSPENDREQ
+#define APM_NORMAL_RESUME	PMEV_NORMALRESUME
+#define APM_CRIT_RESUME		PMEV_CRITRESUME
+#define APM_BATTERY_LOW		PMEV_BATTERYLOW
+#define APM_POWER_CHANGE	PMEV_POWERCHANGE
+#define APM_UPDATE_TIME		PMEV_UPDATETIME
+#define APM_CRIT_SUSPEND_REQ	PMEV_CRITSUSPENDREQ
+#define APM_USER_STANDBY_REQ	PMEV_USERSTANDBYREQ
+#define APM_USER_SUSPEND_REQ	PMEV_USERSUSPENDREQ
+#define APM_SYS_STANDBY_RESUME	PMEV_STANDBYRESUME
+#define APM_CAPABILITY_CHANGE	PMEV_CAPABILITIESCHANGE
+
+#define APM_IOC_NEXTEVENT	APMIO_NEXTEVENT
+#define APM_IOC_STANDBY		APMIO_STANDBY
+#define APM_IOC_SUSPEND		APMIO_SUSPEND
+#endif /* __FreeBSD__ */
 
 static struct {
     u_int apmBsd;

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-10-25 21:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-25 17:26 Integrating OS power management with the X server Nate Lawson
     [not found] ` <417D372C.3000107-Y6VGUYTwhu0@public.gmane.org>
2004-10-25 18:13   ` Matthew Garrett
2004-10-25 19:14     ` Nate Lawson
     [not found]       ` <417D509A.8040305-Y6VGUYTwhu0@public.gmane.org>
2004-10-25 21:17         ` Stefan Dösinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox