CVS commit: src/sys/external/bsd/drm2/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 10:40:04 UTC 2021 Modified Files: src/sys/external/bsd/drm2/include/linux: backlight.h Log Message: Backlight enable/disable stubs. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/drm2/include/linux/backlight.h 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/include/linux/backlight.h diff -u src/sys/external/bsd/drm2/include/linux/backlight.h:1.2 src/sys/external/bsd/drm2/include/linux/backlight.h:1.3 --- src/sys/external/bsd/drm2/include/linux/backlight.h:1.2 Tue Mar 18 18:20:43 2014 +++ src/sys/external/bsd/drm2/include/linux/backlight.h Sun Dec 19 10:40:03 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: backlight.h,v 1.2 2014/03/18 18:20:43 riastradh Exp $ */ +/* $NetBSD: backlight.h,v 1.3 2021/12/19 10:40:03 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -32,4 +32,12 @@ #ifndef _LINUX_BACKLIGHT_H_ #define _LINUX_BACKLIGHT_H_ +struct backlight_device; + +#define backlight_disable linux_backlight_disable +#define backlight_enable linux_backlight_enable + +int backlight_disable(struct backlight_device *); +int backlight_enable(struct backlight_device *); + #endif /* _LINUX_BACKLIGHT_H_ */
CVS commit: src/sys/external/bsd/drm2/drm
Module Name:src Committed By: riastradh Date: Sun Dec 19 10:39:57 UTC 2021 Modified Files: src/sys/external/bsd/drm2/drm: files.drmkms Log Message: Rerun drm2netbsd and merge. New tag drmums for the legacy stuff; to deal with later for via. To generate a diff of this commit: cvs rdiff -u -r1.57 -r1.58 src/sys/external/bsd/drm2/drm/files.drmkms Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/drm2/drm
Module Name:src Committed By: riastradh Date: Sun Dec 19 10:39:57 UTC 2021 Modified Files: src/sys/external/bsd/drm2/drm: files.drmkms Log Message: Rerun drm2netbsd and merge. New tag drmums for the legacy stuff; to deal with later for via. To generate a diff of this commit: cvs rdiff -u -r1.57 -r1.58 src/sys/external/bsd/drm2/drm/files.drmkms 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/drm/files.drmkms diff -u src/sys/external/bsd/drm2/drm/files.drmkms:1.57 src/sys/external/bsd/drm2/drm/files.drmkms:1.58 --- src/sys/external/bsd/drm2/drm/files.drmkms:1.57 Sun Dec 19 10:32:47 2021 +++ src/sys/external/bsd/drm2/drm/files.drmkms Sun Dec 19 10:39:57 2021 @@ -1,4 +1,4 @@ -# $NetBSD: files.drmkms,v 1.57 2021/12/19 10:32:47 riastradh Exp $ +# $NetBSD: files.drmkms,v 1.58 2021/12/19 10:39:57 riastradh Exp $ version 20180827 @@ -55,19 +55,10 @@ makeoptions drmkms "CWARNFLAGS.drmkms"+= # NetBSD additions. file external/bsd/drm2/drm/drm_agp_hook.c drmkms file external/bsd/drm2/drm/drm_cdevsw.c drmkms -file external/bsd/drm2/drm/drm_gem_cma_helper.c drmkms file external/bsd/drm2/drm/drm_gem_vm.c drmkms file external/bsd/drm2/drm/drm_module.c drmkms +file external/bsd/drm2/drm/drm_stub.c !drmkms & !drmbase file external/bsd/drm2/drm/drm_sysctl.c drmkms -file external/bsd/drm2/drm/drm_cache.c drmkms -file external/bsd/drm2/drm/drm_file.c drmkms -file external/bsd/drm2/drm/drm_gem_framebuffer_helper.c drmkms -file external/bsd/drm2/drm/drm_scatter.c drmkms -file external/bsd/drm2/drm/drm_stub.c !drmkms & !drmbase -file external/bsd/drm2/drm/drm_sysfs.c drmkms -file external/bsd/drm2/drm/drm_vm.c drmkms -file external/bsd/drm2/drm/drm_vma_manager.c drmkms -file external/bsd/drm2/i2c/drm_encoder_slave.c drmkms # Generic, unaccelerated kms framebuffer. define drmfb: genfb @@ -87,6 +78,16 @@ makeoptions drmkms "CWARNFLAGS.drm_edi makeoptions drmkms "CWARNFLAGS.drm_ioctl.c"+="-Wno-shadow" makeoptions drmkms "CWARNFLAGS.drm_modes.c"+="-Wno-shadow" +# Legacy user-mode setting +define drmums: drmkms +makeoptions drmums CPPFLAGS+="-DCONFIG_DRM_LEGACY" +file external/bsd/drm2/dist/drm/drm_bufs.c drmums +file external/bsd/drm2/dist/drm/drm_context.c drmums +file external/bsd/drm2/dist/drm/drm_dma.c drmums +file external/bsd/drm2/dist/drm/drm_legacy_misc.c drmums +file external/bsd/drm2/dist/drm/drm_lock.c drmums +file external/bsd/drm2/drm/drm_scatter.c drmums + # Generated from drm2netbsd. #file external/bsd/drm2/dist/drm/drm_agpsupport.c drmkms # drmkms_pci file external/bsd/drm2/dist/drm/drm_atomic.c drmkms @@ -96,7 +97,7 @@ file external/bsd/drm2/dist/drm/drm_atom file external/bsd/drm2/dist/drm/drm_auth.c drmkms file external/bsd/drm2/dist/drm/drm_blend.c drmkms file external/bsd/drm2/dist/drm/drm_bridge.c drmkms -#file external/bsd/drm2/dist/drm/drm_cache.c drmkms +file external/bsd/drm2/drm/drm_cache.c drmkms #file external/bsd/drm2/dist/drm/drm_client.c drmkms file external/bsd/drm2/dist/drm/drm_client_modeset.c drmkms file external/bsd/drm2/dist/drm/drm_color_mgmt.c drmkms @@ -112,15 +113,16 @@ file external/bsd/drm2/dist/drm/drm_dsc. file external/bsd/drm2/dist/drm/drm_dumb_buffers.c drmkms file external/bsd/drm2/dist/drm/drm_edid.c drmkms file external/bsd/drm2/dist/drm/drm_encoder.c drmkms -#file external/bsd/drm2/dist/drm/drm_encoder_slave.c drmkms +file external/bsd/drm2/i2c/drm_encoder_slave.c drmkms file external/bsd/drm2/dist/drm/drm_fb_helper.c drmkms -#file external/bsd/drm2/dist/drm/drm_file.c drmkms +file external/bsd/drm2/drm/drm_file.c drmkms file external/bsd/drm2/dist/drm/drm_flip_work.c drmkms #file external/bsd/drm2/dist/drm/drm_format_helper.c drmkms file external/bsd/drm2/dist/drm/drm_fourcc.c drmkms file external/bsd/drm2/dist/drm/drm_framebuffer.c drmkms file external/bsd/drm2/dist/drm/drm_gem.c drmkms -#file external/bsd/drm2/dist/drm/drm_gem_framebuffer_helper.c drmkms +file external/bsd/drm2/drm/drm_gem_cma_helper.c drmkms +file external/bsd/drm2/drm/drm_gem_framebuffer_helper.c drmkms file external/bsd/drm2/dist/drm/drm_hashtab.c drmkms #file external/bsd/drm2/dist/drm/drm_hdcp.c drmkms file external/bsd/drm2/dist/drm/drm_ioctl.c drmkms @@ -134,6 +136,7 @@ file external/bsd/drm2/dist/drm/drm_mode file external/bsd/drm2/dist/drm/drm_modes.c drmkms file external/bsd/drm2/dist/drm/drm_modeset_helper.c drmkms file external/bsd/drm2/dist/drm/drm_modeset_lock.c drmkms +file external/bsd/drm2/dist/drm/drm_panel.c drmkms #file external/bsd/drm2/dist/drm/drm_pci.c drmkms # drmkms_pci file external/bsd/drm2/dist/drm/drm_plane.c drmkms file external/bsd/drm2/dist/drm/drm_plane_helper.c drmkms @@ -146,9 +149,9 @@ file external/bsd/drm2/dist/drm/drm_scdc file external/bsd/drm2/dist/drm/drm_self_refresh_helper.c drmkms #file external/bsd/drm2/dist/drm/drm_simple_kms_helper.c drmkms file
CVS commit: src/sys/external/bsd/drm2/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 10:40:04 UTC 2021 Modified Files: src/sys/external/bsd/drm2/include/linux: backlight.h Log Message: Backlight enable/disable stubs. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/drm2/include/linux/backlight.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/drm2/drm
Module Name:src Committed By: riastradh Date: Sun Dec 19 10:39:49 UTC 2021 Modified Files: src/sys/external/bsd/drm2/drm: drm2netbsd Log Message: Add a couple more make variables. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/external/bsd/drm2/drm/drm2netbsd Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/drm2/drm
Module Name:src Committed By: riastradh Date: Sun Dec 19 10:39:49 UTC 2021 Modified Files: src/sys/external/bsd/drm2/drm: drm2netbsd Log Message: Add a couple more make variables. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/external/bsd/drm2/drm/drm2netbsd 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/drm/drm2netbsd diff -u src/sys/external/bsd/drm2/drm/drm2netbsd:1.3 src/sys/external/bsd/drm2/drm/drm2netbsd:1.4 --- src/sys/external/bsd/drm2/drm/drm2netbsd:1.3 Sun Dec 19 00:25:13 2021 +++ src/sys/external/bsd/drm2/drm/drm2netbsd Sun Dec 19 10:39:49 2021 @@ -1,6 +1,6 @@ #!/bin/sh -# $NetBSD: drm2netbsd,v 1.3 2021/12/19 00:25:13 riastradh Exp $ +# $NetBSD: drm2netbsd,v 1.4 2021/12/19 10:39:49 riastradh Exp $ # # $ /path/to/drm2netbsd > /path/to/files.drm.new # @@ -17,6 +17,8 @@ drmkms_flag=drmkms env CONFIG_PCI=y \ env CONFIG_AGP=y \ env CONFIG_DRM_FBDEV_EMULATION=y \ +env CONFIG_DRM_GEM_CMA_HELPER=y \ +env CONFIG_DRM_PANEL=y \ env CONFIG_DRM_VM=y \ make -f Makefile -V '$(drm-y)' -V '$(drm_kms_helper-y)' \ | tr ' ' '\n' \
CVS commit: src/sys/external/bsd/drm2/drm
Module Name:src Committed By: riastradh Date: Sun Dec 19 10:39:42 UTC 2021 Modified Files: src/sys/external/bsd/drm2/drm: drm_sysfs.c Log Message: Restore drm_sysfs_connector_add/remove stubs. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/external/bsd/drm2/drm/drm_sysfs.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/drm2/drm
Module Name:src Committed By: riastradh Date: Sun Dec 19 10:39:42 UTC 2021 Modified Files: src/sys/external/bsd/drm2/drm: drm_sysfs.c Log Message: Restore drm_sysfs_connector_add/remove stubs. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/external/bsd/drm2/drm/drm_sysfs.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/drm/drm_sysfs.c diff -u src/sys/external/bsd/drm2/drm/drm_sysfs.c:1.7 src/sys/external/bsd/drm2/drm/drm_sysfs.c:1.8 --- src/sys/external/bsd/drm2/drm/drm_sysfs.c:1.7 Sun Dec 19 10:35:52 2021 +++ src/sys/external/bsd/drm2/drm/drm_sysfs.c Sun Dec 19 10:39:42 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: drm_sysfs.c,v 1.7 2021/12/19 10:35:52 riastradh Exp $ */ +/* $NetBSD: drm_sysfs.c,v 1.8 2021/12/19 10:39:42 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -30,10 +30,23 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: drm_sysfs.c,v 1.7 2021/12/19 10:35:52 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: drm_sysfs.c,v 1.8 2021/12/19 10:39:42 riastradh Exp $"); #include +#include "../dist/drm/drm_internal.h" + +int +drm_sysfs_connector_add(struct drm_connector *connector) +{ + return 0; +} + +void +drm_sysfs_connector_remove(struct drm_connector *connector) +{ +} + void drm_sysfs_hotplug_event(struct drm_device *dev) {
CVS commit: src/sys/external/bsd/drm2
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:05:13 UTC 2021 Modified Files: src/sys/external/bsd/drm2/amdgpu: amdgpu_pci.c src/sys/external/bsd/drm2/dist/include/drm: drm_pci.h src/sys/external/bsd/drm2/i915drm: i915_pci_autoconf.c src/sys/external/bsd/drm2/nouveau: nouveau_pci.c src/sys/external/bsd/drm2/pci: drm_pci.c src/sys/external/bsd/drm2/radeon: radeon_pci.c Log Message: Split drm_dev_alloc/register out of drm_pci_attach. Needed by nouveau which needs to do drm_dev_alloc drm_pci_attach nouveau_drm_device_init drm_dev_register To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/external/bsd/drm2/amdgpu/amdgpu_pci.c cvs rdiff -u -r1.6 -r1.7 src/sys/external/bsd/drm2/dist/include/drm/drm_pci.h cvs rdiff -u -r1.3 -r1.4 \ src/sys/external/bsd/drm2/i915drm/i915_pci_autoconf.c cvs rdiff -u -r1.29 -r1.30 src/sys/external/bsd/drm2/nouveau/nouveau_pci.c cvs rdiff -u -r1.43 -r1.44 src/sys/external/bsd/drm2/pci/drm_pci.c cvs rdiff -u -r1.17 -r1.18 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/amdgpu/amdgpu_pci.c diff -u src/sys/external/bsd/drm2/amdgpu/amdgpu_pci.c:1.6 src/sys/external/bsd/drm2/amdgpu/amdgpu_pci.c:1.7 --- src/sys/external/bsd/drm2/amdgpu/amdgpu_pci.c:1.6 Sun Dec 19 10:32:59 2021 +++ src/sys/external/bsd/drm2/amdgpu/amdgpu_pci.c Sun Dec 19 11:05:12 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: amdgpu_pci.c,v 1.6 2021/12/19 10:32:59 riastradh Exp $ */ +/* $NetBSD: amdgpu_pci.c,v 1.7 2021/12/19 11:05:12 riastradh Exp $ */ /*- * Copyright (c) 2018 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: amdgpu_pci.c,v 1.6 2021/12/19 10:32:59 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: amdgpu_pci.c,v 1.7 2021/12/19 11:05:12 riastradh Exp $"); #include #include @@ -58,6 +58,8 @@ struct amdgpu_softc { }sc_task_u; struct drm_device *sc_drm_dev; struct pci_dev sc_pci_dev; + boolsc_pci_attached; + boolsc_dev_registered; }; static bool amdgpu_pci_lookup(const struct pci_attach_args *, @@ -159,13 +161,29 @@ amdgpu_attach_real(device_t self) /* Initialize the Linux PCI device descriptor. */ linux_pci_dev_init(>sc_pci_dev, self, device_parent(self), pa, 0); + sc->sc_drm_dev = drm_dev_alloc(amdgpu_drm_driver, self); + if (IS_ERR(sc->sc_drm_dev)) { + aprint_error_dev(self, "unable to create drm device: %ld\n", + PTR_ERR(sc->sc_drm_dev)); + sc->sc_drm_dev = NULL; + goto out; + } + /* XXX errno Linux->NetBSD */ - error = -drm_pci_attach(self, pa, >sc_pci_dev, amdgpu_drm_driver, - flags, >sc_drm_dev); + error = -drm_pci_attach(sc->sc_drm_dev, pa, >sc_pci_dev); if (error) { aprint_error_dev(self, "unable to attach drm: %d\n", error); goto out; } + sc->sc_pci_attached = true; + + /* XXX errno Linux->NetBSD */ + error = -drm_dev_register(sc->sc_drm_dev, flags); + if (error) { + aprint_error_dev(self, "unable to register drm: %d\n", error); + return; + } + sc->sc_dev_registered = true; while (!SIMPLEQ_EMPTY(>sc_task_u.attach)) { struct amdgpu_task *const task = @@ -211,17 +229,18 @@ amdgpu_detach(device_t self, int flags) } if (sc->sc_drm_dev == NULL) - goto out; - /* XXX errno Linux->NetBSD */ - error = -drm_pci_detach(sc->sc_drm_dev, flags); - if (error) - /* XXX Kinda too late to fail now... */ - return error; + goto out0; + if (!sc->sc_pci_attached) + goto out1; + if (!sc->sc_dev_registered) + goto out2; + + drm_dev_unregister(sc->sc_drm_dev); +out2: drm_pci_detach(sc->sc_drm_dev); +out1: drm_dev_put(sc->sc_drm_dev); sc->sc_drm_dev = NULL; - -out: linux_pci_dev_destroy(>sc_pci_dev); +out0: linux_pci_dev_destroy(>sc_pci_dev); pmf_device_deregister(self); - return 0; } Index: src/sys/external/bsd/drm2/dist/include/drm/drm_pci.h diff -u src/sys/external/bsd/drm2/dist/include/drm/drm_pci.h:1.6 src/sys/external/bsd/drm2/dist/include/drm/drm_pci.h:1.7 --- src/sys/external/bsd/drm2/dist/include/drm/drm_pci.h:1.6 Sun Dec 19 10:51:39 2021 +++ src/sys/external/bsd/drm2/dist/include/drm/drm_pci.h Sun Dec 19 11:05:12 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: drm_pci.h,v 1.6 2021/12/19 10:51:39 riastradh Exp $ */ +/* $NetBSD: drm_pci.h,v 1.7 2021/12/19 11:05:12 riastradh Exp $ */ /* * Internal Header for the Direct Rendering Manager @@ -76,10 +76,9 @@ static inline int drm_get_pci_dev(struct #ifdef __NetBSD__ int drm_pci_request_irq(struct drm_device *, int); void drm_pci_free_irq(struct drm_device *); -extern int drm_pci_attach(device_t, const struct pci_attach_args *, -struct pci_dev *, struct drm_driver *, unsigned long, -struct drm_device **); -extern int drm_pci_detach(struct drm_device *, int); +int drm_pci_attach(struct drm_device *, const struct pci_attach_args *, +struct pci_dev *); +void drm_pci_detach(struct
CVS commit: src/sys/external/bsd/drm2/nouveau
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:05:20 UTC 2021 Modified Files: src/sys/external/bsd/drm2/nouveau: nouveau_pci.c Log Message: nouveau: Call nouveau_drm_device_init. To generate a diff of this commit: cvs rdiff -u -r1.30 -r1.31 src/sys/external/bsd/drm2/nouveau/nouveau_pci.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/drm2/nouveau
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:05:20 UTC 2021 Modified Files: src/sys/external/bsd/drm2/nouveau: nouveau_pci.c Log Message: nouveau: Call nouveau_drm_device_init. To generate a diff of this commit: cvs rdiff -u -r1.30 -r1.31 src/sys/external/bsd/drm2/nouveau/nouveau_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/nouveau/nouveau_pci.c diff -u src/sys/external/bsd/drm2/nouveau/nouveau_pci.c:1.30 src/sys/external/bsd/drm2/nouveau/nouveau_pci.c:1.31 --- src/sys/external/bsd/drm2/nouveau/nouveau_pci.c:1.30 Sun Dec 19 11:05:13 2021 +++ src/sys/external/bsd/drm2/nouveau/nouveau_pci.c Sun Dec 19 11:05:20 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: nouveau_pci.c,v 1.30 2021/12/19 11:05:13 riastradh Exp $ */ +/* $NetBSD: nouveau_pci.c,v 1.31 2021/12/19 11:05:20 riastradh Exp $ */ /*- * Copyright (c) 2015 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: nouveau_pci.c,v 1.30 2021/12/19 11:05:13 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: nouveau_pci.c,v 1.31 2021/12/19 11:05:20 riastradh Exp $"); #ifdef _KERNEL_OPT #if defined(__arm__) || defined(__aarch64__) @@ -223,6 +223,13 @@ nouveau_pci_attach_real(device_t self) sc->sc_pci_attached = true; /* XXX errno Linux->NetBSD */ + error = -nouveau_drm_device_init(sc->sc_drm_dev); + if (error) { + aprint_error_dev(self, "unable to init nouveau: %d\n", error); + return; + } + + /* XXX errno Linux->NetBSD */ error = -drm_dev_register(sc->sc_drm_dev, 0); if (error) { aprint_error_dev(self, "unable to register drm: %d\n", error);
CVS commit: src/sys/external/bsd/drm2/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:05:27 UTC 2021 Modified Files: src/sys/external/bsd/drm2/include/linux: irq_work.h Log Message: Match linux which is side-loading linux/irq_work.h-> asm/irq_work.h-> asm/cpufeature.h Avoids errors on static_cpu_has Author: Maya Rashish Committer: Taylor R Campbell To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/drm2/include/linux/irq_work.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/drm2/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:05:27 UTC 2021 Modified Files: src/sys/external/bsd/drm2/include/linux: irq_work.h Log Message: Match linux which is side-loading linux/irq_work.h-> asm/irq_work.h-> asm/cpufeature.h Avoids errors on static_cpu_has Author: Maya Rashish Committer: Taylor R Campbell To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/drm2/include/linux/irq_work.h 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/include/linux/irq_work.h diff -u src/sys/external/bsd/drm2/include/linux/irq_work.h:1.2 src/sys/external/bsd/drm2/include/linux/irq_work.h:1.3 --- src/sys/external/bsd/drm2/include/linux/irq_work.h:1.2 Sun Dec 19 11:04:36 2021 +++ src/sys/external/bsd/drm2/include/linux/irq_work.h Sun Dec 19 11:05:27 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: irq_work.h,v 1.2 2021/12/19 11:04:36 riastradh Exp $ */ +/* $NetBSD: irq_work.h,v 1.3 2021/12/19 11:05:27 riastradh Exp $ */ /*- * Copyright (c) 2020 The NetBSD Foundation, Inc. @@ -31,6 +31,8 @@ #include +#include + /* namespace */ #define init_irq_work linux_init_irq_work #define irq_work_queue linux_irq_work_queue
CVS commit: src/sys/external/bsd/drm2/i915drm
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:05:33 UTC 2021 Modified Files: src/sys/external/bsd/drm2/i915drm: files.i915drmkms Log Message: define CONFIG values to be the same as linux Author: Maya Rashish Committer: Taylor R Campbell To generate a diff of this commit: cvs rdiff -u -r1.59 -r1.60 src/sys/external/bsd/drm2/i915drm/files.i915drmkms Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/drm2/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:04:50 UTC 2021 Modified Files: src/sys/external/bsd/drm2/linux: linux_dma_fence.c Log Message: Fix typo. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/sys/external/bsd/drm2/linux/linux_dma_fence.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/linux/linux_dma_fence.c diff -u src/sys/external/bsd/drm2/linux/linux_dma_fence.c:1.12 src/sys/external/bsd/drm2/linux/linux_dma_fence.c:1.13 --- src/sys/external/bsd/drm2/linux/linux_dma_fence.c:1.12 Sun Dec 19 11:03:57 2021 +++ src/sys/external/bsd/drm2/linux/linux_dma_fence.c Sun Dec 19 11:04:50 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_dma_fence.c,v 1.12 2021/12/19 11:03:57 riastradh Exp $ */ +/* $NetBSD: linux_dma_fence.c,v 1.13 2021/12/19 11:04:50 riastradh Exp $ */ /*- * Copyright (c) 2018 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: linux_dma_fence.c,v 1.12 2021/12/19 11:03:57 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_dma_fence.c,v 1.13 2021/12/19 11:04:50 riastradh Exp $"); #include #include @@ -613,8 +613,8 @@ wait_any_cb(struct dma_fence *fence, str * dma_fence_wait_any_timeout(fence, nfences, intr, timeout, ip) * * Wait for any of fences[0], fences[1], fences[2], ..., - * fences[nfences-1] to be signaled. If ip is nonnull, set *ip to - * the index of the first one. + * fences[nfences-1] to be signalled. If ip is nonnull, set *ip + * to the index of the first one. */ long dma_fence_wait_any_timeout(struct dma_fence **fences, uint32_t nfences,
CVS commit: src/sys/external/bsd/common/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:04:58 UTC 2021 Modified Files: src/sys/external/bsd/common/linux: linux_tasklet.c Log Message: Fix membars in tasklet_disable/enable. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/external/bsd/common/linux/linux_tasklet.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/common/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:04:58 UTC 2021 Modified Files: src/sys/external/bsd/common/linux: linux_tasklet.c Log Message: Fix membars in tasklet_disable/enable. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/external/bsd/common/linux/linux_tasklet.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/common/linux/linux_tasklet.c diff -u src/sys/external/bsd/common/linux/linux_tasklet.c:1.5 src/sys/external/bsd/common/linux/linux_tasklet.c:1.6 --- src/sys/external/bsd/common/linux/linux_tasklet.c:1.5 Sun Dec 19 11:03:18 2021 +++ src/sys/external/bsd/common/linux/linux_tasklet.c Sun Dec 19 11:04:58 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_tasklet.c,v 1.5 2021/12/19 11:03:18 riastradh Exp $ */ +/* $NetBSD: linux_tasklet.c,v 1.6 2021/12/19 11:04:58 riastradh Exp $ */ /*- * Copyright (c) 2018, 2020 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: linux_tasklet.c,v 1.5 2021/12/19 11:03:18 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_tasklet.c,v 1.6 2021/12/19 11:04:58 riastradh Exp $"); #include #include @@ -373,6 +373,11 @@ tasklet_disable(struct tasklet_struct *t KASSERT(disablecount < UINT_MAX); KASSERT(disablecount != 0); + /* Pairs with membar_exit in __tasklet_enable. */ +#ifndef __HAVE_ATOMIC_AS_MEMBAR + membar_enter(); +#endif + /* Wait for it to finish running, if it was running. */ tasklet_unlock_wait(tasklet); } @@ -457,13 +462,17 @@ tasklet_trylock(struct tasklet_struct *t unsigned state; do { - /* Pairs with membar_exit in tasklet_unlock. */ - state = atomic_load_acquire(>tl_state); + state = atomic_load_relaxed(>tl_state); if (state & TASKLET_RUNNING) return false; } while (atomic_cas_uint(>tl_state, state, state | TASKLET_RUNNING) != state); + /* Pairs with membar_exit in tasklet_unlock. */ +#ifndef __HAVE_ATOMIC_AS_MEMBAR + membar_enter(); +#endif + return true; } @@ -481,8 +490,8 @@ tasklet_unlock(struct tasklet_struct *ta KASSERT(atomic_load_relaxed(>tl_state) & TASKLET_RUNNING); /* - * Pairs with atomic_load_acquire in tasklet_trylock and - * tasklet_unlock. + * Pairs with membar_enter in tasklet_trylock and with + * atomic_load_acquire in tasklet_unlock_wait. */ #ifndef __HAVE_ATOMIC_AS_MEMBAR membar_exit(); @@ -534,6 +543,11 @@ __tasklet_disable_sync_once(struct taskl KASSERT(disablecount < UINT_MAX); KASSERT(disablecount != 0); + /* Pairs with membar_exit in __tasklet_enable_sync_once. */ +#ifndef __HAVE_ATOMIC_AS_MEMBAR + membar_enter(); +#endif + /* * If it was zero, wait for it to finish running. If it was * not zero, caller must not care whether it was running. @@ -553,6 +567,11 @@ __tasklet_enable_sync_once(struct taskle { unsigned int disablecount; + /* Pairs with membar_enter in __tasklet_disable_sync_once. */ +#ifndef __HAVE_ATOMIC_AS_MEMBAR + membar_exit(); +#endif + /* Decrement the disable count. */ disablecount = atomic_dec_uint_nv(>tl_disablecount); KASSERT(disablecount < UINT_MAX); @@ -615,8 +634,8 @@ __tasklet_enable(struct tasklet_struct * * before potentially allowing tasklet to run again by * decrementing the disable count. * - * Pairs with atomic_load_acquire(>tl_disablecount) in - * tasklet_softintr. + * Pairs with atomic_load_acquire in tasklet_softintr and with + * membar_enter in tasklet_disable. */ #ifndef __HAVE_ATOMIC_AS_MEMBAR membar_exit();
CVS commit: src/sys/external/bsd/drm2/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:05:05 UTC 2021 Modified Files: src/sys/external/bsd/drm2/include/linux: lockdep.h Log Message: Add some missing includes in linux/lockdep.h. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/external/bsd/drm2/include/linux/lockdep.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/drm2/i915drm
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:05:33 UTC 2021 Modified Files: src/sys/external/bsd/drm2/i915drm: files.i915drmkms Log Message: define CONFIG values to be the same as linux Author: Maya Rashish Committer: Taylor R Campbell To generate a diff of this commit: cvs rdiff -u -r1.59 -r1.60 src/sys/external/bsd/drm2/i915drm/files.i915drmkms 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/i915drm/files.i915drmkms diff -u src/sys/external/bsd/drm2/i915drm/files.i915drmkms:1.59 src/sys/external/bsd/drm2/i915drm/files.i915drmkms:1.60 --- src/sys/external/bsd/drm2/i915drm/files.i915drmkms:1.59 Sun Dec 19 11:01:53 2021 +++ src/sys/external/bsd/drm2/i915drm/files.i915drmkms Sun Dec 19 11:05:33 2021 @@ -1,4 +1,4 @@ -# $NetBSD: files.i915drmkms,v 1.59 2021/12/19 11:01:53 riastradh Exp $ +# $NetBSD: files.i915drmkms,v 1.60 2021/12/19 11:05:33 riastradh Exp $ version 20180827 @@ -21,6 +21,8 @@ makeoptions i915drmkms "CPPFLAGS.i915drm makeoptions i915drmkms "CPPFLAGS.i915drmkms"+="-DCONFIG_DRM_FBDEV_EMULATION=1" makeoptions i915drmkms "CPPFLAGS.i915drmkms"+="-DCONFIG_DRM_I915_DEBUG=1" # XXX makeoptions i915drmkms "CPPFLAGS.i915drmkms"+="-DCONFIG_DRM_I915_DEBUG_GEM=1" # XXX +makeoptions i915drmkms "CPPFLAGS.i915drmkms"+="-DCONFIG_DRM_I915_PREEMPT_TIMEOUT=640" +makeoptions i915drmkms "CPPFLAGS.i915drmkms"+="-DCONFIG_DRM_I915_TIMESLICE_DURATION=1" makeoptions i915drmkms "CPPFLAGS.i915drmkms"+="-DCONFIG_DRM_I915_ALPHA_SUPPORT=0" makeoptions i915drmkms "CPPFLAGS.i915drmkms"+="-DCONFIG_DRM_I915_FBDEV=1" makeoptions i915drmkms "CPPFLAGS.i915drmkms"+="-DCONFIG_DRM_I915_GVT=0"
CVS commit: src/sys/external/bsd/drm2/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:05:40 UTC 2021 Modified Files: src/sys/external/bsd/drm2/include/linux: overflow.h Log Message: Fix array_size. Helps to multiply, not add. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/external/bsd/drm2/include/linux/overflow.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/drm2/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:05:40 UTC 2021 Modified Files: src/sys/external/bsd/drm2/include/linux: overflow.h Log Message: Fix array_size. Helps to multiply, not add. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/external/bsd/drm2/include/linux/overflow.h 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/include/linux/overflow.h diff -u src/sys/external/bsd/drm2/include/linux/overflow.h:1.3 src/sys/external/bsd/drm2/include/linux/overflow.h:1.4 --- src/sys/external/bsd/drm2/include/linux/overflow.h:1.3 Sun Dec 19 10:50:30 2021 +++ src/sys/external/bsd/drm2/include/linux/overflow.h Sun Dec 19 11:05:40 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: overflow.h,v 1.3 2021/12/19 10:50:30 riastradh Exp $ */ +/* $NetBSD: overflow.h,v 1.4 2021/12/19 11:05:40 riastradh Exp $ */ /*- * Copyright (c) 2018 The NetBSD Foundation, Inc. @@ -45,7 +45,7 @@ array_size(size_t x, size_t y) { size_t xy; - if (check_add_overflow(x, y, )) + if (check_mul_overflow(x, y, )) return SIZE_MAX; return xy; }
CVS commit: src/sys/external/bsd/drm2/dist/drm/ttm
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:05:48 UTC 2021 Modified Files: src/sys/external/bsd/drm2/dist/drm/ttm: ttm_tt.c Log Message: drm/ttm: uao_create takes pages, not bytes. To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/sys/external/bsd/drm2/dist/drm/ttm/ttm_tt.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/drm2/dist/drm/ttm
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:05:48 UTC 2021 Modified Files: src/sys/external/bsd/drm2/dist/drm/ttm: ttm_tt.c Log Message: drm/ttm: uao_create takes pages, not bytes. To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/sys/external/bsd/drm2/dist/drm/ttm/ttm_tt.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/ttm/ttm_tt.c diff -u src/sys/external/bsd/drm2/dist/drm/ttm/ttm_tt.c:1.15 src/sys/external/bsd/drm2/dist/drm/ttm/ttm_tt.c:1.16 --- src/sys/external/bsd/drm2/dist/drm/ttm/ttm_tt.c:1.15 Sun Dec 19 09:58:15 2021 +++ src/sys/external/bsd/drm2/dist/drm/ttm/ttm_tt.c Sun Dec 19 11:05:48 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: ttm_tt.c,v 1.15 2021/12/19 09:58:15 riastradh Exp $ */ +/* $NetBSD: ttm_tt.c,v 1.16 2021/12/19 11:05:48 riastradh Exp $ */ /* SPDX-License-Identifier: GPL-2.0 OR MIT */ /** @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ttm_tt.c,v 1.15 2021/12/19 09:58:15 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ttm_tt.c,v 1.16 2021/12/19 11:05:48 riastradh Exp $"); #define pr_fmt(fmt) "[TTM] " fmt @@ -249,7 +249,7 @@ static void ttm_tt_init_fields(struct tt WARN(bo->num_pages == 0, "zero-size allocation in %s, please file a NetBSD PR", __func__); /* paranoia -- can't prove in five minutes */ - ttm->swap_storage = uao_create(MAX(1, bo->num_pages), 0); + ttm->swap_storage = uao_create(PAGE_SIZE * MAX(1, bo->num_pages), 0); uao_set_pgfl(ttm->swap_storage, bus_dmamem_pgfl(ttm->bdev->dmat)); TAILQ_INIT(>pglist); #else
CVS commit: src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/core
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:05:55 UTC 2021 Modified Files: src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/core: nouveau_nvkm_core_object.c Log Message: nouveau: Fix #endif NetBSD so we return ENOENT here. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 \ src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/core/nouveau_nvkm_core_object.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/drm2/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:05:05 UTC 2021 Modified Files: src/sys/external/bsd/drm2/include/linux: lockdep.h Log Message: Add some missing includes in linux/lockdep.h. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/external/bsd/drm2/include/linux/lockdep.h 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/include/linux/lockdep.h diff -u src/sys/external/bsd/drm2/include/linux/lockdep.h:1.4 src/sys/external/bsd/drm2/include/linux/lockdep.h:1.5 --- src/sys/external/bsd/drm2/include/linux/lockdep.h:1.4 Sun Dec 19 11:04:42 2021 +++ src/sys/external/bsd/drm2/include/linux/lockdep.h Sun Dec 19 11:05:05 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: lockdep.h,v 1.4 2021/12/19 11:04:42 riastradh Exp $ */ +/* $NetBSD: lockdep.h,v 1.5 2021/12/19 11:05:05 riastradh Exp $ */ /*- * Copyright (c) 2018 The NetBSD Foundation, Inc. @@ -32,6 +32,11 @@ #ifndef _LINUX_LOCKDEP_H_ #define _LINUX_LOCKDEP_H_ +#include +#include + +#include + struct mutex; struct spinlock;
CVS commit: src/sys/external/bsd/drm2
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:05:13 UTC 2021 Modified Files: src/sys/external/bsd/drm2/amdgpu: amdgpu_pci.c src/sys/external/bsd/drm2/dist/include/drm: drm_pci.h src/sys/external/bsd/drm2/i915drm: i915_pci_autoconf.c src/sys/external/bsd/drm2/nouveau: nouveau_pci.c src/sys/external/bsd/drm2/pci: drm_pci.c src/sys/external/bsd/drm2/radeon: radeon_pci.c Log Message: Split drm_dev_alloc/register out of drm_pci_attach. Needed by nouveau which needs to do drm_dev_alloc drm_pci_attach nouveau_drm_device_init drm_dev_register To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/external/bsd/drm2/amdgpu/amdgpu_pci.c cvs rdiff -u -r1.6 -r1.7 src/sys/external/bsd/drm2/dist/include/drm/drm_pci.h cvs rdiff -u -r1.3 -r1.4 \ src/sys/external/bsd/drm2/i915drm/i915_pci_autoconf.c cvs rdiff -u -r1.29 -r1.30 src/sys/external/bsd/drm2/nouveau/nouveau_pci.c cvs rdiff -u -r1.43 -r1.44 src/sys/external/bsd/drm2/pci/drm_pci.c cvs rdiff -u -r1.17 -r1.18 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.
CVS commit: src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/core
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:05:55 UTC 2021 Modified Files: src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/core: nouveau_nvkm_core_object.c Log Message: nouveau: Fix #endif NetBSD so we return ENOENT here. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 \ src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/core/nouveau_nvkm_core_object.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/nvkm/core/nouveau_nvkm_core_object.c diff -u src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/core/nouveau_nvkm_core_object.c:1.8 src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/core/nouveau_nvkm_core_object.c:1.9 --- src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/core/nouveau_nvkm_core_object.c:1.8 Sun Dec 19 10:51:57 2021 +++ src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/core/nouveau_nvkm_core_object.c Sun Dec 19 11:05:55 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: nouveau_nvkm_core_object.c,v 1.8 2021/12/19 10:51:57 riastradh Exp $ */ +/* $NetBSD: nouveau_nvkm_core_object.c,v 1.9 2021/12/19 11:05:55 riastradh Exp $ */ /* * Copyright 2012 Red Hat Inc. @@ -24,7 +24,7 @@ * Authors: Ben Skeggs */ #include -__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_core_object.c,v 1.8 2021/12/19 10:51:57 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_core_object.c,v 1.9 2021/12/19 11:05:55 riastradh Exp $"); #include #include @@ -53,8 +53,8 @@ nvkm_object_search(struct nvkm_client *c else goto done; } - return ERR_PTR(-ENOENT); #endif + return ERR_PTR(-ENOENT); } else { object = >object; }
CVS commit: src/sys/external/bsd/drm2/dist/drm/i915
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:10:56 UTC 2021 Modified Files: src/sys/external/bsd/drm2/dist/drm/i915: i915_sw_fence.h src/sys/external/bsd/drm2/dist/drm/i915/gem: i915_gem_object.h Log Message: Switch #ifdef CONFIG_WHATEVER to #if IS_ENABLED(CONFIG_WHATEVER) Our IS_ENABLED should probably be #if defined(option) && (option), but that becomes tricky with evaluation order. If option gets expanded earlier, this errors out (e.g. with CONFIG_AGP) Author: Maya Rashish Committer: Taylor R Campbell To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 \ src/sys/external/bsd/drm2/dist/drm/i915/i915_sw_fence.h cvs rdiff -u -r1.3 -r1.4 \ src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_object.h 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/i915/i915_sw_fence.h diff -u src/sys/external/bsd/drm2/dist/drm/i915/i915_sw_fence.h:1.2 src/sys/external/bsd/drm2/dist/drm/i915/i915_sw_fence.h:1.3 --- src/sys/external/bsd/drm2/dist/drm/i915/i915_sw_fence.h:1.2 Sat Dec 18 23:45:28 2021 +++ src/sys/external/bsd/drm2/dist/drm/i915/i915_sw_fence.h Sun Dec 19 11:10:56 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: i915_sw_fence.h,v 1.2 2021/12/18 23:45:28 riastradh Exp $ */ +/* $NetBSD: i915_sw_fence.h,v 1.3 2021/12/19 11:10:56 riastradh Exp $ */ /* * SPDX-License-Identifier: MIT @@ -44,7 +44,7 @@ void __i915_sw_fence_init(struct i915_sw i915_sw_fence_notify_t fn, const char *name, struct lock_class_key *key); -#ifdef CONFIG_LOCKDEP +#if IS_ENABLED(CONFIG_LOCKDEP) #define i915_sw_fence_init(fence, fn)\ do {\ static struct lock_class_key __key; \ Index: src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_object.h diff -u src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_object.h:1.3 src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_object.h:1.4 --- src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_object.h:1.3 Sun Dec 19 01:24:25 2021 +++ src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_object.h Sun Dec 19 11:10:56 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: i915_gem_object.h,v 1.3 2021/12/19 01:24:25 riastradh Exp $ */ +/* $NetBSD: i915_gem_object.h,v 1.4 2021/12/19 11:10:56 riastradh Exp $ */ /* * SPDX-License-Identifier: MIT @@ -69,7 +69,7 @@ void i915_gem_object_truncate(struct drm static inline struct drm_i915_gem_object * i915_gem_object_lookup_rcu(struct drm_file *file, u32 handle) { -#ifdef CONFIG_LOCKDEP +#if IS_ENABLED(CONFIG_LOCKDEP) WARN_ON(debug_locks && !lock_is_held(_lock_map)); #endif return idr_find(>object_idr, handle);
CVS commit: src/sys/external/bsd/drm2/dist/drm/i915
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:11:11 UTC 2021 Modified Files: src/sys/external/bsd/drm2/dist/drm/i915: i915_perf_types.h src/sys/external/bsd/drm2/dist/drm/i915/display: intel_display_types.h Log Message: Use types we have. Author: Maya Rashish Committer: Taylor R Campbell To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 \ src/sys/external/bsd/drm2/dist/drm/i915/i915_perf_types.h cvs rdiff -u -r1.2 -r1.3 \ src/sys/external/bsd/drm2/dist/drm/i915/display/intel_display_types.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/drm2/dist/drm/i915
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:11:11 UTC 2021 Modified Files: src/sys/external/bsd/drm2/dist/drm/i915: i915_perf_types.h src/sys/external/bsd/drm2/dist/drm/i915/display: intel_display_types.h Log Message: Use types we have. Author: Maya Rashish Committer: Taylor R Campbell To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 \ src/sys/external/bsd/drm2/dist/drm/i915/i915_perf_types.h cvs rdiff -u -r1.2 -r1.3 \ src/sys/external/bsd/drm2/dist/drm/i915/display/intel_display_types.h 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/i915/i915_perf_types.h diff -u src/sys/external/bsd/drm2/dist/drm/i915/i915_perf_types.h:1.3 src/sys/external/bsd/drm2/dist/drm/i915/i915_perf_types.h:1.4 --- src/sys/external/bsd/drm2/dist/drm/i915/i915_perf_types.h:1.3 Sun Dec 19 01:24:25 2021 +++ src/sys/external/bsd/drm2/dist/drm/i915/i915_perf_types.h Sun Dec 19 11:11:11 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: i915_perf_types.h,v 1.3 2021/12/19 01:24:25 riastradh Exp $ */ +/* $NetBSD: i915_perf_types.h,v 1.4 2021/12/19 11:11:11 riastradh Exp $ */ /* SPDX-License-Identifier: MIT */ /* @@ -225,7 +225,11 @@ struct i915_perf_stream { * @poll_wq: The wait queue that hrtimer callback wakes when it * sees data ready to read in the circular OA buffer. */ +#ifdef __linux__ wait_queue_head_t poll_wq; +#else + drm_waitqueue_t poll_wq; +#endif /** * @pollin: Whether there is data available to read. Index: src/sys/external/bsd/drm2/dist/drm/i915/display/intel_display_types.h diff -u src/sys/external/bsd/drm2/dist/drm/i915/display/intel_display_types.h:1.2 src/sys/external/bsd/drm2/dist/drm/i915/display/intel_display_types.h:1.3 --- src/sys/external/bsd/drm2/dist/drm/i915/display/intel_display_types.h:1.2 Sat Dec 18 23:45:30 2021 +++ src/sys/external/bsd/drm2/dist/drm/i915/display/intel_display_types.h Sun Dec 19 11:11:11 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: intel_display_types.h,v 1.2 2021/12/18 23:45:30 riastradh Exp $ */ +/* $NetBSD: intel_display_types.h,v 1.3 2021/12/19 11:11:11 riastradh Exp $ */ /* * Copyright (c) 2006 Dave Airlie @@ -387,7 +387,11 @@ struct intel_hdcp { * Work queue to signal the CP_IRQ. Used for the waiters to read the * available information from HDCP DP sink. */ +#ifdef __linux__ wait_queue_head_t cp_irq_queue; +#else + drm_waitqueue_t cp_irq_queue; +#endif atomic_t cp_irq_count; int cp_irq_count_cached;
CVS commit: src/sys/external/bsd/drm2/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:11:19 UTC 2021 Modified Files: src/sys/external/bsd/drm2/include/linux: lockdep.h Log Message: Stub might_lock_nested. Not in the LOCKDEP case... Not sure we have anything for nested locks. Author: Maya Rashish Committer: Taylor R Campbell To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/external/bsd/drm2/include/linux/lockdep.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/drm2/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:11:19 UTC 2021 Modified Files: src/sys/external/bsd/drm2/include/linux: lockdep.h Log Message: Stub might_lock_nested. Not in the LOCKDEP case... Not sure we have anything for nested locks. Author: Maya Rashish Committer: Taylor R Campbell To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/external/bsd/drm2/include/linux/lockdep.h 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/include/linux/lockdep.h diff -u src/sys/external/bsd/drm2/include/linux/lockdep.h:1.5 src/sys/external/bsd/drm2/include/linux/lockdep.h:1.6 --- src/sys/external/bsd/drm2/include/linux/lockdep.h:1.5 Sun Dec 19 11:05:05 2021 +++ src/sys/external/bsd/drm2/include/linux/lockdep.h Sun Dec 19 11:11:19 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: lockdep.h,v 1.5 2021/12/19 11:05:05 riastradh Exp $ */ +/* $NetBSD: lockdep.h,v 1.6 2021/12/19 11:11:19 riastradh Exp $ */ /*- * Copyright (c) 2018 The NetBSD Foundation, Inc. @@ -57,6 +57,7 @@ struct spinlock; #define lockdep_assert_held_once(m) do {} while (0) #define lockdep_is_held(m) 1 #define might_lock(m) do {} while (0) +#define might_lock_nested(m,n) do {} while (0) #endif #define __lockdep_kmutex(m) \
CVS commit: src/sys/external/bsd
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:10:41 UTC 2021 Modified Files: src/sys/external/bsd/common/include/asm: bug.h Added Files: src/sys/external/bsd/common/include/linux: build_bug.h Removed Files: src/sys/external/bsd/drm2/include/linux: build_bug.h Log Message: linux: Move BUILD_BUG_* to common linux/build_bug.h. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/common/include/asm/bug.h cvs rdiff -u -r0 -r1.1 src/sys/external/bsd/common/include/linux/build_bug.h cvs rdiff -u -r1.1 -r0 src/sys/external/bsd/drm2/include/linux/build_bug.h 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/common/include/asm/bug.h diff -u src/sys/external/bsd/common/include/asm/bug.h:1.2 src/sys/external/bsd/common/include/asm/bug.h:1.3 --- src/sys/external/bsd/common/include/asm/bug.h:1.2 Sun Dec 19 11:01:37 2021 +++ src/sys/external/bsd/common/include/asm/bug.h Sun Dec 19 11:10:41 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: bug.h,v 1.2 2021/12/19 11:01:37 riastradh Exp $ */ +/* $NetBSD: bug.h,v 1.3 2021/12/19 11:10:41 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -35,22 +35,11 @@ #include #include -/* - * static_assert is violated with runtime-only compiler semantics in a few - * places. Instead of breaking the build, stop asserting these corner cases. - */ - -#define DRMCTASSERT(x) CTASSERT((__builtin_choose_expr( \ - __builtin_constant_p(x), (x), 1))) +#include /* XXX */ #define BUG() panic("%s:%d: BUG!", __FILE__, __LINE__) #define BUG_ON(CONDITION) KASSERT(!(CONDITION)) -#define BUILD_BUG() do {} while (0) -#define BUILD_BUG_ON(CONDITION) DRMCTASSERT(!(CONDITION)) -#define BUILD_BUG_ON_MSG(CONDITION,MSG) DRMCTASSERT(!(CONDITION)) -#define BUILD_BUG_ON_INVALID(EXPR) ((void)sizeof((long)(EXPR))) - /* XXX Rate limit? */ #define WARN(CONDITION, FMT, ...) \ linux_warning((CONDITION)? \ Added files: Index: src/sys/external/bsd/common/include/linux/build_bug.h diff -u /dev/null src/sys/external/bsd/common/include/linux/build_bug.h:1.1 --- /dev/null Sun Dec 19 11:10:41 2021 +++ src/sys/external/bsd/common/include/linux/build_bug.h Sun Dec 19 11:10:41 2021 @@ -0,0 +1,47 @@ +/* $NetBSD: build_bug.h,v 1.1 2021/12/19 11:10:41 riastradh Exp $ */ + +/*- + * Copyright (c) 2020 The NetBSD Foundation, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _LINUX_BUILD_BUG_H_ +#define _LINUX_BUILD_BUG_H_ + +#include + +/* + * static_assert is violated with runtime-only compiler semantics in a few + * places. Instead of breaking the build, stop asserting these corner cases. + */ + +#define DRMCTASSERT(x) CTASSERT((__builtin_choose_expr( \ + __builtin_constant_p(x), (x), 1))) + +#define BUILD_BUG() do {} while (0) +#define BUILD_BUG_ON(CONDITION) DRMCTASSERT(!(CONDITION)) +#define BUILD_BUG_ON_MSG(CONDITION,MSG) DRMCTASSERT(!(CONDITION)) +#define BUILD_BUG_ON_INVALID(EXPR) ((void)sizeof((long)(EXPR))) + +#endif /* _LINUX_BUILD_BUG_H_ */
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:10:48 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: build_bug.h Log Message: linux: Simplify build_bug.h and add static_assert. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 \ src/sys/external/bsd/common/include/linux/build_bug.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:10:48 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: build_bug.h Log Message: linux: Simplify build_bug.h and add static_assert. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 \ src/sys/external/bsd/common/include/linux/build_bug.h 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/common/include/linux/build_bug.h diff -u src/sys/external/bsd/common/include/linux/build_bug.h:1.1 src/sys/external/bsd/common/include/linux/build_bug.h:1.2 --- src/sys/external/bsd/common/include/linux/build_bug.h:1.1 Sun Dec 19 11:10:41 2021 +++ src/sys/external/bsd/common/include/linux/build_bug.h Sun Dec 19 11:10:48 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: build_bug.h,v 1.1 2021/12/19 11:10:41 riastradh Exp $ */ +/* $NetBSD: build_bug.h,v 1.2 2021/12/19 11:10:48 riastradh Exp $ */ /*- * Copyright (c) 2020 The NetBSD Foundation, Inc. @@ -31,17 +31,15 @@ #include -/* - * static_assert is violated with runtime-only compiler semantics in a few - * places. Instead of breaking the build, stop asserting these corner cases. - */ +/* Required to be false _or_ nonconstant. */ +#define BUILD_BUG_ON(EXPR) \ + CTASSERT(__builtin_choose_expr(__builtin_constant_p(EXPR), !(EXPR), 1)) -#define DRMCTASSERT(x) CTASSERT((__builtin_choose_expr( \ - __builtin_constant_p(x), (x), 1))) +/* Required to be constant _and_ true. XXX Should take optional message. */ +#define static_assert(EXPR) CTASSERT(EXPR) -#define BUILD_BUG() do {} while (0) -#define BUILD_BUG_ON(CONDITION) DRMCTASSERT(!(CONDITION)) -#define BUILD_BUG_ON_MSG(CONDITION,MSG) DRMCTASSERT(!(CONDITION)) +#define BUILD_BUG() do {} while (0) +#define BUILD_BUG_ON_MSG(EXPR,MSG) BUILD_BUG_ON(EXPR) #define BUILD_BUG_ON_INVALID(EXPR) ((void)sizeof((long)(EXPR))) #endif /* _LINUX_BUILD_BUG_H_ */
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:10:18 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: workqueue.h Log Message: stub struct rcu_work Author: Maya Rashish Committer: Taylor R Campbell To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 \ src/sys/external/bsd/common/include/linux/workqueue.h 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/common/include/linux/workqueue.h diff -u src/sys/external/bsd/common/include/linux/workqueue.h:1.22 src/sys/external/bsd/common/include/linux/workqueue.h:1.23 --- src/sys/external/bsd/common/include/linux/workqueue.h:1.22 Sun Dec 19 11:03:49 2021 +++ src/sys/external/bsd/common/include/linux/workqueue.h Sun Dec 19 11:10:17 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: workqueue.h,v 1.22 2021/12/19 11:03:49 riastradh Exp $ */ +/* $NetBSD: workqueue.h,v 1.23 2021/12/19 11:10:17 riastradh Exp $ */ /*- * Copyright (c) 2013, 2018 The NetBSD Foundation, Inc. @@ -87,6 +87,9 @@ struct delayed_work { }dw_state; }; +struct rcu_work { +}; + #define WQ_FREEZABLE __BIT(0) #define WQ_HIGHPRI __BIT(1) #define WQ_MEM_RECLAIM __BIT(2)
CVS commit: src/sys/external/bsd/drm2/dist/drm/i915
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:10:25 UTC 2021 Modified Files: src/sys/external/bsd/drm2/dist/drm/i915: intel_uncore.h Log Message: provide our own uncore read/write functions and add struct members for it Author: Maya Rashish Committer: Taylor R Campbell To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 \ src/sys/external/bsd/drm2/dist/drm/i915/intel_uncore.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/drm2/dist/drm/i915
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:10:25 UTC 2021 Modified Files: src/sys/external/bsd/drm2/dist/drm/i915: intel_uncore.h Log Message: provide our own uncore read/write functions and add struct members for it Author: Maya Rashish Committer: Taylor R Campbell To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 \ src/sys/external/bsd/drm2/dist/drm/i915/intel_uncore.h 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/i915/intel_uncore.h diff -u src/sys/external/bsd/drm2/dist/drm/i915/intel_uncore.h:1.4 src/sys/external/bsd/drm2/dist/drm/i915/intel_uncore.h:1.5 --- src/sys/external/bsd/drm2/dist/drm/i915/intel_uncore.h:1.4 Sun Dec 19 11:04:05 2021 +++ src/sys/external/bsd/drm2/dist/drm/i915/intel_uncore.h Sun Dec 19 11:10:25 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: intel_uncore.h,v 1.4 2021/12/19 11:04:05 riastradh Exp $ */ +/* $NetBSD: intel_uncore.h,v 1.5 2021/12/19 11:10:25 riastradh Exp $ */ /* * Copyright © 2017 Intel Corporation @@ -109,14 +109,11 @@ struct intel_forcewake_range { }; struct intel_uncore { -#ifdef __NetBSD__ -# define __iomem -#endif - +#ifdef __linux__ void __iomem *regs; - -#ifdef __NetBSD__ -# undef __iomem +#else + bus_space_tag_t regs_bst; + bus_space_handle_t regs_bsh; #endif struct drm_i915_private *i915; @@ -267,6 +264,7 @@ intel_wait_for_register_fw(struct intel_ } /* register access functions */ +#ifdef __linux__ #define __raw_read(x__, s__) \ static inline u##x__ __raw_uncore_read##x__(const struct intel_uncore *uncore, \ i915_reg_t reg) \ @@ -292,6 +290,40 @@ __raw_write(64, q) #undef __raw_read #undef __raw_write +#else +static inline uint8_t __raw_uncore_read8(const struct intel_uncore *uncore, + i915_reg_t reg) { + return bus_space_read_1(uncore->regs_bst, uncore->regs_bsh, i915_mmio_reg_offset(reg)); +} +static inline uint16_t __raw_uncore_read16(const struct intel_uncore *uncore, + i915_reg_t reg) { + return bus_space_read_2(uncore->regs_bst, uncore->regs_bsh, i915_mmio_reg_offset(reg)); +} +static inline uint32_t __raw_uncore_read32(const struct intel_uncore *uncore, + i915_reg_t reg) { + return bus_space_read_4(uncore->regs_bst, uncore->regs_bsh, i915_mmio_reg_offset(reg)); +} +static inline uint64_t __raw_uncore_read64(const struct intel_uncore *uncore, + i915_reg_t reg) { + return bus_space_read_8(uncore->regs_bst, uncore->regs_bsh, i915_mmio_reg_offset(reg)); +} +static inline void __raw_uncore_write8(const struct intel_uncore *uncore, + i915_reg_t reg, uint8_t val) { + bus_space_write_1(uncore->regs_bst, uncore->regs_bsh, i915_mmio_reg_offset(reg), val); +} +static inline void __raw_uncore_write16(const struct intel_uncore *uncore, + i915_reg_t reg, uint16_t val) { + bus_space_write_2(uncore->regs_bst, uncore->regs_bsh, i915_mmio_reg_offset(reg), val); +} +static inline void __raw_uncore_write32(const struct intel_uncore *uncore, + i915_reg_t reg, uint32_t val) { + bus_space_write_4(uncore->regs_bst, uncore->regs_bsh, i915_mmio_reg_offset(reg), val); +} +static inline void __raw_uncore_write64(const struct intel_uncore *uncore, + i915_reg_t reg, uint64_t val) { + bus_space_write_8(uncore->regs_bst, uncore->regs_bsh, i915_mmio_reg_offset(reg), val); +} +#endif #define __uncore_read(name__, x__, s__, trace__) \ static inline u##x__ intel_uncore_##name__(struct intel_uncore *uncore, \
CVS commit: src/sys/external/bsd/drm2/dist/drm/i915
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:11:35 UTC 2021 Modified Files: src/sys/external/bsd/drm2/dist/drm/i915: i915_scatterlist.h Log Message: Maybe we can just get away with not defining anything in this header? Author: Maya Rashish Committer: Taylor R Campbell To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 \ src/sys/external/bsd/drm2/dist/drm/i915/i915_scatterlist.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/drm2/dist/drm/i915
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:11:35 UTC 2021 Modified Files: src/sys/external/bsd/drm2/dist/drm/i915: i915_scatterlist.h Log Message: Maybe we can just get away with not defining anything in this header? Author: Maya Rashish Committer: Taylor R Campbell To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 \ src/sys/external/bsd/drm2/dist/drm/i915/i915_scatterlist.h 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/i915/i915_scatterlist.h diff -u src/sys/external/bsd/drm2/dist/drm/i915/i915_scatterlist.h:1.4 src/sys/external/bsd/drm2/dist/drm/i915/i915_scatterlist.h:1.5 --- src/sys/external/bsd/drm2/dist/drm/i915/i915_scatterlist.h:1.4 Sun Dec 19 11:11:27 2021 +++ src/sys/external/bsd/drm2/dist/drm/i915/i915_scatterlist.h Sun Dec 19 11:11:35 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: i915_scatterlist.h,v 1.4 2021/12/19 11:11:27 riastradh Exp $ */ +/* $NetBSD: i915_scatterlist.h,v 1.5 2021/12/19 11:11:35 riastradh Exp $ */ /* * SPDX-License-Identifier: MIT @@ -46,7 +46,6 @@ static inline int __sg_page_count(const { return sg->length >> PAGE_SHIFT; } -#endif static inline struct scatterlist *sg_next(struct scatterlist *sg) { @@ -111,7 +110,6 @@ static inline unsigned int i915_sg_page_ return page_sizes; } -#ifndef __NetBSD__ static inline unsigned int i915_sg_segment_size(void) { unsigned int size = swiotlb_max_segment();
CVS commit: src/sys/external/bsd/drm2/dist/drm/i915/gt
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:11:04 UTC 2021 Modified Files: src/sys/external/bsd/drm2/dist/drm/i915/gt: intel_gtt.h Log Message: Avoid dropping const qualifier Author: Maya Rashish Committer: Taylor R Campbell To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 \ src/sys/external/bsd/drm2/dist/drm/i915/gt/intel_gtt.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/drm2/dist/drm/i915/gt
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:11:04 UTC 2021 Modified Files: src/sys/external/bsd/drm2/dist/drm/i915/gt: intel_gtt.h Log Message: Avoid dropping const qualifier Author: Maya Rashish Committer: Taylor R Campbell To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 \ src/sys/external/bsd/drm2/dist/drm/i915/gt/intel_gtt.h 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/i915/gt/intel_gtt.h diff -u src/sys/external/bsd/drm2/dist/drm/i915/gt/intel_gtt.h:1.4 src/sys/external/bsd/drm2/dist/drm/i915/gt/intel_gtt.h:1.5 --- src/sys/external/bsd/drm2/dist/drm/i915/gt/intel_gtt.h:1.4 Sun Dec 19 01:35:35 2021 +++ src/sys/external/bsd/drm2/dist/drm/i915/gt/intel_gtt.h Sun Dec 19 11:11:03 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: intel_gtt.h,v 1.4 2021/12/19 01:35:35 riastradh Exp $ */ +/* $NetBSD: intel_gtt.h,v 1.5 2021/12/19 11:11:03 riastradh Exp $ */ /* SPDX-License-Identifier: MIT */ /* @@ -185,10 +185,10 @@ struct i915_page_directory { other) #define px_base(px) \ - __px_choose_expr(px, struct i915_page_dma *, __x, \ - __px_choose_expr(px, struct i915_page_scratch *, &__x->base, \ - __px_choose_expr(px, struct i915_page_table *, &__x->base, \ - __px_choose_expr(px, struct i915_page_directory *, &__x->pt.base, \ + __px_choose_expr(px, const struct i915_page_dma *, __x, \ + __px_choose_expr(px, const struct i915_page_scratch *, &__x->base, \ + __px_choose_expr(px, const struct i915_page_table *, &__x->base, \ + __px_choose_expr(px, const struct i915_page_directory *, &__x->pt.base, \ (void)0 #ifdef __NetBSD__ #define px_dma(px) (px_base(px)->map->dm_segs[0].ds_addr)
CVS commit: src/sys/external/bsd/drm2/dist/drm/i915
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:10:56 UTC 2021 Modified Files: src/sys/external/bsd/drm2/dist/drm/i915: i915_sw_fence.h src/sys/external/bsd/drm2/dist/drm/i915/gem: i915_gem_object.h Log Message: Switch #ifdef CONFIG_WHATEVER to #if IS_ENABLED(CONFIG_WHATEVER) Our IS_ENABLED should probably be #if defined(option) && (option), but that becomes tricky with evaluation order. If option gets expanded earlier, this errors out (e.g. with CONFIG_AGP) Author: Maya Rashish Committer: Taylor R Campbell To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 \ src/sys/external/bsd/drm2/dist/drm/i915/i915_sw_fence.h cvs rdiff -u -r1.3 -r1.4 \ src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_object.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:10:41 UTC 2021 Modified Files: src/sys/external/bsd/common/include/asm: bug.h Added Files: src/sys/external/bsd/common/include/linux: build_bug.h Removed Files: src/sys/external/bsd/drm2/include/linux: build_bug.h Log Message: linux: Move BUILD_BUG_* to common linux/build_bug.h. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/common/include/asm/bug.h cvs rdiff -u -r0 -r1.1 src/sys/external/bsd/common/include/linux/build_bug.h cvs rdiff -u -r1.1 -r0 src/sys/external/bsd/drm2/include/linux/build_bug.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/drm2
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:26:35 UTC 2021 Modified Files: src/sys/external/bsd/drm2/dist/drm/i915: i915_drv.c i915_gem.c src/sys/external/bsd/drm2/dist/drm/i915/gem: i915_gem_clflush.c i915_gem_client_blt.c i915_gem_mman.c src/sys/external/bsd/drm2/i915drm: i915_module.c src/sys/external/bsd/drm2/include/linux: irq_work.h Log Message: i915: machete To generate a diff of this commit: cvs rdiff -u -r1.39 -r1.40 src/sys/external/bsd/drm2/dist/drm/i915/i915_drv.c cvs rdiff -u -r1.69 -r1.70 src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c cvs rdiff -u -r1.2 -r1.3 \ src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_clflush.c \ src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_client_blt.c cvs rdiff -u -r1.3 -r1.4 \ src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_mman.c cvs rdiff -u -r1.11 -r1.12 src/sys/external/bsd/drm2/i915drm/i915_module.c cvs rdiff -u -r1.3 -r1.4 src/sys/external/bsd/drm2/include/linux/irq_work.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/drm2
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:26:35 UTC 2021 Modified Files: src/sys/external/bsd/drm2/dist/drm/i915: i915_drv.c i915_gem.c src/sys/external/bsd/drm2/dist/drm/i915/gem: i915_gem_clflush.c i915_gem_client_blt.c i915_gem_mman.c src/sys/external/bsd/drm2/i915drm: i915_module.c src/sys/external/bsd/drm2/include/linux: irq_work.h Log Message: i915: machete To generate a diff of this commit: cvs rdiff -u -r1.39 -r1.40 src/sys/external/bsd/drm2/dist/drm/i915/i915_drv.c cvs rdiff -u -r1.69 -r1.70 src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c cvs rdiff -u -r1.2 -r1.3 \ src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_clflush.c \ src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_client_blt.c cvs rdiff -u -r1.3 -r1.4 \ src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_mman.c cvs rdiff -u -r1.11 -r1.12 src/sys/external/bsd/drm2/i915drm/i915_module.c cvs rdiff -u -r1.3 -r1.4 src/sys/external/bsd/drm2/include/linux/irq_work.h 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/i915/i915_drv.c diff -u src/sys/external/bsd/drm2/dist/drm/i915/i915_drv.c:1.39 src/sys/external/bsd/drm2/dist/drm/i915/i915_drv.c:1.40 --- src/sys/external/bsd/drm2/dist/drm/i915/i915_drv.c:1.39 Sun Dec 19 11:19:32 2021 +++ src/sys/external/bsd/drm2/dist/drm/i915/i915_drv.c Sun Dec 19 11:26:35 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: i915_drv.c,v 1.39 2021/12/19 11:19:32 riastradh Exp $ */ +/* $NetBSD: i915_drv.c,v 1.40 2021/12/19 11:26:35 riastradh Exp $ */ /* i915_drv.c -- i830,i845,i855,i865,i915 driver -*- linux-c -*- */ @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: i915_drv.c,v 1.39 2021/12/19 11:19:32 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: i915_drv.c,v 1.40 2021/12/19 11:26:35 riastradh Exp $"); #include #include @@ -2847,16 +2847,6 @@ static const struct drm_ioctl_desc i915_ DRM_IOCTL_DEF_DRV(I915_GEM_VM_DESTROY, i915_gem_vm_destroy_ioctl, DRM_RENDER_ALLOW), }; -#ifdef __NetBSD__ - -static const struct uvm_pagerops i915_gem_uvm_ops = { - .pgo_reference = drm_gem_pager_reference, - .pgo_detach = drm_gem_pager_detach, - .pgo_fault = i915_gem_fault, -}; - -#endif - static struct drm_driver driver = { /* Don't use MTRRs here; the Xserver or userspace app should * deal with them for Intel hardware. @@ -2875,9 +2865,8 @@ static struct drm_driver driver = { .request_irq = drm_pci_request_irq, .free_irq = drm_pci_free_irq, - /* XXX Not clear the `or legacy' part is important here. */ - .mmap_object = _gem_mmap_object, - .gem_uvm_ops = _gem_uvm_ops, + .mmap_object = _gem_mmap_object, + .gem_uvm_ops = NULL, #endif Index: src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c diff -u src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c:1.69 src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c:1.70 --- src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c:1.69 Sun Dec 19 11:24:29 2021 +++ src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c Sun Dec 19 11:26:35 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: i915_gem.c,v 1.69 2021/12/19 11:24:29 riastradh Exp $ */ +/* $NetBSD: i915_gem.c,v 1.70 2021/12/19 11:26:35 riastradh Exp $ */ /* * Copyright © 2008-2015 Intel Corporation @@ -28,7 +28,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: i915_gem.c,v 1.69 2021/12/19 11:24:29 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: i915_gem.c,v 1.70 2021/12/19 11:26:35 riastradh Exp $"); #ifdef __NetBSD__ #if 0/* XXX uvmhist option? */ @@ -1239,7 +1239,9 @@ void i915_gem_driver_remove(struct drm_i i915_gem_suspend_late(dev_priv); intel_gt_driver_remove(_priv->gt); +#ifndef __NetBSD__ /* XXX uabi_engines */ dev_priv->uabi_engines = RB_ROOT; +#endif /* Flush any outstanding unpin_work. */ i915_gem_drain_workqueue(dev_priv); Index: src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_clflush.c diff -u src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_clflush.c:1.2 src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_clflush.c:1.3 --- src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_clflush.c:1.2 Sat Dec 18 23:45:30 2021 +++ src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_clflush.c Sun Dec 19 11:26:35 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: i915_gem_clflush.c,v 1.2 2021/12/18 23:45:30 riastradh Exp $ */ +/* $NetBSD: i915_gem_clflush.c,v 1.3 2021/12/19 11:26:35 riastradh Exp $ */ /* * SPDX-License-Identifier: MIT @@ -7,7 +7,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: i915_gem_clflush.c,v 1.2 2021/12/18 23:45:30 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: i915_gem_clflush.c,v 1.3 2021/12/19 11:26:35 riastradh Exp $"); #include "display/intel_frontbuffer.h" @@ -24,7 +24,11 @@ struct clflush { static void __do_clflush(struct drm_i915_gem_object *obj) { GEM_BUG_ON(!i915_gem_object_has_pages(obj)); +#ifdef __NetBSD__ +
CVS commit: src/sys/external/bsd/drm2/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:26:42 UTC 2021 Modified Files: src/sys/external/bsd/drm2/include/linux: atomic.h Log Message: linux: Make xchg and cmpxchg work on pointers too. To generate a diff of this commit: cvs rdiff -u -r1.37 -r1.38 src/sys/external/bsd/drm2/include/linux/atomic.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/drm2/dist/drm/i915
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:27:20 UTC 2021 Modified Files: src/sys/external/bsd/drm2/dist/drm/i915: i915_gem_evict.c src/sys/external/bsd/drm2/dist/drm/i915/gem: i915_gem_context.c i915_gem_dmabuf.c Log Message: drm/i915: Misc build fixes. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 \ src/sys/external/bsd/drm2/dist/drm/i915/i915_gem_evict.c cvs rdiff -u -r1.3 -r1.4 \ src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_context.c \ src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_dmabuf.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/i915/i915_gem_evict.c diff -u src/sys/external/bsd/drm2/dist/drm/i915/i915_gem_evict.c:1.4 src/sys/external/bsd/drm2/dist/drm/i915/i915_gem_evict.c:1.5 --- src/sys/external/bsd/drm2/dist/drm/i915/i915_gem_evict.c:1.4 Sun Dec 19 01:24:25 2021 +++ src/sys/external/bsd/drm2/dist/drm/i915/i915_gem_evict.c Sun Dec 19 11:27:20 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: i915_gem_evict.c,v 1.4 2021/12/19 01:24:25 riastradh Exp $ */ +/* $NetBSD: i915_gem_evict.c,v 1.5 2021/12/19 11:27:20 riastradh Exp $ */ /* * Copyright © 2008-2010 Intel Corporation @@ -29,7 +29,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: i915_gem_evict.c,v 1.4 2021/12/19 01:24:25 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: i915_gem_evict.c,v 1.5 2021/12/19 11:27:20 riastradh Exp $"); #include @@ -39,6 +39,8 @@ __KERNEL_RCSID(0, "$NetBSD: i915_gem_evi #include "i915_drv.h" #include "i915_trace.h" +#include + I915_SELFTEST_DECLARE(static struct igt_evict_ctl { bool fail_if_busy:1; } igt_evict_ctl;) Index: src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_context.c diff -u src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_context.c:1.3 src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_context.c:1.4 --- src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_context.c:1.3 Sun Dec 19 01:24:25 2021 +++ src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_context.c Sun Dec 19 11:27:20 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: i915_gem_context.c,v 1.3 2021/12/19 01:24:25 riastradh Exp $ */ +/* $NetBSD: i915_gem_context.c,v 1.4 2021/12/19 11:27:20 riastradh Exp $ */ /* * SPDX-License-Identifier: MIT @@ -67,11 +67,13 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: i915_gem_context.c,v 1.3 2021/12/19 01:24:25 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: i915_gem_context.c,v 1.4 2021/12/19 11:27:20 riastradh Exp $"); #include #include +#include + #include #include "gt/gen6_ppgtt.h" @@ -87,6 +89,8 @@ __KERNEL_RCSID(0, "$NetBSD: i915_gem_con #include "i915_trace.h" #include "i915_user_extensions.h" +#include + #define ALL_L3_SLICES(dev) (1 << NUM_L3_SLICES(dev)) - 1 static struct i915_global_gem_context { @@ -317,7 +321,9 @@ static void i915_gem_context_free(struct if (ctx->timeline) intel_timeline_put(ctx->timeline); +#ifndef __NetBSD__ put_pid(ctx->pid); +#endif mutex_destroy(>mutex); kfree_rcu(ctx, rcu); @@ -808,10 +814,11 @@ static int gem_context_register(struct i #else ctx->pid = get_task_pid(current, PIDTYPE_PID); #endif - snprintf(ctx->name, sizeof(ctx->name), "%s[%d]", #ifdef __NetBSD__ - curproc->p_comm, (int)curproc->p_pid)); + snprintf(ctx->name, sizeof(ctx->name), "%s[%d]", + curproc->p_comm, (int)curproc->p_pid); #else + snprintf(ctx->name, sizeof(ctx->name), "%s[%d]", current->comm, pid_nr(ctx->pid)); #endif @@ -2233,8 +2240,13 @@ int i915_gem_context_create_ioctl(struct ext_data.fpriv = file->driver_priv; if (client_is_banned(ext_data.fpriv)) { +#ifdef __NetBSD__ + DRM_DEBUG("client %s[%d] banned from creating ctx\n", + curproc->p_comm, (int)curproc->p_pid); +#else DRM_DEBUG("client %s[%d] banned from creating ctx\n", current->comm, task_pid_nr(current)); +#endif return -EIO; } Index: src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_dmabuf.c diff -u src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_dmabuf.c:1.3 src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_dmabuf.c:1.4 --- src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_dmabuf.c:1.3 Sun Dec 19 01:24:25 2021 +++ src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_dmabuf.c Sun Dec 19 11:27:20 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: i915_gem_dmabuf.c,v 1.3 2021/12/19 01:24:25 riastradh Exp $ */ +/* $NetBSD: i915_gem_dmabuf.c,v 1.4 2021/12/19 11:27:20 riastradh Exp $ */ /* * SPDX-License-Identifier: MIT @@ -7,7 +7,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: i915_gem_dmabuf.c,v 1.3 2021/12/19 01:24:25 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: i915_gem_dmabuf.c,v 1.4 2021/12/19 11:27:20 riastradh Exp $"); #include #include @@ -44,7 +44,7 @@ static struct sg_table *i915_gem_map_dma st = drm_prime_pglist_to_sg(>mm.pageq, obj->base.size >> PAGE_SHIFT); if (IS_ERR(st)) - goto
CVS commit: src/sys/external/bsd/drm2/dist/drm/i915/gem
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:27:28 UTC 2021 Modified Files: src/sys/external/bsd/drm2/dist/drm/i915/gem: i915_gem_object_types.h Log Message: drm/i915: Forgot i915_gem_object_types.h change for rb->array. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 \ src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_object_types.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/drm2/dist/drm/i915/gem
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:27:28 UTC 2021 Modified Files: src/sys/external/bsd/drm2/dist/drm/i915/gem: i915_gem_object_types.h Log Message: drm/i915: Forgot i915_gem_object_types.h change for rb->array. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 \ src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_object_types.h 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/i915/gem/i915_gem_object_types.h diff -u src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_object_types.h:1.3 src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_object_types.h:1.4 --- src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_object_types.h:1.3 Sun Dec 19 01:38:51 2021 +++ src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_object_types.h Sun Dec 19 11:27:27 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: i915_gem_object_types.h,v 1.3 2021/12/19 01:38:51 riastradh Exp $ */ +/* $NetBSD: i915_gem_object_types.h,v 1.4 2021/12/19 11:27:27 riastradh Exp $ */ /* * SPDX-License-Identifier: MIT @@ -70,6 +70,7 @@ enum i915_mmap_type { I915_MMAP_TYPE_WC, I915_MMAP_TYPE_WB, I915_MMAP_TYPE_UC, + I915_MMAP_NTYPES }; struct i915_mmap_offset { @@ -137,7 +138,11 @@ struct drm_i915_gem_object { struct { spinlock_t lock; /* Protects access to mmo offsets */ +#ifdef __NetBSD__ + struct i915_mmap_offset *offsets[I915_MMAP_NTYPES]; +#else struct rb_root offsets; +#endif } mmo; I915_SELFTEST_DECLARE(struct list_head st_link);
CVS commit: src/sys/external/bsd/drm2/dist/drm
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:26:26 UTC 2021 Modified Files: src/sys/external/bsd/drm2/dist/drm/amd/amdgpu: amdgpu_ih.c src/sys/external/bsd/drm2/dist/drm/i915/gt: intel_gtt.c src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/mmu: nouveau_nvkm_subdev_mmu_vmmnv44.c src/sys/external/bsd/drm2/dist/drm/radeon: radeon_device.c radeon_gart.c Log Message: drm: Sprinkle BUS_DMA_COHERENT/NOCACHE and bus_dmamap_sync. Algorithm: - For dummy pages, use NOCACHE and PREREAD|PREWRITE. - In #ifdef __NetBSD__ #else dma_alloc_coherent, use BUS_DMA_COHERENT. - For (GPU) page tables we program, use PREWRITE. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 \ src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_ih.c cvs rdiff -u -r1.5 -r1.6 \ src/sys/external/bsd/drm2/dist/drm/i915/gt/intel_gtt.c cvs rdiff -u -r1.3 -r1.4 \ src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/mmu/nouveau_nvkm_subdev_mmu_vmmnv44.c cvs rdiff -u -r1.11 -r1.12 \ src/sys/external/bsd/drm2/dist/drm/radeon/radeon_device.c cvs rdiff -u -r1.13 -r1.14 \ src/sys/external/bsd/drm2/dist/drm/radeon/radeon_gart.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/drm2/dist/drm
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:26:26 UTC 2021 Modified Files: src/sys/external/bsd/drm2/dist/drm/amd/amdgpu: amdgpu_ih.c src/sys/external/bsd/drm2/dist/drm/i915/gt: intel_gtt.c src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/mmu: nouveau_nvkm_subdev_mmu_vmmnv44.c src/sys/external/bsd/drm2/dist/drm/radeon: radeon_device.c radeon_gart.c Log Message: drm: Sprinkle BUS_DMA_COHERENT/NOCACHE and bus_dmamap_sync. Algorithm: - For dummy pages, use NOCACHE and PREREAD|PREWRITE. - In #ifdef __NetBSD__ #else dma_alloc_coherent, use BUS_DMA_COHERENT. - For (GPU) page tables we program, use PREWRITE. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 \ src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_ih.c cvs rdiff -u -r1.5 -r1.6 \ src/sys/external/bsd/drm2/dist/drm/i915/gt/intel_gtt.c cvs rdiff -u -r1.3 -r1.4 \ src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/mmu/nouveau_nvkm_subdev_mmu_vmmnv44.c cvs rdiff -u -r1.11 -r1.12 \ src/sys/external/bsd/drm2/dist/drm/radeon/radeon_device.c cvs rdiff -u -r1.13 -r1.14 \ src/sys/external/bsd/drm2/dist/drm/radeon/radeon_gart.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/amd/amdgpu/amdgpu_ih.c diff -u src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_ih.c:1.6 src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_ih.c:1.7 --- src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_ih.c:1.6 Sun Dec 19 10:20:10 2021 +++ src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_ih.c Sun Dec 19 11:26:25 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: amdgpu_ih.c,v 1.6 2021/12/19 10:20:10 riastradh Exp $ */ +/* $NetBSD: amdgpu_ih.c,v 1.7 2021/12/19 11:26:25 riastradh Exp $ */ /* * Copyright 2014 Advanced Micro Devices, Inc. @@ -24,7 +24,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: amdgpu_ih.c,v 1.6 2021/12/19 10:20:10 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: amdgpu_ih.c,v 1.7 2021/12/19 11:26:25 riastradh Exp $"); #include @@ -84,7 +84,7 @@ fail1: bus_dmamem_free(adev->ddev->dma goto fail0; } r = -bus_dmamem_map(adev->ddev->dmat, >ring_seg, 1, size, - , BUS_DMA_WAITOK); + , BUS_DMA_WAITOK|BUS_DMA_COHERENT); if (r) { fail2: bus_dmamap_destroy(adev->ddev->dmat, ih->ring_map); ih->ring_map = NULL; Index: src/sys/external/bsd/drm2/dist/drm/i915/gt/intel_gtt.c diff -u src/sys/external/bsd/drm2/dist/drm/i915/gt/intel_gtt.c:1.5 src/sys/external/bsd/drm2/dist/drm/i915/gt/intel_gtt.c:1.6 --- src/sys/external/bsd/drm2/dist/drm/i915/gt/intel_gtt.c:1.5 Sun Dec 19 11:12:13 2021 +++ src/sys/external/bsd/drm2/dist/drm/i915/gt/intel_gtt.c Sun Dec 19 11:26:26 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: intel_gtt.c,v 1.5 2021/12/19 11:12:13 riastradh Exp $ */ +/* $NetBSD: intel_gtt.c,v 1.6 2021/12/19 11:26:26 riastradh Exp $ */ // SPDX-License-Identifier: MIT /* @@ -6,7 +6,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: intel_gtt.c,v 1.5 2021/12/19 11:12:13 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: intel_gtt.c,v 1.6 2021/12/19 11:26:26 riastradh Exp $"); #include /* fault-inject.h is not standalone! */ @@ -419,10 +419,12 @@ int setup_scratch_page(struct i915_addre /* Zero the page. */ ret = -bus_dmamem_map(vm->dmat, >scratch_page.seg, 1, - size, , BUS_DMA_NOWAIT); + size, , BUS_DMA_NOWAIT|BUS_DMA_NOCACHE); if (ret) goto unload_dmamap; memset(kva, 0, size); + bus_dmamap_sync(vm->dmat, vm->scratch_page.map, 0, size, + BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE); bus_dmamem_unmap(vm->dmat, kva, size); /* XXX Is this page guaranteed to work as a huge page? */ Index: src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/mmu/nouveau_nvkm_subdev_mmu_vmmnv44.c diff -u src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/mmu/nouveau_nvkm_subdev_mmu_vmmnv44.c:1.3 src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/mmu/nouveau_nvkm_subdev_mmu_vmmnv44.c:1.4 --- src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/mmu/nouveau_nvkm_subdev_mmu_vmmnv44.c:1.3 Sun Dec 19 10:51:58 2021 +++ src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/mmu/nouveau_nvkm_subdev_mmu_vmmnv44.c Sun Dec 19 11:26:26 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: nouveau_nvkm_subdev_mmu_vmmnv44.c,v 1.3 2021/12/19 10:51:58 riastradh Exp $ */ +/* $NetBSD: nouveau_nvkm_subdev_mmu_vmmnv44.c,v 1.4 2021/12/19 11:26:26 riastradh Exp $ */ /* * Copyright 2017 Red Hat Inc. @@ -22,7 +22,7 @@ * OTHER DEALINGS IN THE SOFTWARE. */ #include -__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_subdev_mmu_vmmnv44.c,v 1.3 2021/12/19 10:51:58 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_subdev_mmu_vmmnv44.c,v 1.4 2021/12/19 11:26:26 riastradh Exp $"); #include "vmm.h" @@ -254,7 +254,7 @@ fail1: bus_dmamem_free(dmat, >null /* XXX errno NetBSD->Linux */ ret =
CVS commit: src/sys/external/bsd/vchiq/dist/interface/compat
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:26:04 UTC 2021 Modified Files: src/sys/external/bsd/vchiq/dist/interface/compat: vchi_bsd.h Log Message: Don't redefine stuff that common now has Preferring common to avoid licensing mish-mash Author: Maya Rashish Committer: Taylor R Campbell To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 \ src/sys/external/bsd/vchiq/dist/interface/compat/vchi_bsd.h 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/vchiq/dist/interface/compat/vchi_bsd.h diff -u src/sys/external/bsd/vchiq/dist/interface/compat/vchi_bsd.h:1.17 src/sys/external/bsd/vchiq/dist/interface/compat/vchi_bsd.h:1.18 --- src/sys/external/bsd/vchiq/dist/interface/compat/vchi_bsd.h:1.17 Sat Sep 26 12:58:22 2020 +++ src/sys/external/bsd/vchiq/dist/interface/compat/vchi_bsd.h Sun Dec 19 11:26:04 2021 @@ -173,47 +173,6 @@ void device_rlprintf(int pps, device_t dev, const char *fmt, ...) __printflike(3, 4); -#define might_sleep() - -#define WARN(condition, msg)\ -({ \ - int __ret_warn_on = !!(condition); \ - if (unlikely(__ret_warn_on)) \ - printf((msg));\ - unlikely(__ret_warn_on); \ -}) - - - -#define WARN_ON(condition)\ -({ \ - int __ret_warn_on = !!(condition); \ - if (unlikely(__ret_warn_on)) \ - printf("WARN_ON: " #condition "\n"); \ - unlikely(__ret_warn_on); \ -}) - -#define WARN_ON_ONCE(condition) ({ \ - static int __warned;\ - int __ret_warn_once = !!(condition); \ - \ - if (unlikely(__ret_warn_once)) \ - if (WARN_ON(!__warned)) \ - __warned = 1; \ - unlikely(__ret_warn_once); \ -}) - -#define BUG_ON(cond) \ - do { \ - if (cond)\ - panic("BUG_ON: " #cond); \ - } while (0) - -#define BUG() \ - do { \ - panic("BUG: %s:%d", __FILE__, __LINE__); \ - } while (0) - #define vchiq_static_assert(cond) CTASSERT(cond) /* @@ -293,7 +252,6 @@ int fatal_signal_pending(VCHIQ_THREAD_T) #define __user #define current curlwp -#define EXPORT_SYMBOL(x) #define PAGE_ALIGN(addr) round_page(addr) typedef void irqreturn_t;
CVS commit: src/sys/external/bsd/drm2/dist/drm
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:26:14 UTC 2021 Modified Files: src/sys/external/bsd/drm2/dist/drm: drm_gem.c src/sys/external/bsd/drm2/dist/drm/amd/display/dc/dcn10: amdgpu_dcn10_resource.c src/sys/external/bsd/drm2/dist/drm/amd/display/dc/dcn20: amdgpu_dcn20_hwseq.c amdgpu_dcn20_resource.c Log Message: drm/gem: Comment obscure constant parameters. To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/sys/external/bsd/drm2/dist/drm/drm_gem.c cvs rdiff -u -r1.2 -r1.3 \ src/sys/external/bsd/drm2/dist/drm/amd/display/dc/dcn10/amdgpu_dcn10_resource.c cvs rdiff -u -r1.2 -r1.3 \ src/sys/external/bsd/drm2/dist/drm/amd/display/dc/dcn20/amdgpu_dcn20_hwseq.c \ src/sys/external/bsd/drm2/dist/drm/amd/display/dc/dcn20/amdgpu_dcn20_resource.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/drm2/dist/drm
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:26:14 UTC 2021 Modified Files: src/sys/external/bsd/drm2/dist/drm: drm_gem.c src/sys/external/bsd/drm2/dist/drm/amd/display/dc/dcn10: amdgpu_dcn10_resource.c src/sys/external/bsd/drm2/dist/drm/amd/display/dc/dcn20: amdgpu_dcn20_hwseq.c amdgpu_dcn20_resource.c Log Message: drm/gem: Comment obscure constant parameters. To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/sys/external/bsd/drm2/dist/drm/drm_gem.c cvs rdiff -u -r1.2 -r1.3 \ src/sys/external/bsd/drm2/dist/drm/amd/display/dc/dcn10/amdgpu_dcn10_resource.c cvs rdiff -u -r1.2 -r1.3 \ src/sys/external/bsd/drm2/dist/drm/amd/display/dc/dcn20/amdgpu_dcn20_hwseq.c \ src/sys/external/bsd/drm2/dist/drm/amd/display/dc/dcn20/amdgpu_dcn20_resource.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/drm_gem.c diff -u src/sys/external/bsd/drm2/dist/drm/drm_gem.c:1.20 src/sys/external/bsd/drm2/dist/drm/drm_gem.c:1.21 --- src/sys/external/bsd/drm2/dist/drm/drm_gem.c:1.20 Sun Dec 19 11:07:28 2021 +++ src/sys/external/bsd/drm2/dist/drm/drm_gem.c Sun Dec 19 11:26:14 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: drm_gem.c,v 1.20 2021/12/19 11:07:28 riastradh Exp $ */ +/* $NetBSD: drm_gem.c,v 1.21 2021/12/19 11:26:14 riastradh Exp $ */ /* * Copyright © 2008 Intel Corporation @@ -28,7 +28,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: drm_gem.c,v 1.20 2021/12/19 11:07:28 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: drm_gem.c,v 1.21 2021/12/19 11:26:14 riastradh Exp $"); #include #include @@ -188,7 +188,8 @@ void drm_gem_private_object_init(struct obj->filp = NULL; KASSERT(drm_core_check_feature(dev, DRIVER_GEM)); KASSERT(dev->driver->gem_uvm_ops != NULL); - uvm_obj_init(>gemo_uvmobj, dev->driver->gem_uvm_ops, true, 1); + uvm_obj_init(>gemo_uvmobj, dev->driver->gem_uvm_ops, + /*allocate lock*/true, /*nrefs*/1); #else obj->filp = NULL; #endif @@ -1065,7 +1066,7 @@ drm_gem_object_release(struct drm_gem_ob drm_vma_node_destroy(>vma_node); if (obj->filp) uao_detach(obj->filp); - uvm_obj_destroy(>gemo_uvmobj, true); + uvm_obj_destroy(>gemo_uvmobj, /*free lock*/true); #else if (obj->filp) fput(obj->filp); Index: src/sys/external/bsd/drm2/dist/drm/amd/display/dc/dcn10/amdgpu_dcn10_resource.c diff -u src/sys/external/bsd/drm2/dist/drm/amd/display/dc/dcn10/amdgpu_dcn10_resource.c:1.2 src/sys/external/bsd/drm2/dist/drm/amd/display/dc/dcn10/amdgpu_dcn10_resource.c:1.3 --- src/sys/external/bsd/drm2/dist/drm/amd/display/dc/dcn10/amdgpu_dcn10_resource.c:1.2 Sat Dec 18 23:45:03 2021 +++ src/sys/external/bsd/drm2/dist/drm/amd/display/dc/dcn10/amdgpu_dcn10_resource.c Sun Dec 19 11:26:14 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: amdgpu_dcn10_resource.c,v 1.2 2021/12/18 23:45:03 riastradh Exp $ */ +/* $NetBSD: amdgpu_dcn10_resource.c,v 1.3 2021/12/19 11:26:14 riastradh Exp $ */ /* * Copyright 2016 Advanced Micro Devices, Inc. @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: amdgpu_dcn10_resource.c,v 1.2 2021/12/18 23:45:03 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: amdgpu_dcn10_resource.c,v 1.3 2021/12/19 11:26:14 riastradh Exp $"); #include @@ -256,6 +256,8 @@ static const struct dcn10_stream_encoder SE_COMMON_MASK_SH_LIST_DCN10(_MASK) }; +#ifndef __NetBSD__ /* XXX amdgpu audio */ + #define audio_regs(id)\ [id] = {\ AUD_COMMON_REG_LIST(id)\ @@ -281,6 +283,8 @@ static const struct dce_audio_mask audio DCE120_AUD_COMMON_MASK_SH_LIST(_MASK) }; +#endif + #define aux_regs(id)\ [id] = {\ AUX_REG_LIST(id)\ @@ -843,12 +847,14 @@ static void read_dce_straps( FN(DC_PINSTRAPS, DC_PINSTRAPS_AUDIO), >dc_pinstraps_audio); } +#ifndef __NetBSD__ /* XXX amdgpu audio */ static struct audio *create_audio( struct dc_context *ctx, unsigned int inst) { return dce_audio_create(ctx, inst, _regs[inst], _shift, _mask); } +#endif static struct stream_encoder *dcn10_stream_encoder_create( enum engine_id eng_id, @@ -897,14 +903,18 @@ static struct dce_hwseq *dcn10_hwseq_cre static const struct resource_create_funcs res_create_funcs = { .read_dce_straps = read_dce_straps, +#ifndef __NetBSD__ /* XXX amdgpu audio */ .create_audio = create_audio, +#endif .create_stream_encoder = dcn10_stream_encoder_create, .create_hwseq = dcn10_hwseq_create, }; static const struct resource_create_funcs res_create_maximus_funcs = { .read_dce_straps = NULL, +#ifndef __NetBSD__ /* XXX amdgpu audio */ .create_audio = NULL, +#endif .create_stream_encoder = NULL, .create_hwseq = dcn10_hwseq_create, }; @@ -986,8 +996,10 @@ static void dcn10_resource_destruct(stru } for (i = 0; i < pool->base.audio_count; i++) { +#ifndef __NetBSD__ /* XXX amdgpu audio */ if (pool->base.audios[i]) dce_aud_destroy(>base.audios[i]); +#endif }
CVS commit: src/sys/external/bsd/drm2/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:26:42 UTC 2021 Modified Files: src/sys/external/bsd/drm2/include/linux: atomic.h Log Message: linux: Make xchg and cmpxchg work on pointers too. To generate a diff of this commit: cvs rdiff -u -r1.37 -r1.38 src/sys/external/bsd/drm2/include/linux/atomic.h 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/include/linux/atomic.h diff -u src/sys/external/bsd/drm2/include/linux/atomic.h:1.37 src/sys/external/bsd/drm2/include/linux/atomic.h:1.38 --- src/sys/external/bsd/drm2/include/linux/atomic.h:1.37 Sun Dec 19 11:16:00 2021 +++ src/sys/external/bsd/drm2/include/linux/atomic.h Sun Dec 19 11:26:42 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: atomic.h,v 1.37 2021/12/19 11:16:00 riastradh Exp $ */ +/* $NetBSD: atomic.h,v 1.38 2021/12/19 11:26:42 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -39,13 +39,17 @@ #include #define xchg(P, V) \ - (sizeof(*(P)) == 4 ? atomic_swap_32((volatile uint32_t *)P, V) \ - : sizeof(*(P)) == 8 ? atomic_swap_64((volatile uint64_t *)P, V) \ + (sizeof(*(P)) == 4 ? atomic_swap_32((volatile uint32_t *)(P), \ + (uint32_t)(V)) \ + : sizeof(*(P)) == 8 ? atomic_swap_64((volatile uint64_t *)(P),\ + (uint64_t)(V)) \ : (__builtin_abort(), 0)) #define cmpxchg(P, O, N) \ - (sizeof(*(P)) == 4 ? atomic_cas_32((volatile uint32_t *)P, O, N) \ - : sizeof(*(P)) == 8 ? atomic_cas_64((volatile uint64_t *)P, O, N) \ + (sizeof(*(P)) == 4 ? atomic_cas_32((volatile uint32_t *)(P), \ + (uint32_t)(O), (uint32_t)(N)) \ + : sizeof(*(P)) == 8 ? atomic_cas_64((volatile uint64_t *)(P), \ + (uint64_t)(O), (uint64_t)(N)) \ : (__builtin_abort(), 0)) /*
CVS commit: src/sys/external/bsd/drm2
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:26:50 UTC 2021 Modified Files: src/sys/external/bsd/drm2/include/linux: wait_bit.h src/sys/external/bsd/drm2/linux: linux_wait_bit.c Log Message: linux: Add clear_and_wake_up_bit. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/drm2/include/linux/wait_bit.h cvs rdiff -u -r1.3 -r1.4 src/sys/external/bsd/drm2/linux/linux_wait_bit.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/drm2
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:27:12 UTC 2021 Modified Files: src/sys/external/bsd/drm2/dist/drm/i915/gem: i915_gem_client_blt.c src/sys/external/bsd/drm2/i915drm: files.i915drmkms i915_module.c Log Message: drm/i915: Unhook i915_gem_client_blt.c and revert changes. Only used by self-tests, which we're not using (for now...). To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 \ src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_client_blt.c cvs rdiff -u -r1.66 -r1.67 src/sys/external/bsd/drm2/i915drm/files.i915drmkms cvs rdiff -u -r1.12 -r1.13 src/sys/external/bsd/drm2/i915drm/i915_module.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/i915/gem/i915_gem_client_blt.c diff -u src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_client_blt.c:1.3 src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_client_blt.c:1.4 --- src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_client_blt.c:1.3 Sun Dec 19 11:26:35 2021 +++ src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_client_blt.c Sun Dec 19 11:27:12 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: i915_gem_client_blt.c,v 1.3 2021/12/19 11:26:35 riastradh Exp $ */ +/* $NetBSD: i915_gem_client_blt.c,v 1.4 2021/12/19 11:27:12 riastradh Exp $ */ // SPDX-License-Identifier: MIT /* @@ -6,7 +6,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: i915_gem_client_blt.c,v 1.3 2021/12/19 11:26:35 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: i915_gem_client_blt.c,v 1.4 2021/12/19 11:27:12 riastradh Exp $"); #include "i915_drv.h" #include "gt/intel_context.h" @@ -18,12 +18,7 @@ __KERNEL_RCSID(0, "$NetBSD: i915_gem_cli struct i915_sleeve { struct i915_vma *vma; struct drm_i915_gem_object *obj; -#ifdef __NetBSD__ - struct pglist *pglist; - bus_dmamap_t pages; /* XXX ??? XXX ??? */ -#else struct sg_table *pages; -#endif struct i915_page_sizes page_sizes; }; @@ -176,11 +171,7 @@ static void clear_pages_worker(struct wo if (obj->cache_dirty) { if (i915_gem_object_has_struct_page(obj)) -#ifdef __NetBSD__ - drm_clflush_pglist(w->sleeve->pglist); -#else drm_clflush_sg(w->sleeve->pages); -#endif obj->cache_dirty = false; } obj->read_domains = I915_GEM_GPU_DOMAINS; @@ -267,27 +258,7 @@ clear_pages_work_notify(struct i915_sw_f return NOTIFY_DONE; } -#ifdef __NetBSD__ -/* XXX my kingdom for a non-tentacular link set */ - -static spinlock_t fence_lock; - -void i915_gem_client_blt_init(void); -void -i915_gem_client_blt_init(void) -{ - spin_lock_init(_lock); -} - -void i915_gem_client_blt_fini(void); -void -i915_gem_client_blt_fini(void) -{ - spin_lock_destroy(_lock); -} -#else static DEFINE_SPINLOCK(fence_lock); -#endif /* XXX: better name please */ int i915_gem_schedule_fill_pages_blt(struct drm_i915_gem_object *obj, Index: src/sys/external/bsd/drm2/i915drm/files.i915drmkms diff -u src/sys/external/bsd/drm2/i915drm/files.i915drmkms:1.66 src/sys/external/bsd/drm2/i915drm/files.i915drmkms:1.67 --- src/sys/external/bsd/drm2/i915drm/files.i915drmkms:1.66 Sun Dec 19 11:20:18 2021 +++ src/sys/external/bsd/drm2/i915drm/files.i915drmkms Sun Dec 19 11:27:12 2021 @@ -1,4 +1,4 @@ -# $NetBSD: files.i915drmkms,v 1.66 2021/12/19 11:20:18 riastradh Exp $ +# $NetBSD: files.i915drmkms,v 1.67 2021/12/19 11:27:12 riastradh Exp $ version 20180827 @@ -113,7 +113,7 @@ file external/bsd/drm2/dist/drm/i915/dis #file external/bsd/drm2/dist/drm/i915/display/vlv_dsi_pll.c i915drmkms file external/bsd/drm2/dist/drm/i915/gem/i915_gem_busy.c i915drmkms file external/bsd/drm2/dist/drm/i915/gem/i915_gem_clflush.c i915drmkms -file external/bsd/drm2/dist/drm/i915/gem/i915_gem_client_blt.c i915drmkms +#file external/bsd/drm2/dist/drm/i915/gem/i915_gem_client_blt.c i915drmkms file external/bsd/drm2/dist/drm/i915/gem/i915_gem_context.c i915drmkms file external/bsd/drm2/dist/drm/i915/gem/i915_gem_dmabuf.c i915drmkms file external/bsd/drm2/dist/drm/i915/gem/i915_gem_domain.c i915drmkms Index: src/sys/external/bsd/drm2/i915drm/i915_module.c diff -u src/sys/external/bsd/drm2/i915drm/i915_module.c:1.12 src/sys/external/bsd/drm2/i915drm/i915_module.c:1.13 --- src/sys/external/bsd/drm2/i915drm/i915_module.c:1.12 Sun Dec 19 11:26:35 2021 +++ src/sys/external/bsd/drm2/i915drm/i915_module.c Sun Dec 19 11:27:12 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: i915_module.c,v 1.12 2021/12/19 11:26:35 riastradh Exp $ */ +/* $NetBSD: i915_module.c,v 1.13 2021/12/19 11:27:12 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: i915_module.c,v 1.12 2021/12/19 11:26:35 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: i915_module.c,v 1.13 2021/12/19 11:27:12 riastradh Exp $"); #include #include @@ -53,8 +53,6 @@ MODULE(MODULE_CLASS_DRIVER, i915drmkms, struct drm_sysctl_def i915_def = DRM_SYSCTL_INIT();
CVS commit: src/sys/external/bsd/drm2/dist/drm/i915
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:27:20 UTC 2021 Modified Files: src/sys/external/bsd/drm2/dist/drm/i915: i915_gem_evict.c src/sys/external/bsd/drm2/dist/drm/i915/gem: i915_gem_context.c i915_gem_dmabuf.c Log Message: drm/i915: Misc build fixes. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 \ src/sys/external/bsd/drm2/dist/drm/i915/i915_gem_evict.c cvs rdiff -u -r1.3 -r1.4 \ src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_context.c \ src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_dmabuf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/drm2
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:26:50 UTC 2021 Modified Files: src/sys/external/bsd/drm2/include/linux: wait_bit.h src/sys/external/bsd/drm2/linux: linux_wait_bit.c Log Message: linux: Add clear_and_wake_up_bit. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/drm2/include/linux/wait_bit.h cvs rdiff -u -r1.3 -r1.4 src/sys/external/bsd/drm2/linux/linux_wait_bit.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/include/linux/wait_bit.h diff -u src/sys/external/bsd/drm2/include/linux/wait_bit.h:1.2 src/sys/external/bsd/drm2/include/linux/wait_bit.h:1.3 --- src/sys/external/bsd/drm2/include/linux/wait_bit.h:1.2 Sun Dec 19 01:42:01 2021 +++ src/sys/external/bsd/drm2/include/linux/wait_bit.h Sun Dec 19 11:26:50 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: wait_bit.h,v 1.2 2021/12/19 01:42:01 riastradh Exp $ */ +/* $NetBSD: wait_bit.h,v 1.3 2021/12/19 11:26:50 riastradh Exp $ */ /*- * Copyright (c) 2018 The NetBSD Foundation, Inc. @@ -32,6 +32,7 @@ #ifndef _LINUX_WAIT_BIT_H_ #define _LINUX_WAIT_BIT_H_ +#define clear_and_wake_up_bit linux_clear_and_wake_up_bit #define wait_on_bit linux_wait_on_bit #define wait_on_bit_timeout linux_wait_on_bit_timeout #define wake_up_bit linux_wake_up_bit @@ -40,6 +41,7 @@ int linux_wait_bit_init(void); void linux_wait_bit_fini(void); void wake_up_bit(const volatile unsigned long *, unsigned); +void clear_and_wake_up_bit(int, volatile unsigned long *); int wait_on_bit(const volatile unsigned long *, unsigned, int); int wait_on_bit_timeout(const volatile unsigned long *, unsigned, int, unsigned long); Index: src/sys/external/bsd/drm2/linux/linux_wait_bit.c diff -u src/sys/external/bsd/drm2/linux/linux_wait_bit.c:1.3 src/sys/external/bsd/drm2/linux/linux_wait_bit.c:1.4 --- src/sys/external/bsd/drm2/linux/linux_wait_bit.c:1.3 Sun Dec 19 01:42:02 2021 +++ src/sys/external/bsd/drm2/linux/linux_wait_bit.c Sun Dec 19 11:26:50 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_wait_bit.c,v 1.3 2021/12/19 01:42:02 riastradh Exp $ */ +/* $NetBSD: linux_wait_bit.c,v 1.4 2021/12/19 11:26:50 riastradh Exp $ */ /*- * Copyright (c) 2018 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: linux_wait_bit.c,v 1.3 2021/12/19 01:42:02 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_wait_bit.c,v 1.4 2021/12/19 11:26:50 riastradh Exp $"); #include #include @@ -114,6 +114,17 @@ wake_up_bit(const volatile unsigned long wait_bit_exit(wbe); } +void +clear_and_wake_up_bit(int bit, volatile unsigned long *bitmap) +{ + struct waitbitentry *wbe; + + wbe = wait_bit_enter(bitmap, bit); + clear_bit(bit, bitmap); + cv_broadcast(>cv); + wait_bit_exit(wbe); +} + int wait_on_bit(const volatile unsigned long *bitmap, unsigned bit, int flags) {
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:26:57 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: compiler.h Log Message: linux: Add __same_type and __must_be_array. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/external/bsd/common/include/linux/compiler.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/common/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:26:57 UTC 2021 Modified Files: src/sys/external/bsd/common/include/linux: compiler.h Log Message: linux: Add __same_type and __must_be_array. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/external/bsd/common/include/linux/compiler.h 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/common/include/linux/compiler.h diff -u src/sys/external/bsd/common/include/linux/compiler.h:1.5 src/sys/external/bsd/common/include/linux/compiler.h:1.6 --- src/sys/external/bsd/common/include/linux/compiler.h:1.5 Sun Dec 19 11:10:01 2021 +++ src/sys/external/bsd/common/include/linux/compiler.h Sun Dec 19 11:26:57 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: compiler.h,v 1.5 2021/12/19 11:10:01 riastradh Exp $ */ +/* $NetBSD: compiler.h,v 1.6 2021/12/19 11:26:57 riastradh Exp $ */ /*- * Copyright (c) 2018 The NetBSD Foundation, Inc. @@ -54,6 +54,10 @@ #define barrier() __insn_barrier() #define likely(X) __predict_true(X) #define unlikely(X) __predict_false(X) +#define __same_type(X,Y) \ + __builtin_types_compatible_p(__typeof__(X), __typeof__(Y)) +#define __must_be_array(X) \ + BUILD_BUG_ON_ZERO(__same_type((X), &(X)[0])) #define READ_ONCE(X) ({ \ typeof(X) __read_once_tmp = (X); \
CVS commit: src/sys/external/bsd/drm2/dist/drm/ttm
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:25:57 UTC 2021 Modified Files: src/sys/external/bsd/drm2/dist/drm/ttm: ttm_bo_util.c Log Message: Apparently vunmap needs an argument which is num pages... one? Author: Maya Rashish Committer: Taylor R Campbell To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 \ src/sys/external/bsd/drm2/dist/drm/ttm/ttm_bo_util.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/ttm/ttm_bo_util.c diff -u src/sys/external/bsd/drm2/dist/drm/ttm/ttm_bo_util.c:1.26 src/sys/external/bsd/drm2/dist/drm/ttm/ttm_bo_util.c:1.27 --- src/sys/external/bsd/drm2/dist/drm/ttm/ttm_bo_util.c:1.26 Sun Dec 19 11:22:08 2021 +++ src/sys/external/bsd/drm2/dist/drm/ttm/ttm_bo_util.c Sun Dec 19 11:25:57 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: ttm_bo_util.c,v 1.26 2021/12/19 11:22:08 riastradh Exp $ */ +/* $NetBSD: ttm_bo_util.c,v 1.27 2021/12/19 11:25:57 riastradh Exp $ */ /* SPDX-License-Identifier: GPL-2.0 OR MIT */ /** @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ttm_bo_util.c,v 1.26 2021/12/19 11:22:08 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ttm_bo_util.c,v 1.27 2021/12/19 11:25:57 riastradh Exp $"); #include #include @@ -323,7 +323,7 @@ static int ttm_copy_io_page(void *dst, v #define __ttm_kunmap_atomic(__addr) kunmap_atomic(__addr) #else #define __ttm_kmap_atomic_prot(__page, __prot) vmap(&__page, 1, 0, __prot) -#define __ttm_kunmap_atomic(__addr) vunmap(__addr) +#define __ttm_kunmap_atomic(__addr) vunmap(__addr, 1) #endif
CVS commit: src/sys/external/bsd/vchiq/dist/interface/compat
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:26:04 UTC 2021 Modified Files: src/sys/external/bsd/vchiq/dist/interface/compat: vchi_bsd.h Log Message: Don't redefine stuff that common now has Preferring common to avoid licensing mish-mash Author: Maya Rashish Committer: Taylor R Campbell To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 \ src/sys/external/bsd/vchiq/dist/interface/compat/vchi_bsd.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/drm2/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:27:04 UTC 2021 Modified Files: src/sys/external/bsd/drm2/include/linux: xarray.h Log Message: linux: Define XA_FLAGS_ALLOC to 0 for now. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/external/bsd/drm2/include/linux/xarray.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/drm2/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:27:04 UTC 2021 Modified Files: src/sys/external/bsd/drm2/include/linux: xarray.h Log Message: linux: Define XA_FLAGS_ALLOC to 0 for now. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/external/bsd/drm2/include/linux/xarray.h 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/include/linux/xarray.h diff -u src/sys/external/bsd/drm2/include/linux/xarray.h:1.5 src/sys/external/bsd/drm2/include/linux/xarray.h:1.6 --- src/sys/external/bsd/drm2/include/linux/xarray.h:1.5 Sun Dec 19 11:00:10 2021 +++ src/sys/external/bsd/drm2/include/linux/xarray.h Sun Dec 19 11:27:04 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: xarray.h,v 1.5 2021/12/19 11:00:10 riastradh Exp $ */ +/* $NetBSD: xarray.h,v 1.6 2021/12/19 11:27:04 riastradh Exp $ */ /*- * Copyright (c) 2020 The NetBSD Foundation, Inc. @@ -52,6 +52,8 @@ struct xa_limit { (ENTRY) != NULL; \ (ENTRY) = xa_find_after((XA), &(INDEX), ULONG_MAX, 0)) +#define XA_FLAGS_ALLOC 0 + #define xa_alloc linux_xa_alloc #define xa_erase linux_xa_erase #define xa_find linux_xa_find
CVS commit: src/sys/external/bsd/drm2
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:27:12 UTC 2021 Modified Files: src/sys/external/bsd/drm2/dist/drm/i915/gem: i915_gem_client_blt.c src/sys/external/bsd/drm2/i915drm: files.i915drmkms i915_module.c Log Message: drm/i915: Unhook i915_gem_client_blt.c and revert changes. Only used by self-tests, which we're not using (for now...). To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 \ src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_client_blt.c cvs rdiff -u -r1.66 -r1.67 src/sys/external/bsd/drm2/i915drm/files.i915drmkms cvs rdiff -u -r1.12 -r1.13 src/sys/external/bsd/drm2/i915drm/i915_module.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/drm2/dist/drm/i915/gt
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:47:41 UTC 2021 Modified Files: src/sys/external/bsd/drm2/dist/drm/i915/gt: intel_lrc.c Log Message: bus-space-ify Author: Maya Rashish Committer: Taylor R Campbell To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 \ src/sys/external/bsd/drm2/dist/drm/i915/gt/intel_lrc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/drm2/dist/drm/i915/gt
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:47:41 UTC 2021 Modified Files: src/sys/external/bsd/drm2/dist/drm/i915/gt: intel_lrc.c Log Message: bus-space-ify Author: Maya Rashish Committer: Taylor R Campbell To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 \ src/sys/external/bsd/drm2/dist/drm/i915/gt/intel_lrc.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/i915/gt/intel_lrc.c diff -u src/sys/external/bsd/drm2/dist/drm/i915/gt/intel_lrc.c:1.5 src/sys/external/bsd/drm2/dist/drm/i915/gt/intel_lrc.c:1.6 --- src/sys/external/bsd/drm2/dist/drm/i915/gt/intel_lrc.c:1.5 Sun Dec 19 11:47:16 2021 +++ src/sys/external/bsd/drm2/dist/drm/i915/gt/intel_lrc.c Sun Dec 19 11:47:40 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: intel_lrc.c,v 1.5 2021/12/19 11:47:16 riastradh Exp $ */ +/* $NetBSD: intel_lrc.c,v 1.6 2021/12/19 11:47:40 riastradh Exp $ */ /* * Copyright © 2014 Intel Corporation @@ -134,7 +134,7 @@ * */ #include -__KERNEL_RCSID(0, "$NetBSD: intel_lrc.c,v 1.5 2021/12/19 11:47:16 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: intel_lrc.c,v 1.6 2021/12/19 11:47:40 riastradh Exp $"); #include @@ -1521,7 +1521,11 @@ static void execlists_submit_ports(struc /* we need to manually load the submit queue */ if (execlists->ctrl_reg) +#ifdef __NetBSD__ + bus_space_write_4(execlists->bst, execlists->bsh, execlists->ctrl_reg, EL_CTRL_LOAD); +#else writel(EL_CTRL_LOAD, execlists->ctrl_reg); +#endif } static bool ctx_single_port_submission(const struct intel_context *ce)
CVS commit: src/sys/external/bsd/drm2/dist/drm/i915
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:47:48 UTC 2021 Modified Files: src/sys/external/bsd/drm2/dist/drm/i915: intel_memory_region.c Log Message: nbsd-namespace.h Author: Maya Rashish Committer: Taylor R Campbell To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 \ src/sys/external/bsd/drm2/dist/drm/i915/intel_memory_region.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/drm2/dist/drm/i915
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:47:48 UTC 2021 Modified Files: src/sys/external/bsd/drm2/dist/drm/i915: intel_memory_region.c Log Message: nbsd-namespace.h Author: Maya Rashish Committer: Taylor R Campbell To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 \ src/sys/external/bsd/drm2/dist/drm/i915/intel_memory_region.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/i915/intel_memory_region.c diff -u src/sys/external/bsd/drm2/dist/drm/i915/intel_memory_region.c:1.3 src/sys/external/bsd/drm2/dist/drm/i915/intel_memory_region.c:1.4 --- src/sys/external/bsd/drm2/dist/drm/i915/intel_memory_region.c:1.3 Sun Dec 19 10:28:41 2021 +++ src/sys/external/bsd/drm2/dist/drm/i915/intel_memory_region.c Sun Dec 19 11:47:48 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: intel_memory_region.c,v 1.3 2021/12/19 10:28:41 riastradh Exp $ */ +/* $NetBSD: intel_memory_region.c,v 1.4 2021/12/19 11:47:48 riastradh Exp $ */ // SPDX-License-Identifier: MIT /* @@ -6,11 +6,13 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: intel_memory_region.c,v 1.3 2021/12/19 10:28:41 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: intel_memory_region.c,v 1.4 2021/12/19 11:47:48 riastradh Exp $"); #include "intel_memory_region.h" #include "i915_drv.h" +#include + /* XXX: Hysterical raisins. BIT(inst) needs to just be (inst) at some point. */ #define REGION_MAP(type, inst) \ BIT((type) + INTEL_MEMORY_TYPE_SHIFT) | BIT(inst)
CVS commit: src/sys/external/bsd/drm2/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:47:55 UTC 2021 Modified Files: src/sys/external/bsd/drm2/include/linux: spinlock.h Log Message: provide spin_trylock_irqsave Author: Maya Rashish Committer: Taylor R Campbell To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/sys/external/bsd/drm2/include/linux/spinlock.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/drm2/dist/drm/i915/gt
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:46:47 UTC 2021 Modified Files: src/sys/external/bsd/drm2/dist/drm/i915/gt: intel_engine_types.h intel_lrc.c Log Message: Bus-space-ify Author: Maya Rashish Committer: Taylor R Campbell To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 \ src/sys/external/bsd/drm2/dist/drm/i915/gt/intel_engine_types.h cvs rdiff -u -r1.3 -r1.4 \ src/sys/external/bsd/drm2/dist/drm/i915/gt/intel_lrc.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/i915/gt/intel_engine_types.h diff -u src/sys/external/bsd/drm2/dist/drm/i915/gt/intel_engine_types.h:1.5 src/sys/external/bsd/drm2/dist/drm/i915/gt/intel_engine_types.h:1.6 --- src/sys/external/bsd/drm2/dist/drm/i915/gt/intel_engine_types.h:1.5 Sun Dec 19 11:13:22 2021 +++ src/sys/external/bsd/drm2/dist/drm/i915/gt/intel_engine_types.h Sun Dec 19 11:46:47 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: intel_engine_types.h,v 1.5 2021/12/19 11:13:22 riastradh Exp $ */ +/* $NetBSD: intel_engine_types.h,v 1.6 2021/12/19 11:46:47 riastradh Exp $ */ /* * SPDX-License-Identifier: MIT @@ -166,9 +166,11 @@ struct intel_engine_execlists { bool no_priolist; #ifdef __NetBSD__ -# define __iomem -#endif - + bus_space_tag_t bst; + bus_space_handle_t bsh; + bus_size_t submit_reg; + bus_size_t ctrl_reg; +#else /** * @submit_reg: gen-specific execlist submission register * set to the ExecList Submission Port (elsp) register pre-Gen11 and to @@ -181,9 +183,6 @@ struct intel_engine_execlists { * submit queue on the HW and to request preemptions to idle */ u32 __iomem *ctrl_reg; - -#ifdef __NetBSD__ -# undef __iomem #endif #define EXECLIST_MAX_PORTS 2 Index: src/sys/external/bsd/drm2/dist/drm/i915/gt/intel_lrc.c diff -u src/sys/external/bsd/drm2/dist/drm/i915/gt/intel_lrc.c:1.3 src/sys/external/bsd/drm2/dist/drm/i915/gt/intel_lrc.c:1.4 --- src/sys/external/bsd/drm2/dist/drm/i915/gt/intel_lrc.c:1.3 Sun Dec 19 11:37:50 2021 +++ src/sys/external/bsd/drm2/dist/drm/i915/gt/intel_lrc.c Sun Dec 19 11:46:47 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: intel_lrc.c,v 1.3 2021/12/19 11:37:50 riastradh Exp $ */ +/* $NetBSD: intel_lrc.c,v 1.4 2021/12/19 11:46:47 riastradh Exp $ */ /* * Copyright © 2014 Intel Corporation @@ -134,7 +134,7 @@ * */ #include -__KERNEL_RCSID(0, "$NetBSD: intel_lrc.c,v 1.3 2021/12/19 11:37:50 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: intel_lrc.c,v 1.4 2021/12/19 11:46:47 riastradh Exp $"); #include @@ -1370,6 +1370,15 @@ static u64 execlists_update_context(stru static inline void write_desc(struct intel_engine_execlists *execlists, u64 desc, u32 port) { +#ifdef __NetBSD__ + if (execlists->ctrl_reg) { + bus_space_write_4(execlists->bst, execlists->bsh, execlists->submit_reg + port * 2, lower_32_bits(desc)); + bus_space_write_4(execlists->bst, execlists->bsh, execlists->submit_reg + port * 2 + 1, upper_32_bits(desc)); + } else { + bus_space_write_4(execlists->bst, execlists->bsh, execlists->submit_reg, upper_32_bits(desc)); + bus_space_write_4(execlists->bst, execlists->bsh, execlists->submit_reg, lower_32_bits(desc)); + } +#else if (execlists->ctrl_reg) { writel(lower_32_bits(desc), execlists->submit_reg + port * 2); writel(upper_32_bits(desc), execlists->submit_reg + port * 2 + 1); @@ -1377,6 +1386,7 @@ static inline void write_desc(struct int writel(upper_32_bits(desc), execlists->submit_reg); writel(lower_32_bits(desc), execlists->submit_reg); } +#endif } static __maybe_unused void @@ -4348,13 +4358,26 @@ int intel_execlists_submission_setup(str DRM_ERROR("WA batch buffer initialization failed\n"); if (HAS_LOGICAL_RING_ELSQ(i915)) { +#ifdef __NetBSD__ + execlists->submit_reg = i915_mmio_reg_offset(RING_EXECLIST_SQ_CONTENTS(base)); + execlists->ctrl_reg = i915_mmio_reg_offset(RING_EXECLIST_CONTROL(base)); + execlists->bsh = uncore->regs_bsh; + execlists->bst = uncore->regs_bst; +#else execlists->submit_reg = uncore->regs + i915_mmio_reg_offset(RING_EXECLIST_SQ_CONTENTS(base)); execlists->ctrl_reg = uncore->regs + i915_mmio_reg_offset(RING_EXECLIST_CONTROL(base)); +#endif } else { +#ifdef __NetBSD__ + execlists->submit_reg = i915_mmio_reg_offset(RING_ELSP(base)); + execlists->bsh = uncore->regs_bsh; + execlists->bst = uncore->regs_bst; +#else execlists->submit_reg = uncore->regs + i915_mmio_reg_offset(RING_ELSP(base)); +#endif } execlists->csb_status =
CVS commit: src/sys/external/bsd/drm2/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:46:58 UTC 2021 Modified Files: src/sys/external/bsd/drm2/include/linux: mm.h Log Message: Cast, because we get passed void* Author: Maya Rashish Committer: Taylor R Campbell To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/sys/external/bsd/drm2/include/linux/mm.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/drm2/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:46:58 UTC 2021 Modified Files: src/sys/external/bsd/drm2/include/linux: mm.h Log Message: Cast, because we get passed void* Author: Maya Rashish Committer: Taylor R Campbell To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/sys/external/bsd/drm2/include/linux/mm.h 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/include/linux/mm.h diff -u src/sys/external/bsd/drm2/include/linux/mm.h:1.21 src/sys/external/bsd/drm2/include/linux/mm.h:1.22 --- src/sys/external/bsd/drm2/include/linux/mm.h:1.21 Sun Dec 19 11:33:49 2021 +++ src/sys/external/bsd/drm2/include/linux/mm.h Sun Dec 19 11:46:58 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: mm.h,v 1.21 2021/12/19 11:33:49 riastradh Exp $ */ +/* $NetBSD: mm.h,v 1.22 2021/12/19 11:46:58 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -49,7 +49,7 @@ struct file; #define PAGE_MASK (~(PAGE_SIZE-1)) #define PAGE_ALIGN(x) (((x) + (PAGE_SIZE-1)) & ~(PAGE_SIZE-1)) -#define offset_in_page(x) ((x) & (PAGE_SIZE-1)) +#define offset_in_page(x) ((uintptr_t)(x) & (PAGE_SIZE-1)) #define untagged_addr(x) (x)
CVS commit: src/sys/external/bsd/drm2
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:47:08 UTC 2021 Modified Files: src/sys/external/bsd/drm2/include/linux: notifier.h src/sys/external/bsd/drm2/linux: linux_notifier.c Log Message: Match function name to code Author: Maya Rashish Committer: Taylor R Campbell To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/external/bsd/drm2/include/linux/notifier.h cvs rdiff -u -r1.1 -r1.2 src/sys/external/bsd/drm2/linux/linux_notifier.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/drm2/dist/drm/i915/display
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:47:25 UTC 2021 Modified Files: src/sys/external/bsd/drm2/dist/drm/i915/display: intel_opregion.c Log Message: Undo local diffs, re-do local diffs Author: Maya Rashish Committer: Taylor R Campbell To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 \ src/sys/external/bsd/drm2/dist/drm/i915/display/intel_opregion.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/i915/display/intel_opregion.c diff -u src/sys/external/bsd/drm2/dist/drm/i915/display/intel_opregion.c:1.2 src/sys/external/bsd/drm2/dist/drm/i915/display/intel_opregion.c:1.3 --- src/sys/external/bsd/drm2/dist/drm/i915/display/intel_opregion.c:1.2 Sat Dec 18 23:45:30 2021 +++ src/sys/external/bsd/drm2/dist/drm/i915/display/intel_opregion.c Sun Dec 19 11:47:25 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: intel_opregion.c,v 1.2 2021/12/18 23:45:30 riastradh Exp $ */ +/* $NetBSD: intel_opregion.c,v 1.3 2021/12/19 11:47:25 riastradh Exp $ */ /* * Copyright 2008 Intel Corporation @@ -28,7 +28,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: intel_opregion.c,v 1.2 2021/12/18 23:45:30 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: intel_opregion.c,v 1.3 2021/12/19 11:47:25 riastradh Exp $"); #include #include @@ -275,13 +275,13 @@ struct opregion_asle_ext { static int swsci(struct drm_i915_private *dev_priv, u32 function, u32 parm, u32 *parm_out) { - struct drm_i915_private *dev_priv = dev->dev_private; struct opregion_swsci *swsci = dev_priv->opregion.swsci; + struct pci_dev *pdev = dev_priv->drm.pdev; u32 main_function, sub_function, scic; u16 swsci_val; u32 dslp; - if (!region_swsci) + if (!swsci) return -ENODEV; main_function = (function & SWSCI_SCIC_MAIN_FUNCTION_MASK) >> @@ -301,7 +301,7 @@ static int swsci(struct drm_i915_private } /* Driver sleep timeout in ms. */ - dslp = region_swsci->dslp; + dslp = swsci->dslp; if (!dslp) { /* The spec says 2ms should be the default, but it's too small * for some machines. */ @@ -314,7 +314,7 @@ static int swsci(struct drm_i915_private } /* The spec tells us to do this, but we are the only user... */ - scic = region_swsci->scic; + scic = swsci->scic; if (scic & SWSCI_SCIC_INDICATOR) { DRM_DEBUG_DRIVER("SWSCI request already in progress\n"); return -EBUSY; @@ -322,8 +322,8 @@ static int swsci(struct drm_i915_private scic = function | SWSCI_SCIC_INDICATOR; - region_swsci->parm = parm; - region_swsci->scic = scic; + swsci->parm = parm; + swsci->scic = scic; /* Ensure SCI event is selected and event trigger is cleared. */ pci_read_config_word(pdev, SWSCI, _val); @@ -338,7 +338,7 @@ static int swsci(struct drm_i915_private pci_write_config_word(pdev, SWSCI, swsci_val); /* Poll for the result. */ -#define C (((scic = region_swsci->scic) & SWSCI_SCIC_INDICATOR) == 0) +#define C (((scic = swsci->scic) & SWSCI_SCIC_INDICATOR) == 0) if (wait_for(C, dslp)) { DRM_DEBUG_DRIVER("SWSCI request timed out\n"); return -ETIMEDOUT; @@ -354,7 +354,7 @@ static int swsci(struct drm_i915_private } if (parm_out) - *parm_out = region_swsci->parm; + *parm_out = swsci->parm; return 0; @@ -622,6 +622,8 @@ void intel_opregion_asle_intr(struct drm #define ACPI_EV_LID(1<<1) #define ACPI_EV_DOCK (1<<2) +static struct intel_opregion *system_opregion; + #ifdef __NetBSD__ static void intel_opregion_video_event(ACPI_HANDLE hdl, uint32_t notify, void *opaque)
CVS commit: src/sys/external/bsd/drm2/dist/drm/i915/display
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:47:33 UTC 2021 Modified Files: src/sys/external/bsd/drm2/dist/drm/i915/display: intel_lspcon.c Log Message: Make const compiler warnings happier Author: Maya Rashish Committer: Taylor R Campbell To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 \ src/sys/external/bsd/drm2/dist/drm/i915/display/intel_lspcon.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/drm2/dist/drm/i915/display
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:47:33 UTC 2021 Modified Files: src/sys/external/bsd/drm2/dist/drm/i915/display: intel_lspcon.c Log Message: Make const compiler warnings happier Author: Maya Rashish Committer: Taylor R Campbell To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 \ src/sys/external/bsd/drm2/dist/drm/i915/display/intel_lspcon.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/i915/display/intel_lspcon.c diff -u src/sys/external/bsd/drm2/dist/drm/i915/display/intel_lspcon.c:1.2 src/sys/external/bsd/drm2/dist/drm/i915/display/intel_lspcon.c:1.3 --- src/sys/external/bsd/drm2/dist/drm/i915/display/intel_lspcon.c:1.2 Sat Dec 18 23:45:30 2021 +++ src/sys/external/bsd/drm2/dist/drm/i915/display/intel_lspcon.c Sun Dec 19 11:47:33 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: intel_lspcon.c,v 1.2 2021/12/18 23:45:30 riastradh Exp $ */ +/* $NetBSD: intel_lspcon.c,v 1.3 2021/12/19 11:47:33 riastradh Exp $ */ /* * Copyright © 2016 Intel Corporation @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: intel_lspcon.c,v 1.2 2021/12/18 23:45:30 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: intel_lspcon.c,v 1.3 2021/12/19 11:47:33 riastradh Exp $"); #include #include @@ -388,7 +388,7 @@ static bool _lspcon_write_avi_infoframe_ while (val < len) { /* DPCD write for AVI IF can fail on a slow FW day, so retry */ for (retry = 0; retry < 5; retry++) { - ret = drm_dp_dpcd_write(aux, reg, (void *)data, 1); + ret = drm_dp_dpcd_write(aux, reg, (void *)__UNCONST(data), 1); if (ret == 1) { break; } else if (retry < 4) {
CVS commit: src/sys/external/bsd/drm2/dist/drm/i915/display
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:46:20 UTC 2021 Modified Files: src/sys/external/bsd/drm2/dist/drm/i915/display: intel_hdmi.c Log Message: ifdef out sysfs, unused static function Author: Maya Rashish Committer: Taylor R Campbell To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 \ src/sys/external/bsd/drm2/dist/drm/i915/display/intel_hdmi.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/drm2/dist/drm/i915/display
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:46:20 UTC 2021 Modified Files: src/sys/external/bsd/drm2/dist/drm/i915/display: intel_hdmi.c Log Message: ifdef out sysfs, unused static function Author: Maya Rashish Committer: Taylor R Campbell To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 \ src/sys/external/bsd/drm2/dist/drm/i915/display/intel_hdmi.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/i915/display/intel_hdmi.c diff -u src/sys/external/bsd/drm2/dist/drm/i915/display/intel_hdmi.c:1.4 src/sys/external/bsd/drm2/dist/drm/i915/display/intel_hdmi.c:1.5 --- src/sys/external/bsd/drm2/dist/drm/i915/display/intel_hdmi.c:1.4 Sun Dec 19 11:45:50 2021 +++ src/sys/external/bsd/drm2/dist/drm/i915/display/intel_hdmi.c Sun Dec 19 11:46:19 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: intel_hdmi.c,v 1.4 2021/12/19 11:45:50 riastradh Exp $ */ +/* $NetBSD: intel_hdmi.c,v 1.5 2021/12/19 11:46:19 riastradh Exp $ */ /* * Copyright 2006 Dave Airlie @@ -29,7 +29,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: intel_hdmi.c,v 1.4 2021/12/19 11:45:50 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: intel_hdmi.c,v 1.5 2021/12/19 11:46:19 riastradh Exp $"); #include #include @@ -2775,6 +2775,7 @@ static void chv_hdmi_pre_enable(struct i chv_phy_release_cl2_override(encoder); } +#ifndef __NetBSD__ static struct i2c_adapter * intel_hdmi_get_i2c_adapter(struct drm_connector *connector) { @@ -2783,9 +2784,11 @@ intel_hdmi_get_i2c_adapter(struct drm_co return intel_gmbus_get_adapter(dev_priv, intel_hdmi->ddc_bus); } +#endif static void intel_hdmi_create_i2c_symlink(struct drm_connector *connector) { +#ifndef __NetBSD__ /* XXX i915 hdmi sysfs */ struct i2c_adapter *adapter = intel_hdmi_get_i2c_adapter(connector); struct kobject *i2c_kobj = >dev.kobj; struct kobject *connector_kobj = >kdev->kobj; @@ -2794,15 +2797,18 @@ static void intel_hdmi_create_i2c_symlin ret = sysfs_create_link(connector_kobj, i2c_kobj, i2c_kobj->name); if (ret) DRM_ERROR("Failed to create i2c symlink (%d)\n", ret); +#endif } static void intel_hdmi_remove_i2c_symlink(struct drm_connector *connector) { +#ifndef __NetBSD__ /* XXX i915 hdmi sysfs */ struct i2c_adapter *adapter = intel_hdmi_get_i2c_adapter(connector); struct kobject *i2c_kobj = >dev.kobj; struct kobject *connector_kobj = >kdev->kobj; sysfs_remove_link(connector_kobj, i2c_kobj->name); +#endif } static int
CVS commit: src/sys/external/bsd/drm2/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:46:30 UTC 2021 Modified Files: src/sys/external/bsd/drm2/include/linux: cpufreq.h Log Message: Provide cpufreq.h Author: Maya Rashish Committer: Taylor R Campbell To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/drm2/include/linux/cpufreq.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/drm2/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:46:30 UTC 2021 Modified Files: src/sys/external/bsd/drm2/include/linux: cpufreq.h Log Message: Provide cpufreq.h Author: Maya Rashish Committer: Taylor R Campbell To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/drm2/include/linux/cpufreq.h 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/include/linux/cpufreq.h diff -u src/sys/external/bsd/drm2/include/linux/cpufreq.h:1.2 src/sys/external/bsd/drm2/include/linux/cpufreq.h:1.3 --- src/sys/external/bsd/drm2/include/linux/cpufreq.h:1.2 Tue Mar 18 18:20:43 2014 +++ src/sys/external/bsd/drm2/include/linux/cpufreq.h Sun Dec 19 11:46:30 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: cpufreq.h,v 1.2 2014/03/18 18:20:43 riastradh Exp $ */ +/* $NetBSD: cpufreq.h,v 1.3 2021/12/19 11:46:30 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -32,4 +32,31 @@ #ifndef _LINUX_CPUFREQ_H_ #define _LINUX_CPUFREQ_H_ +#include +#include +#include +#include + +struct cpufreq_policy { + struct { + unsigned int max_freq; + } cpuinfo; +}; + +static inline struct cpufreq_policy * +cpufreq_cpu_get(int x) +{ + struct cpufreq_policy *policy = kmem_alloc(sizeof(*policy), KM_SLEEP); + policy->cpuinfo.max_freq = cpufreq_get(curcpu()); + return policy; +} + +static inline void +cpufreq_cpu_put(struct cpufreq_policy *policy) +{ + kmem_free(policy, sizeof(*policy)); +} + +#define tsc_khz cpu_frequency(curcpu()) + #endif /* _LINUX_CPUFREQ_H_ */
CVS commit: src/sys/external/bsd/drm2/dist/drm/i915/gt
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:46:38 UTC 2021 Modified Files: src/sys/external/bsd/drm2/dist/drm/i915/gt: intel_llc_types.h Log Message: Provide an element in struct intel_llc our implementation of container_of doesn't like working with empty structs. Author: Maya Rashish Committer: Taylor R Campbell To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 \ src/sys/external/bsd/drm2/dist/drm/i915/gt/intel_llc_types.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/drm2
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:47:08 UTC 2021 Modified Files: src/sys/external/bsd/drm2/include/linux: notifier.h src/sys/external/bsd/drm2/linux: linux_notifier.c Log Message: Match function name to code Author: Maya Rashish Committer: Taylor R Campbell To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/external/bsd/drm2/include/linux/notifier.h cvs rdiff -u -r1.1 -r1.2 src/sys/external/bsd/drm2/linux/linux_notifier.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/include/linux/notifier.h diff -u src/sys/external/bsd/drm2/include/linux/notifier.h:1.4 src/sys/external/bsd/drm2/include/linux/notifier.h:1.5 --- src/sys/external/bsd/drm2/include/linux/notifier.h:1.4 Sun Dec 19 11:39:24 2021 +++ src/sys/external/bsd/drm2/include/linux/notifier.h Sun Dec 19 11:47:08 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: notifier.h,v 1.4 2021/12/19 11:39:24 riastradh Exp $ */ +/* $NetBSD: notifier.h,v 1.5 2021/12/19 11:47:08 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -65,7 +65,7 @@ void atomic_notifier_chain_register(stru struct notifier_block *); void atomic_notifier_chain_unregister(struct atomic_notifier_head *, struct notifier_block *); -void atomic_notifier_chain_call(struct atomic_notifier_head *, unsigned long, +void atomic_notifier_call_chain(struct atomic_notifier_head *, unsigned long, void *); #endif /* _LINUX_NOTIFIER_H_ */ Index: src/sys/external/bsd/drm2/linux/linux_notifier.c diff -u src/sys/external/bsd/drm2/linux/linux_notifier.c:1.1 src/sys/external/bsd/drm2/linux/linux_notifier.c:1.2 --- src/sys/external/bsd/drm2/linux/linux_notifier.c:1.1 Sun Dec 19 11:39:24 2021 +++ src/sys/external/bsd/drm2/linux/linux_notifier.c Sun Dec 19 11:47:08 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_notifier.c,v 1.1 2021/12/19 11:39:24 riastradh Exp $ */ +/* $NetBSD: linux_notifier.c,v 1.2 2021/12/19 11:47:08 riastradh Exp $ */ /*- * Copyright (c) 2021 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: linux_notifier.c,v 1.1 2021/12/19 11:39:24 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_notifier.c,v 1.2 2021/12/19 11:47:08 riastradh Exp $"); #include @@ -79,7 +79,7 @@ atomic_notifier_chain_unregister(struct } void -atomic_notifier_chain_call(struct atomic_notifier_head *H, +atomic_notifier_call_chain(struct atomic_notifier_head *H, unsigned long arg0, void *arg1) { struct notifier_block *B;
CVS commit: src/sys/external/bsd/drm2/dist/drm/i915/gt
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:47:16 UTC 2021 Modified Files: src/sys/external/bsd/drm2/dist/drm/i915/gt: intel_lrc.c Log Message: Make intel_lrc.c build moar Author: Maya Rashish Committer: Taylor R Campbell To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 \ src/sys/external/bsd/drm2/dist/drm/i915/gt/intel_lrc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/drm2/dist/drm/i915/gt
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:47:16 UTC 2021 Modified Files: src/sys/external/bsd/drm2/dist/drm/i915/gt: intel_lrc.c Log Message: Make intel_lrc.c build moar Author: Maya Rashish Committer: Taylor R Campbell To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 \ src/sys/external/bsd/drm2/dist/drm/i915/gt/intel_lrc.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/i915/gt/intel_lrc.c diff -u src/sys/external/bsd/drm2/dist/drm/i915/gt/intel_lrc.c:1.4 src/sys/external/bsd/drm2/dist/drm/i915/gt/intel_lrc.c:1.5 --- src/sys/external/bsd/drm2/dist/drm/i915/gt/intel_lrc.c:1.4 Sun Dec 19 11:46:47 2021 +++ src/sys/external/bsd/drm2/dist/drm/i915/gt/intel_lrc.c Sun Dec 19 11:47:16 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: intel_lrc.c,v 1.4 2021/12/19 11:46:47 riastradh Exp $ */ +/* $NetBSD: intel_lrc.c,v 1.5 2021/12/19 11:47:16 riastradh Exp $ */ /* * Copyright © 2014 Intel Corporation @@ -134,7 +134,7 @@ * */ #include -__KERNEL_RCSID(0, "$NetBSD: intel_lrc.c,v 1.4 2021/12/19 11:46:47 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: intel_lrc.c,v 1.5 2021/12/19 11:47:16 riastradh Exp $"); #include @@ -153,6 +153,8 @@ __KERNEL_RCSID(0, "$NetBSD: intel_lrc.c, #include "intel_ring.h" #include "intel_workarounds.h" +#include + #define RING_EXECLIST_QFULL (1 << 0x2) #define RING_EXECLIST1_VALID (1 << 0x3) #define RING_EXECLIST0_VALID (1 << 0x4) @@ -1395,7 +1397,7 @@ trace_ports(const struct intel_engine_ex struct i915_request * const *ports) { const struct intel_engine_cs *engine = - container_of(execlists, typeof(*engine), execlists); + const_container_of(execlists, typeof(*engine), execlists); if (!ports[0]) return;
CVS commit: src/sys/external/bsd/drm2/dist/drm/i915/display
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:47:25 UTC 2021 Modified Files: src/sys/external/bsd/drm2/dist/drm/i915/display: intel_opregion.c Log Message: Undo local diffs, re-do local diffs Author: Maya Rashish Committer: Taylor R Campbell To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 \ src/sys/external/bsd/drm2/dist/drm/i915/display/intel_opregion.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/drm2/dist/drm/i915/gt
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:46:38 UTC 2021 Modified Files: src/sys/external/bsd/drm2/dist/drm/i915/gt: intel_llc_types.h Log Message: Provide an element in struct intel_llc our implementation of container_of doesn't like working with empty structs. Author: Maya Rashish Committer: Taylor R Campbell To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 \ src/sys/external/bsd/drm2/dist/drm/i915/gt/intel_llc_types.h 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/i915/gt/intel_llc_types.h diff -u src/sys/external/bsd/drm2/dist/drm/i915/gt/intel_llc_types.h:1.2 src/sys/external/bsd/drm2/dist/drm/i915/gt/intel_llc_types.h:1.3 --- src/sys/external/bsd/drm2/dist/drm/i915/gt/intel_llc_types.h:1.2 Sat Dec 18 23:45:30 2021 +++ src/sys/external/bsd/drm2/dist/drm/i915/gt/intel_llc_types.h Sun Dec 19 11:46:38 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: intel_llc_types.h,v 1.2 2021/12/18 23:45:30 riastradh Exp $ */ +/* $NetBSD: intel_llc_types.h,v 1.3 2021/12/19 11:46:38 riastradh Exp $ */ /* * SPDX-License-Identifier: MIT @@ -10,6 +10,7 @@ #define INTEL_LLC_TYPES_H struct intel_llc { + int x; /* XXX only exists because container_of on empty aggregate is an error */ }; #endif /* INTEL_LLC_TYPES_H */
CVS commit: src/sys/external/bsd/drm2/dist/drm/i915/gt
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:46:47 UTC 2021 Modified Files: src/sys/external/bsd/drm2/dist/drm/i915/gt: intel_engine_types.h intel_lrc.c Log Message: Bus-space-ify Author: Maya Rashish Committer: Taylor R Campbell To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 \ src/sys/external/bsd/drm2/dist/drm/i915/gt/intel_engine_types.h cvs rdiff -u -r1.3 -r1.4 \ src/sys/external/bsd/drm2/dist/drm/i915/gt/intel_lrc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/drm2
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:55:47 UTC 2021 Modified Files: src/sys/external/bsd/drm2/dist/drm: drm_vblank.c src/sys/external/bsd/drm2/dist/drm/amd/amdgpu: amdgpu_fence.c src/sys/external/bsd/drm2/dist/drm/i915: intel_uncore.c src/sys/external/bsd/drm2/include/linux: hrtimer.h timer.h src/sys/external/bsd/drm2/linux: linux_hrtimer.c Log Message: drm: Eliminate hrtimer_destroy and teardown_timer. These are non-Linux shims added to the Linux API to pair with hrtimer_setup and setup_timer, but they really only serve to call callout_destroy, which is not strictly necessary in the NetBSD API. So although we lose a little bit of diagnostic help this way, we also reduce diffs a bit and save some trouble that bit us last week. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/external/bsd/drm2/dist/drm/drm_vblank.c cvs rdiff -u -r1.8 -r1.9 \ src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_fence.c cvs rdiff -u -r1.18 -r1.19 \ src/sys/external/bsd/drm2/dist/drm/i915/intel_uncore.c cvs rdiff -u -r1.6 -r1.7 src/sys/external/bsd/drm2/include/linux/hrtimer.h cvs rdiff -u -r1.13 -r1.14 src/sys/external/bsd/drm2/include/linux/timer.h cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/drm2/linux/linux_hrtimer.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/drm_vblank.c diff -u src/sys/external/bsd/drm2/dist/drm/drm_vblank.c:1.10 src/sys/external/bsd/drm2/dist/drm/drm_vblank.c:1.11 --- src/sys/external/bsd/drm2/dist/drm/drm_vblank.c:1.10 Sun Dec 19 11:52:25 2021 +++ src/sys/external/bsd/drm2/dist/drm/drm_vblank.c Sun Dec 19 11:55:47 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: drm_vblank.c,v 1.10 2021/12/19 11:52:25 riastradh Exp $ */ +/* $NetBSD: drm_vblank.c,v 1.11 2021/12/19 11:55:47 riastradh Exp $ */ /* * drm_irq.c IRQ and vblank support @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: drm_vblank.c,v 1.10 2021/12/19 11:52:25 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: drm_vblank.c,v 1.11 2021/12/19 11:55:47 riastradh Exp $"); #include #include @@ -463,7 +463,6 @@ void drm_vblank_cleanup(struct drm_devic drm_core_check_feature(dev, DRIVER_MODESET)); del_timer_sync(>disable_timer); - teardown_timer(>disable_timer); seqlock_destroy(>seqlock); } Index: src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_fence.c diff -u src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_fence.c:1.8 src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_fence.c:1.9 --- src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_fence.c:1.8 Sun Dec 19 09:59:30 2021 +++ src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_fence.c Sun Dec 19 11:55:47 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: amdgpu_fence.c,v 1.8 2021/12/19 09:59:30 riastradh Exp $ */ +/* $NetBSD: amdgpu_fence.c,v 1.9 2021/12/19 11:55:47 riastradh Exp $ */ /* * Copyright 2009 Jerome Glisse. @@ -31,7 +31,7 @@ *Dave Airlie */ #include -__KERNEL_RCSID(0, "$NetBSD: amdgpu_fence.c,v 1.8 2021/12/19 09:59:30 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: amdgpu_fence.c,v 1.9 2021/12/19 11:55:47 riastradh Exp $"); #include #include @@ -549,7 +549,6 @@ void amdgpu_fence_driver_fini(struct amd ring->fence_drv.fences = NULL; ring->fence_drv.initialized = false; spin_lock_destroy(>fence_drv.lock); - timer_teardown(>fence_drv.fallback_timer); } } Index: src/sys/external/bsd/drm2/dist/drm/i915/intel_uncore.c diff -u src/sys/external/bsd/drm2/dist/drm/i915/intel_uncore.c:1.18 src/sys/external/bsd/drm2/dist/drm/i915/intel_uncore.c:1.19 --- src/sys/external/bsd/drm2/dist/drm/i915/intel_uncore.c:1.18 Sun Dec 19 11:53:18 2021 +++ src/sys/external/bsd/drm2/dist/drm/i915/intel_uncore.c Sun Dec 19 11:55:47 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: intel_uncore.c,v 1.18 2021/12/19 11:53:18 riastradh Exp $ */ +/* $NetBSD: intel_uncore.c,v 1.19 2021/12/19 11:55:47 riastradh Exp $ */ /* * Copyright © 2013 Intel Corporation @@ -24,7 +24,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: intel_uncore.c,v 1.18 2021/12/19 11:53:18 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: intel_uncore.c,v 1.19 2021/12/19 11:55:47 riastradh Exp $"); #include #include @@ -1519,7 +1519,6 @@ static void fw_domain_fini(struct intel_ uncore->fw_domains &= ~BIT(domain_id); WARN_ON(d->wake_count); WARN_ON(hrtimer_cancel(>timer)); - hrtimer_destroy(>timer); kfree(d); } Index: src/sys/external/bsd/drm2/include/linux/hrtimer.h diff -u src/sys/external/bsd/drm2/include/linux/hrtimer.h:1.6 src/sys/external/bsd/drm2/include/linux/hrtimer.h:1.7 --- src/sys/external/bsd/drm2/include/linux/hrtimer.h:1.6 Sun Dec 19 11:53:09 2021 +++ src/sys/external/bsd/drm2/include/linux/hrtimer.h Sun Dec 19 11:55:47 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: hrtimer.h,v 1.6 2021/12/19 11:53:09 riastradh Exp $ */ +/* $NetBSD: hrtimer.h,v 1.7
CVS commit: src/sys/external/bsd/drm2
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:55:58 UTC 2021 Modified Files: src/sys/external/bsd/drm2/dist/drm/i915: i915_vma.c src/sys/external/bsd/drm2/include/linux/sched: mm.h Log Message: linux: Shim fs_reclaim_acquire/release to reduce diff. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/external/bsd/drm2/dist/drm/i915/i915_vma.c cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/drm2/include/linux/sched/mm.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/drm2
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:55:47 UTC 2021 Modified Files: src/sys/external/bsd/drm2/dist/drm: drm_vblank.c src/sys/external/bsd/drm2/dist/drm/amd/amdgpu: amdgpu_fence.c src/sys/external/bsd/drm2/dist/drm/i915: intel_uncore.c src/sys/external/bsd/drm2/include/linux: hrtimer.h timer.h src/sys/external/bsd/drm2/linux: linux_hrtimer.c Log Message: drm: Eliminate hrtimer_destroy and teardown_timer. These are non-Linux shims added to the Linux API to pair with hrtimer_setup and setup_timer, but they really only serve to call callout_destroy, which is not strictly necessary in the NetBSD API. So although we lose a little bit of diagnostic help this way, we also reduce diffs a bit and save some trouble that bit us last week. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/external/bsd/drm2/dist/drm/drm_vblank.c cvs rdiff -u -r1.8 -r1.9 \ src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_fence.c cvs rdiff -u -r1.18 -r1.19 \ src/sys/external/bsd/drm2/dist/drm/i915/intel_uncore.c cvs rdiff -u -r1.6 -r1.7 src/sys/external/bsd/drm2/include/linux/hrtimer.h cvs rdiff -u -r1.13 -r1.14 src/sys/external/bsd/drm2/include/linux/timer.h cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/drm2/linux/linux_hrtimer.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/drm2/dist/drm/i915
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:55:25 UTC 2021 Modified Files: src/sys/external/bsd/drm2/dist/drm/i915: i915_drv.h src/sys/external/bsd/drm2/dist/drm/i915/display: intel_display.c Log Message: i915: Rework atomic commit wakeups to work with condvars. Lock order is intel_state->commit_ready.wait.lock then dev_priv->atomic_commit_lock. To generate a diff of this commit: cvs rdiff -u -r1.45 -r1.46 src/sys/external/bsd/drm2/dist/drm/i915/i915_drv.h cvs rdiff -u -r1.4 -r1.5 \ src/sys/external/bsd/drm2/dist/drm/i915/display/intel_display.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/i915/i915_drv.h diff -u src/sys/external/bsd/drm2/dist/drm/i915/i915_drv.h:1.45 src/sys/external/bsd/drm2/dist/drm/i915/i915_drv.h:1.46 --- src/sys/external/bsd/drm2/dist/drm/i915/i915_drv.h:1.45 Sun Dec 19 11:51:59 2021 +++ src/sys/external/bsd/drm2/dist/drm/i915/i915_drv.h Sun Dec 19 11:55:24 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: i915_drv.h,v 1.45 2021/12/19 11:51:59 riastradh Exp $ */ +/* $NetBSD: i915_drv.h,v 1.46 2021/12/19 11:55:24 riastradh Exp $ */ /* i915_drv.h -- Private header for the I915 driver -*- linux-c -*- */ @@ -1087,6 +1087,9 @@ struct drm_i915_private { struct drm_atomic_state *modeset_restore_state; struct drm_modeset_acquire_ctx reset_ctx; + spinlock_t atomic_commit_lock; + drm_waitqueue_t atomic_commit_wq; + struct i915_ggtt ggtt; /* VM representing the global address space */ struct i915_gem_mm mm; Index: src/sys/external/bsd/drm2/dist/drm/i915/display/intel_display.c diff -u src/sys/external/bsd/drm2/dist/drm/i915/display/intel_display.c:1.4 src/sys/external/bsd/drm2/dist/drm/i915/display/intel_display.c:1.5 --- src/sys/external/bsd/drm2/dist/drm/i915/display/intel_display.c:1.4 Sun Dec 19 11:55:07 2021 +++ src/sys/external/bsd/drm2/dist/drm/i915/display/intel_display.c Sun Dec 19 11:55:24 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: intel_display.c,v 1.4 2021/12/19 11:55:07 riastradh Exp $ */ +/* $NetBSD: intel_display.c,v 1.5 2021/12/19 11:55:24 riastradh Exp $ */ /* * Copyright © 2006-2007 Intel Corporation @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: intel_display.c,v 1.4 2021/12/19 11:55:07 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: intel_display.c,v 1.5 2021/12/19 11:55:24 riastradh Exp $"); #include "intel_display.h" /* for pipe_drmhack */ @@ -4823,9 +4823,11 @@ void intel_prepare_reset(struct drm_i915 return; /* We have a modeset vs reset deadlock, defensively unbreak it. */ + spin_lock(_priv->atomic_commit_lock); set_bit(I915_RESET_MODESET, _priv->gt.reset.flags); - smp_mb__after_atomic(); - wake_up_bit(_priv->gt.reset.flags, I915_RESET_MODESET); + DRM_SPIN_WAKEUP_ALL(_priv->atomic_commit_wq, + _priv->atomic_commit_lock); + spin_unlock(_priv->atomic_commit_lock); if (atomic_read(_priv->gpu_error.pending_fb_pin)) { DRM_DEBUG_KMS("Modeset potentially stuck, unbreaking through wedging\n"); @@ -15271,35 +15273,43 @@ static void intel_atomic_helper_free_sta intel_atomic_helper_free_state(dev_priv); } -static void intel_atomic_commit_fence_wait(struct intel_atomic_state *intel_state) +static int +intel_atomic_commit_fence_wake(struct i915_sw_fence_waiter *waiter, +unsigned mode, int flags, void *cookie) { -#ifdef __NetBSD__ - panic("NYI"); -#else - struct wait_queue_entry wait_fence, wait_reset; + struct intel_atomic_state *intel_state = cookie; struct drm_i915_private *dev_priv = to_i915(intel_state->base.dev); - init_wait_entry(_fence, 0); - init_wait_entry(_reset, 0); - for (;;) { - prepare_to_wait(_state->commit_ready.wait, -_fence, TASK_UNINTERRUPTIBLE); - prepare_to_wait(bit_waitqueue(_priv->gt.reset.flags, - I915_RESET_MODESET), -_reset, TASK_UNINTERRUPTIBLE); + spin_lock(_priv->atomic_commit_lock); + DRM_SPIN_WAKEUP_ALL(_priv->atomic_commit_wq, + _priv->atomic_commit_lock); + spin_unlock(_priv->atomic_commit_lock); + list_del_init(>entry); - if (i915_sw_fence_done(_state->commit_ready) || - test_bit(I915_RESET_MODESET, _priv->gt.reset.flags)) - break; + return 0; +} - schedule(); - } - finish_wait(_state->commit_ready.wait, _fence); - finish_wait(bit_waitqueue(_priv->gt.reset.flags, - I915_RESET_MODESET), - _reset); -#endif +static void intel_atomic_commit_fence_wait(struct intel_atomic_state *intel_state) +{ + struct drm_i915_private *dev_priv = to_i915(intel_state->base.dev); + struct i915_sw_fence_waiter waiter; + int ret; + + waiter.flags = 0; + waiter.func = intel_atomic_commit_fence_wake; + waiter.private = intel_state; + + spin_lock(_state->commit_ready.wait.lock); + list_add_tail(, _state->commit_ready.wait.head); + spin_unlock(_state->commit_ready.wait.lock); + + spin_lock(_priv->atomic_commit_lock); + DRM_SPIN_WAIT_NOINTR_UNTIL(ret, _priv->atomic_commit_wq, +
CVS commit: src/sys/external/bsd/drm2/include/linux
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:55:38 UTC 2021 Modified Files: src/sys/external/bsd/drm2/include/linux: ioport.h Log Message: linux: Define IORESOURCE_* to be bits, not indices. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/external/bsd/drm2/include/linux/ioport.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/drm2/dist/drm/i915
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:56:52 UTC 2021 Modified Files: src/sys/external/bsd/drm2/dist/drm/i915: i915_drv.c src/sys/external/bsd/drm2/dist/drm/i915/gem: i915_gem_mman.c i915_gem_mman.h Log Message: i915: Define i915_gem_uvm_ops. To generate a diff of this commit: cvs rdiff -u -r1.42 -r1.43 src/sys/external/bsd/drm2/dist/drm/i915/i915_drv.c cvs rdiff -u -r1.7 -r1.8 \ src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_mman.c \ src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_mman.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/drm2/dist/drm/i915
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:56:52 UTC 2021 Modified Files: src/sys/external/bsd/drm2/dist/drm/i915: i915_drv.c src/sys/external/bsd/drm2/dist/drm/i915/gem: i915_gem_mman.c i915_gem_mman.h Log Message: i915: Define i915_gem_uvm_ops. To generate a diff of this commit: cvs rdiff -u -r1.42 -r1.43 src/sys/external/bsd/drm2/dist/drm/i915/i915_drv.c cvs rdiff -u -r1.7 -r1.8 \ src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_mman.c \ src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_mman.h 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/i915/i915_drv.c diff -u src/sys/external/bsd/drm2/dist/drm/i915/i915_drv.c:1.42 src/sys/external/bsd/drm2/dist/drm/i915/i915_drv.c:1.43 --- src/sys/external/bsd/drm2/dist/drm/i915/i915_drv.c:1.42 Sun Dec 19 11:54:10 2021 +++ src/sys/external/bsd/drm2/dist/drm/i915/i915_drv.c Sun Dec 19 11:56:52 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: i915_drv.c,v 1.42 2021/12/19 11:54:10 riastradh Exp $ */ +/* $NetBSD: i915_drv.c,v 1.43 2021/12/19 11:56:52 riastradh Exp $ */ /* i915_drv.c -- i830,i845,i855,i865,i915 driver -*- linux-c -*- */ @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: i915_drv.c,v 1.42 2021/12/19 11:54:10 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: i915_drv.c,v 1.43 2021/12/19 11:56:52 riastradh Exp $"); #include #include @@ -2875,7 +2875,7 @@ static struct drm_driver driver = { .free_irq = drm_pci_free_irq, .mmap_object = _gem_mmap_object, - .gem_uvm_ops = NULL, + .gem_uvm_ops = _gem_uvm_ops, #endif Index: src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_mman.c diff -u src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_mman.c:1.7 src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_mman.c:1.8 --- src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_mman.c:1.7 Sun Dec 19 11:33:30 2021 +++ src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_mman.c Sun Dec 19 11:56:52 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: i915_gem_mman.c,v 1.7 2021/12/19 11:33:30 riastradh Exp $ */ +/* $NetBSD: i915_gem_mman.c,v 1.8 2021/12/19 11:56:52 riastradh Exp $ */ /* * SPDX-License-Identifier: MIT @@ -7,7 +7,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: i915_gem_mman.c,v 1.7 2021/12/19 11:33:30 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: i915_gem_mman.c,v 1.8 2021/12/19 11:56:52 riastradh Exp $"); #include #include @@ -833,6 +833,12 @@ i915_gem_mmap_offset_ioctl(struct drm_de #ifdef __NetBSD__ +const struct uvm_pagerops i915_gem_uvm_ops = { + .pgo_reference = drm_gem_pager_reference, + .pgo_detach = drm_gem_pager_detach, + .pgo_fault = i915_gem_fault, +}; + int i915_gem_mmap_object(struct drm_device *dev, off_t byte_offset, size_t nbytes, int prot, struct uvm_object **uobjp, voff_t *uoffsetp, struct file *fp) Index: src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_mman.h diff -u src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_mman.h:1.7 src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_mman.h:1.8 --- src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_mman.h:1.7 Sun Dec 19 11:50:17 2021 +++ src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_mman.h Sun Dec 19 11:56:52 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: i915_gem_mman.h,v 1.7 2021/12/19 11:50:17 riastradh Exp $ */ +/* $NetBSD: i915_gem_mman.h,v 1.8 2021/12/19 11:56:52 riastradh Exp $ */ /* * SPDX-License-Identifier: MIT @@ -21,7 +21,7 @@ struct mutex; int i915_gem_mmap_gtt_version(void); #ifdef __NetBSD__ -extern const struct uvm_pagerops *const i915_gem_uvm_ops; +extern const struct uvm_pagerops i915_gem_uvm_ops; int i915_gem_mmap_object(struct drm_device *, off_t, size_t, int, struct uvm_object **, voff_t *, struct file *); #else
CVS commit: src/sys/external/bsd/drm2/dist/drm/i915/gem
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:57:03 UTC 2021 Modified Files: src/sys/external/bsd/drm2/dist/drm/i915/gem: i915_gem_shmem.c Log Message: i915: Set sg_page_sizes in the #ifdef NetBSD code. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 \ src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_shmem.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/external/bsd/drm2/dist/drm/i915/display
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:56:08 UTC 2021 Modified Files: src/sys/external/bsd/drm2/dist/drm/i915/display: intel_atomic.c intel_atomic.h intel_display.c Log Message: i915: Keep i915_sw_fence_init/fini paired. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 \ src/sys/external/bsd/drm2/dist/drm/i915/display/intel_atomic.c cvs rdiff -u -r1.2 -r1.3 \ src/sys/external/bsd/drm2/dist/drm/i915/display/intel_atomic.h cvs rdiff -u -r1.5 -r1.6 \ src/sys/external/bsd/drm2/dist/drm/i915/display/intel_display.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/i915/display/intel_atomic.c diff -u src/sys/external/bsd/drm2/dist/drm/i915/display/intel_atomic.c:1.3 src/sys/external/bsd/drm2/dist/drm/i915/display/intel_atomic.c:1.4 --- src/sys/external/bsd/drm2/dist/drm/i915/display/intel_atomic.c:1.3 Sun Dec 19 11:38:03 2021 +++ src/sys/external/bsd/drm2/dist/drm/i915/display/intel_atomic.c Sun Dec 19 11:56:08 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: intel_atomic.c,v 1.3 2021/12/19 11:38:03 riastradh Exp $ */ +/* $NetBSD: intel_atomic.c,v 1.4 2021/12/19 11:56:08 riastradh Exp $ */ /* * Copyright © 2015 Intel Corporation @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: intel_atomic.c,v 1.3 2021/12/19 11:38:03 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: intel_atomic.c,v 1.4 2021/12/19 11:56:08 riastradh Exp $"); #include #include @@ -496,6 +496,8 @@ intel_atomic_state_alloc(struct drm_devi return NULL; } + i915_sw_fence_init(>commit_ready, intel_atomic_commit_ready); + return >base; } Index: src/sys/external/bsd/drm2/dist/drm/i915/display/intel_atomic.h diff -u src/sys/external/bsd/drm2/dist/drm/i915/display/intel_atomic.h:1.2 src/sys/external/bsd/drm2/dist/drm/i915/display/intel_atomic.h:1.3 --- src/sys/external/bsd/drm2/dist/drm/i915/display/intel_atomic.h:1.2 Sat Dec 18 23:45:29 2021 +++ src/sys/external/bsd/drm2/dist/drm/i915/display/intel_atomic.h Sun Dec 19 11:56:08 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: intel_atomic.h,v 1.2 2021/12/18 23:45:29 riastradh Exp $ */ +/* $NetBSD: intel_atomic.h,v 1.3 2021/12/19 11:56:08 riastradh Exp $ */ /* SPDX-License-Identifier: MIT */ /* @@ -61,4 +61,9 @@ int intel_atomic_lock_global_state(struc int intel_atomic_serialize_global_state(struct intel_atomic_state *state); +#include "i915_sw_fence.h" +int __i915_sw_fence_call +intel_atomic_commit_ready(struct i915_sw_fence *fence, + enum i915_sw_fence_notify notify); + #endif /* __INTEL_ATOMIC_H__ */ Index: src/sys/external/bsd/drm2/dist/drm/i915/display/intel_display.c diff -u src/sys/external/bsd/drm2/dist/drm/i915/display/intel_display.c:1.5 src/sys/external/bsd/drm2/dist/drm/i915/display/intel_display.c:1.6 --- src/sys/external/bsd/drm2/dist/drm/i915/display/intel_display.c:1.5 Sun Dec 19 11:55:24 2021 +++ src/sys/external/bsd/drm2/dist/drm/i915/display/intel_display.c Sun Dec 19 11:56:08 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: intel_display.c,v 1.5 2021/12/19 11:55:24 riastradh Exp $ */ +/* $NetBSD: intel_display.c,v 1.6 2021/12/19 11:56:08 riastradh Exp $ */ /* * Copyright © 2006-2007 Intel Corporation @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: intel_display.c,v 1.5 2021/12/19 11:55:24 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: intel_display.c,v 1.6 2021/12/19 11:56:08 riastradh Exp $"); #include "intel_display.h" /* for pipe_drmhack */ @@ -15503,7 +15503,7 @@ static void intel_atomic_commit_work(str intel_atomic_commit_tail(state); } -static int __i915_sw_fence_call +int __i915_sw_fence_call intel_atomic_commit_ready(struct i915_sw_fence *fence, enum i915_sw_fence_notify notify) { @@ -15560,8 +15560,7 @@ static int intel_atomic_commit(struct dr state->wakeref = intel_runtime_pm_get(_priv->runtime_pm); drm_atomic_state_get(>base); - i915_sw_fence_init(>commit_ready, - intel_atomic_commit_ready); + i915_sw_fence_reinit(>commit_ready); /* * The intel_legacy_cursor_update() fast path takes care
CVS commit: src/sys/external/bsd/drm2/dist/drm/i915/display
Module Name:src Committed By: riastradh Date: Sun Dec 19 11:56:23 UTC 2021 Modified Files: src/sys/external/bsd/drm2/dist/drm/i915/display: intel_display.c Log Message: i915: Remember to initialize the atomic commit lock and waitqueue! To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 \ src/sys/external/bsd/drm2/dist/drm/i915/display/intel_display.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.