wok-current view xorg-xf86-video-intel/stuff/patch-src_sna_sna__acpi.c @ rev 25653

lzo needed from fsarchiver
author Hans-G?nter Theisgen
date Tue Feb 13 07:22:29 2024 +0100 (6 months ago)
parents
children
line source
1 $NetBSD$
3 --- a/src/sna/sna_acpi.c 2014-08-29 09:33:11.000000000 +0000
4 +++ b/src/sna/sna_acpi.c
5 @@ -92,7 +92,7 @@ void _sna_acpi_wakeup(struct sna *sna)
6 DBG(("%s: error [%d], detaching from acpid\n", __FUNCTION__, n));
8 /* XXX reattach later? */
9 - RemoveGeneralSocket(sna->acpi.fd);
10 + RemoveNotifyFd(sna->acpi.fd);
11 sna_acpi_fini(sna);
12 return;
13 }
14 @@ -136,6 +136,13 @@ void _sna_acpi_wakeup(struct sna *sna)
15 } while (n);
16 }
18 +#if HAVE_NOTIFY_FD
19 +static void sna_acpi_notify(int fd, int read, void *data)
20 +{
21 + _sna_acpi_wakeup(data);
22 +}
23 +#endif
24 +
25 static int read_power_state(const char *path)
26 {
27 DIR *dir;
28 @@ -200,7 +207,7 @@ void sna_acpi_init(struct sna *sna)
30 DBG(("%s: attaching to acpid\n", __FUNCTION__));
32 - AddGeneralSocket(sna->acpi.fd);
33 + SetNotifyFd(sna->acpi.fd, sna_acpi_notify, X_NOTIFY_READ, sna);
34 sna->acpi.remain = sizeof(sna->acpi.event) - 1;
35 sna->acpi.offset = 0;