Module Name:    src
Committed By:   mrg
Date:           Sun Apr 19 01:08:56 UTC 2015

Modified Files:
        src/sys/external/bsd/drm2/radeon: radeon_pci.c

Log Message:
apply some of the additional changes from Arto Huusko in PR#49645:
- call pmf_device_deregister on detach.

i've kept the "resume = true" for radeon_resume_kms() call as it
seems to work for me (indeed, code inspection shows it is unused
on netbsd :-)

my old nforce4 box that can resume old drm (or could, last i tried
several years ago) while X and GL apps were running, can at least
survive a resume if X hasn't started.  my one attempt so far with
X exited, but having run, did not work.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/external/bsd/drm2/radeon/radeon_pci.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/drm2/radeon/radeon_pci.c
diff -u src/sys/external/bsd/drm2/radeon/radeon_pci.c:1.8 src/sys/external/bsd/drm2/radeon/radeon_pci.c:1.9
--- src/sys/external/bsd/drm2/radeon/radeon_pci.c:1.8	Fri Apr 10 02:03:14 2015
+++ src/sys/external/bsd/drm2/radeon/radeon_pci.c	Sun Apr 19 01:08:56 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: radeon_pci.c,v 1.8 2015/04/10 02:03:14 mrg Exp $	*/
+/*	$NetBSD: radeon_pci.c,v 1.9 2015/04/19 01:08:56 mrg Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: radeon_pci.c,v 1.8 2015/04/10 02:03:14 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeon_pci.c,v 1.9 2015/04/19 01:08:56 mrg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "vga.h"
@@ -264,14 +264,14 @@ radeon_detach(device_t self, int flags)
 		return error;
 
 	if (sc->sc_task_state == RADEON_TASK_ATTACH)
-		return 0;
+		goto out;
 	if (sc->sc_task_u.workqueue != NULL) {
 		workqueue_destroy(sc->sc_task_u.workqueue);
 		sc->sc_task_u.workqueue = NULL;
 	}
 
 	if (sc->sc_drm_dev == NULL)
-		return 0;
+		goto out;
 	/* XXX errno Linux->NetBSD */
 	error = -drm_pci_detach(sc->sc_drm_dev, flags);
 	if (error)
@@ -279,6 +279,8 @@ radeon_detach(device_t self, int flags)
 		return error;
 	sc->sc_drm_dev = NULL;
 
+out:	pmf_device_deregister(self);
+
 	return 0;
 }
 
@@ -288,11 +290,12 @@ radeon_do_suspend(device_t self, const p
 	struct radeon_softc *const sc = device_private(self);
 	struct drm_device *const dev = sc->sc_drm_dev;
 	int ret;
+	bool is_console = true; /* XXX */
 
 	if (dev == NULL)
 		return true;
 
-	ret = radeon_suspend_kms(dev, true, true);
+	ret = radeon_suspend_kms(dev, true, is_console);
 	if (ret)
 		return false;
 
@@ -305,11 +308,12 @@ radeon_do_resume(device_t self, const pm
 	struct radeon_softc *const sc = device_private(self);
 	struct drm_device *const dev = sc->sc_drm_dev;
 	int ret;
+	bool is_console = true; /* XXX */
 
 	if (dev == NULL)
 		return true;
 
-	ret = radeon_resume_kms(dev, true, true);
+	ret = radeon_resume_kms(dev, true, is_console);
 	if (ret)
 		return false;
 

Reply via email to