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/dist/drm/nouveau Various tweaks to get...



details:   https://anonhg.NetBSD.org/src/rev/e5a8edd43034
branches:  trunk
changeset: 1028373:e5a8edd43034
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 10:50:13 2021 +0000

description:
Various tweaks to get nouveau_drm.c and nouveau_gem.c building.

diffstat:

 sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.c |  12 ++++++------
 sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drv.h |   4 +++-
 sys/external/bsd/drm2/dist/drm/nouveau/nouveau_gem.c |   6 ++++--
 sys/external/bsd/drm2/dist/drm/nouveau/nouveau_led.h |   4 +++-
 4 files changed, 16 insertions(+), 10 deletions(-)

diffs (112 lines):

diff -r f84ded478918 -r e5a8edd43034 sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.c
--- a/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.c      Sun Dec 19 10:50:03 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.c      Sun Dec 19 10:50:13 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nouveau_drm.c,v 1.20 2021/12/18 23:45:32 riastradh Exp $       */
+/*     $NetBSD: nouveau_drm.c,v 1.21 2021/12/19 10:50:13 riastradh Exp $       */
 
 /*
  * Copyright 2012 Red Hat Inc.
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nouveau_drm.c,v 1.20 2021/12/18 23:45:32 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_drm.c,v 1.21 2021/12/19 10:50:13 riastradh Exp $");
 
 #include <linux/console.h>
 #include <linux/delay.h>
@@ -515,7 +515,7 @@
        nouveau_bo_move_init(drm);
 }
 
-static int
+int
 nouveau_drm_device_init(struct drm_device *dev)
 {
        struct nouveau_drm *drm;
@@ -555,7 +555,7 @@
     {
        /* XXX Kludge to make register subregion mapping work.  */
        struct nvkm_client *client = nvxx_client(&drm->client.base);
-       struct nvkm_device *device = nvxx_device(&drm->device);
+       struct nvkm_device *device = nvxx_device(&drm->client.device);
        client->mmiot = device->mmiot;
        client->mmioh = device->mmioh;
        client->mmioaddr = device->mmioaddr;
@@ -618,7 +618,7 @@
        return ret;
 }
 
-static void
+void
 nouveau_drm_device_fini(struct drm_device *dev)
 {
        struct nouveau_drm *drm = nouveau_drm(dev);
@@ -909,8 +909,8 @@
 #ifndef __NetBSD__
        struct pci_dev *pdev = to_pci_dev(dev);
        struct drm_device *drm_dev = pci_get_drvdata(pdev);
+#endif
        int ret;
-#endif
 
        if (drm_dev->switch_power_state == DRM_SWITCH_POWER_OFF ||
            drm_dev->switch_power_state == DRM_SWITCH_POWER_DYNAMIC_OFF)
diff -r f84ded478918 -r e5a8edd43034 sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drv.h
--- a/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drv.h      Sun Dec 19 10:50:03 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drv.h      Sun Dec 19 10:50:13 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nouveau_drv.h,v 1.2 2021/12/18 23:45:32 riastradh Exp $        */
+/*     $NetBSD: nouveau_drv.h,v 1.3 2021/12/19 10:50:13 riastradh Exp $        */
 
 /* SPDX-License-Identifier: MIT */
 #ifndef __NOUVEAU_DRV_H__
@@ -242,6 +242,8 @@
 }
 
 #ifdef __NetBSD__
+int nouveau_drm_device_init(struct drm_device *);
+void nouveau_drm_device_fini(struct drm_device *);
 int nouveau_pmops_suspend(struct drm_device *);
 int nouveau_pmops_resume(struct drm_device *);
 #else
diff -r f84ded478918 -r e5a8edd43034 sys/external/bsd/drm2/dist/drm/nouveau/nouveau_gem.c
--- a/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_gem.c      Sun Dec 19 10:50:03 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_gem.c      Sun Dec 19 10:50:13 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nouveau_gem.c,v 1.12 2021/12/18 23:45:32 riastradh Exp $       */
+/*     $NetBSD: nouveau_gem.c,v 1.13 2021/12/19 10:50:13 riastradh Exp $       */
 
 /*
  * Copyright (C) 2008 Ben Skeggs.
@@ -27,7 +27,9 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nouveau_gem.c,v 1.12 2021/12/18 23:45:32 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_gem.c,v 1.13 2021/12/19 10:50:13 riastradh Exp $");
+
+#include <asm/uaccess.h>
 
 #include "nouveau_drv.h"
 #include "nouveau_dma.h"
diff -r f84ded478918 -r e5a8edd43034 sys/external/bsd/drm2/dist/drm/nouveau/nouveau_led.h
--- a/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_led.h      Sun Dec 19 10:50:03 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_led.h      Sun Dec 19 10:50:13 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nouveau_led.h,v 1.2 2021/12/18 23:45:32 riastradh Exp $        */
+/*     $NetBSD: nouveau_led.h,v 1.3 2021/12/19 10:50:13 riastradh Exp $        */
 
 /*
  * Copyright 2015 Martin Peres
@@ -34,7 +34,9 @@
 struct nouveau_led {
        struct drm_device *dev;
 
+#if IS_REACHABLE(CONFIG_LEDS_CLASS)
        struct led_classdev led;
+#endif
 };
 
 static inline struct nouveau_led *



Home | Main Index | Thread Index | Old Index