public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Nate Lawson <nate-Y6VGUYTwhu0@public.gmane.org>
To: xorg-CC+yJ3UmIYqDUpFQwHEjaQ@public.gmane.org
Cc: Linux ACPI Developers
	<acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
Subject: Integrating OS power management with the X server
Date: Mon, 25 Oct 2004 10:26:04 -0700	[thread overview]
Message-ID: <417D372C.3000107@root.org> (raw)

[-- 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;

             reply	other threads:[~2004-10-25 17:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-25 17:26 Nate Lawson [this message]
     [not found] ` <417D372C.3000107-Y6VGUYTwhu0@public.gmane.org>
2004-10-25 18:13   ` Integrating OS power management with the X server 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=417D372C.3000107@root.org \
    --to=nate-y6vguytwhu0@public.gmane.org \
    --cc=acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=xorg-CC+yJ3UmIYqDUpFQwHEjaQ@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox