Module Name:    src
Committed By:   joerg
Date:           Sat May  9 01:29:01 UTC 2009

Modified Files:
        src/sys/external/bsd/drm/dist/bsd-core: i915_drv.c

Log Message:
softc split as needed by the rest of the drm code. Add basic
suspend/resume hooks.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/drm/dist/bsd-core/i915_drv.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm/dist/bsd-core/i915_drv.c
diff -u src/sys/external/bsd/drm/dist/bsd-core/i915_drv.c:1.2 src/sys/external/bsd/drm/dist/bsd-core/i915_drv.c:1.3
--- src/sys/external/bsd/drm/dist/bsd-core/i915_drv.c:1.2	Sat Jul 19 06:18:23 2008
+++ src/sys/external/bsd/drm/dist/bsd-core/i915_drv.c	Sat May  9 01:29:01 2009
@@ -154,6 +154,24 @@
 #elif defined(__OpenBSD__)
 CFDRIVER_DECL(i915, DV_TTY, NULL);
 #elif defined(__NetBSD__)
+static bool
+i915drm_suspend(device_t self PMF_FN_ARGS)
+{
+	drm_device_t *dev = device_private(self);
+
+	i915_save_state(dev);
+	return true;	
+}
+
+static bool
+i915drm_resume(device_t self PMF_FN_ARGS)
+{
+	drm_device_t *dev = device_private(self);
+
+	i915_restore_state(dev);
+	return true;	
+}
+
 static int
 i915drm_probe(struct device *parent, struct cfdata *match, void *aux)
 {
@@ -165,16 +183,16 @@
 i915drm_attach(struct device *parent, struct device *self, void *aux)
 {
 	struct pci_attach_args *pa = aux;
-	drm_device_t *dev = (drm_device_t *)self;
+	drm_device_t *dev = device_private(self);
 
 	i915_configure(dev);
 
-	pmf_device_register(self, NULL, NULL);
+	pmf_device_register(self, i915drm_suspend, i915drm_resume);
 
 	drm_attach(self, pa, i915_pciidlist);
 }
 
-CFATTACH_DECL(i915drm, sizeof(drm_device_t), i915drm_probe, i915drm_attach,
+CFATTACH_DECL_NEW(i915drm, sizeof(drm_device_t), i915drm_probe, i915drm_attach,
 	drm_detach, drm_activate);
 
 #ifdef _MODULE

Reply via email to