Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2 Pass a sensible device state pointer t...



details:   https://anonhg.NetBSD.org/src/rev/5130ae8d1f29
branches:  trunk
changeset: 343522:5130ae8d1f29
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Thu Feb 11 04:51:44 2016 +0000

description:
Pass a sensible device state pointer to nouveau suspend/resume ops.

Gives nouveau half a chance of suspending and resuming -- not that it
works on my test laptop yet, but it's a start.

diffstat:

 sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.c |  22 ++++++++++---------
 sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.h |   5 ++++
 sys/external/bsd/drm2/nouveau/nouveau_pci.c          |  10 +++++---
 3 files changed, 23 insertions(+), 14 deletions(-)

diffs (109 lines):

diff -r e8dff3fe2d79 -r 5130ae8d1f29 sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.c
--- a/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.c      Thu Feb 11 04:43:32 2016 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.c      Thu Feb 11 04:51:44 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nouveau_drm.c,v 1.7 2015/10/27 13:21:18 riastradh Exp $        */
+/*     $NetBSD: nouveau_drm.c,v 1.8 2016/02/11 04:51:44 riastradh Exp $        */
 
 /*
  * Copyright 2012 Red Hat Inc.
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nouveau_drm.c,v 1.7 2015/10/27 13:21:18 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_drm.c,v 1.8 2016/02/11 04:51:44 riastradh Exp $");
 
 #include <linux/console.h>
 #include <linux/module.h>
@@ -612,12 +612,13 @@
        return ret;
 }
 
+#ifdef __NetBSD__
+int nouveau_pmops_suspend(struct drm_device *drm_dev)
+#else
 int nouveau_pmops_suspend(struct device *dev)
+#endif
 {
-#ifdef __NetBSD__
-       struct drm_device *drm_dev = device_private(dev);
-       struct pci_dev *pdev __unused = drm_dev->pdev;
-#else
+#ifndef __NetBSD__
        struct pci_dev *pdev = to_pci_dev(dev);
        struct drm_device *drm_dev = pci_get_drvdata(pdev);
 #endif
@@ -674,12 +675,13 @@
        return 0;
 }
 
+#ifdef __NetBSD__
+int nouveau_pmops_resume(struct drm_device *drm_dev)
+#else
 int nouveau_pmops_resume(struct device *dev)
+#endif
 {
-#ifdef __NetBSD__
-       struct drm_device *drm_dev = device_private(dev);
-       struct pci_dev *pdev __unused = drm_dev->pdev;
-#else
+#ifndef __NetBSD__
        struct pci_dev *pdev = to_pci_dev(dev);
        struct drm_device *drm_dev = pci_get_drvdata(pdev);
 #endif
diff -r e8dff3fe2d79 -r 5130ae8d1f29 sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.h
--- a/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.h      Thu Feb 11 04:43:32 2016 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.h      Thu Feb 11 04:51:44 2016 +0000
@@ -160,8 +160,13 @@
        return nv_device(nouveau_drm(dev)->device);
 }
 
+#ifdef __NetBSD__
+int nouveau_pmops_suspend(struct drm_device *);
+int nouveau_pmops_resume(struct drm_device *);
+#else
 int nouveau_pmops_suspend(struct device *);
 int nouveau_pmops_resume(struct device *);
+#endif
 
 #define NV_FATAL(cli, fmt, args...) nv_fatal((cli), fmt, ##args)
 #define NV_ERROR(cli, fmt, args...) nv_error((cli), fmt, ##args)
diff -r e8dff3fe2d79 -r 5130ae8d1f29 sys/external/bsd/drm2/nouveau/nouveau_pci.c
--- a/sys/external/bsd/drm2/nouveau/nouveau_pci.c       Thu Feb 11 04:43:32 2016 +0000
+++ b/sys/external/bsd/drm2/nouveau/nouveau_pci.c       Thu Feb 11 04:51:44 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nouveau_pci.c,v 1.6 2015/10/27 21:46:42 mrg Exp $      */
+/*     $NetBSD: nouveau_pci.c,v 1.7 2016/02/11 04:51:44 riastradh Exp $        */
 
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nouveau_pci.c,v 1.6 2015/10/27 21:46:42 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_pci.c,v 1.7 2016/02/11 04:51:44 riastradh Exp $");
 
 #include <sys/types.h>
 #include <sys/device.h>
@@ -208,15 +208,17 @@
 static bool
 nouveau_pci_suspend(device_t self, const pmf_qual_t *qual __unused)
 {
+       struct nouveau_pci_softc *const sc = device_private(self);
 
-       return nouveau_pmops_suspend(self) == 0;
+       return nouveau_pmops_suspend(sc->sc_drm_dev) == 0;
 }
 
 static bool
 nouveau_pci_resume(device_t self, const pmf_qual_t *qual)
 {
+       struct nouveau_pci_softc *const sc = device_private(self);
 
-       return nouveau_pmops_resume(self) == 0;
+       return nouveau_pmops_resume(sc->sc_drm_dev) == 0;
 }
 
 static void



Home | Main Index | Thread Index | Old Index