From 1673f09a40940493856db8f67271437f4f6e82d2 Mon Sep 17 00:00:00 2001 From: jsg Date: Wed, 13 Jan 2021 01:04:49 +0000 Subject: revert drm vmalloc changes It is suspected they were to blame for a machine with inteldrm running X (xterms and chromium) running out of resources after a few days. ok kettenis@ --- sys/dev/pci/drm/include/linux/vmalloc.h | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'sys/dev/pci/drm/include/linux/vmalloc.h') diff --git a/sys/dev/pci/drm/include/linux/vmalloc.h b/sys/dev/pci/drm/include/linux/vmalloc.h index fd6cc54b7db..53ba42e2d18 100644 --- a/sys/dev/pci/drm/include/linux/vmalloc.h +++ b/sys/dev/pci/drm/include/linux/vmalloc.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vmalloc.h,v 1.2 2021/01/08 23:02:09 kettenis Exp $ */ +/* $OpenBSD: vmalloc.h,v 1.3 2021/01/13 01:04:49 jsg Exp $ */ /* * Copyright (c) 2013, 2014, 2015 Mark Kettenis * @@ -25,10 +25,25 @@ #include void *vmap(struct vm_page **, unsigned int, unsigned long, pgprot_t); -void vunmap(void *, size_t); +void vunmap(void *, size_t); + +static inline void * +vmalloc(unsigned long size) +{ + return malloc(size, M_DRM, M_WAITOK | M_CANFAIL); +} + +static inline void * +vzalloc(unsigned long size) +{ + return malloc(size, M_DRM, M_WAITOK | M_CANFAIL | M_ZERO); +} + +static inline void +vfree(void *objp) +{ + free(objp, M_DRM, 0); +} -void *vmalloc(unsigned long); -void *vzalloc(unsigned long); -void vfree(const void *); #endif -- cgit v1.2.3-59-g8ed1b