linux/drivers/gpu/drm/nouveau/core/os.h
Martin Peres 0083b91dac drm/nouveau/therm: implement support for temperature alarms
For now, we only boost the fan speed to the maximum and auto-mode
when hitting the FAN_BOOST threshold and halt the computer when it
reaches the shutdown temperature. The downclock and critical thresholds
do nothing.

On nv43:50 and nva3+, temperature is polled because of the limited hardware.
I'll improve the nva3+ situation by implementing alarm management in PDAEMON
whenever I can but polling once every second shouldn't be such a problem.

v2 (Ben Skeggs):
- rebased

v3: fixed false-detections and threshold reprogrammation handling on nv50:nvc0

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Martin Peres <martin.peres@labri.fr>
2013-02-20 16:00:23 +10:00

49 lines
1 KiB
C

#ifndef __NOUVEAU_OS_H__
#define __NOUVEAU_OS_H__
#include <linux/types.h>
#include <linux/slab.h>
#include <linux/mutex.h>
#include <linux/pci.h>
#include <linux/printk.h>
#include <linux/bitops.h>
#include <linux/firmware.h>
#include <linux/module.h>
#include <linux/i2c.h>
#include <linux/i2c-algo-bit.h>
#include <linux/delay.h>
#include <linux/io-mapping.h>
#include <linux/vmalloc.h>
#include <linux/acpi.h>
#include <linux/dmi.h>
#include <linux/reboot.h>
#include <asm/unaligned.h>
static inline int
ffsll(u64 mask)
{
int i;
for (i = 0; i < 64; i++) {
if (mask & (1ULL << i))
return i + 1;
}
return 0;
}
#ifndef ioread32_native
#ifdef __BIG_ENDIAN
#define ioread16_native ioread16be
#define iowrite16_native iowrite16be
#define ioread32_native ioread32be
#define iowrite32_native iowrite32be
#else /* def __BIG_ENDIAN */
#define ioread16_native ioread16
#define iowrite16_native iowrite16
#define ioread32_native ioread32
#define iowrite32_native iowrite32
#endif /* def __BIG_ENDIAN else */
#endif /* !ioread32_native */
#endif