Module Name: src Committed By: riastradh Date: Sun Dec 19 10:50:13 UTC 2021
Modified Files: src/sys/external/bsd/drm2/dist/drm/nouveau: nouveau_drm.c nouveau_drv.h nouveau_gem.c nouveau_led.h Log Message: Various tweaks to get nouveau_drm.c and nouveau_gem.c building. To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 \ src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.c cvs rdiff -u -r1.2 -r1.3 \ src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drv.h \ src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_led.h cvs rdiff -u -r1.12 -r1.13 \ src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_gem.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/dist/drm/nouveau/nouveau_drm.c diff -u src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.c:1.20 src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.c:1.21 --- src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.c:1.20 Sat Dec 18 23:45:32 2021 +++ src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drm.c Sun Dec 19 10:50:13 2021 @@ -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_accel_init(struct nouveau_drm *d nouveau_bo_move_init(drm); } -static int +int nouveau_drm_device_init(struct drm_device *dev) { struct nouveau_drm *drm; @@ -555,7 +555,7 @@ nouveau_drm_device_init(struct drm_devic { /* 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 @@ fail_alloc: return ret; } -static void +void nouveau_drm_device_fini(struct drm_device *dev) { struct nouveau_drm *drm = nouveau_drm(dev); @@ -909,8 +909,8 @@ nouveau_pmops_resume(struct device *dev) #ifndef __NetBSD__ struct pci_dev *pdev = to_pci_dev(dev); struct drm_device *drm_dev = pci_get_drvdata(pdev); - int ret; #endif + int ret; if (drm_dev->switch_power_state == DRM_SWITCH_POWER_OFF || drm_dev->switch_power_state == DRM_SWITCH_POWER_DYNAMIC_OFF) Index: src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drv.h diff -u src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drv.h:1.2 src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drv.h:1.3 --- src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drv.h:1.2 Sat Dec 18 23:45:32 2021 +++ src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drv.h Sun Dec 19 10:50:13 2021 @@ -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 @@ nouveau_drm_use_coherent_gpu_mapping(str } #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 Index: src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_led.h diff -u src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_led.h:1.2 src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_led.h:1.3 --- src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_led.h:1.2 Sat Dec 18 23:45:32 2021 +++ src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_led.h Sun Dec 19 10:50:13 2021 @@ -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 led_classdev; struct nouveau_led { struct drm_device *dev; +#if IS_REACHABLE(CONFIG_LEDS_CLASS) struct led_classdev led; +#endif }; static inline struct nouveau_led * Index: src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_gem.c diff -u src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_gem.c:1.12 src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_gem.c:1.13 --- src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_gem.c:1.12 Sat Dec 18 23:45:32 2021 +++ src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_gem.c Sun Dec 19 10:50:13 2021 @@ -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"