Source-Changes-HG archive

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

[src/trunk]: src/sys/external/bsd/drm2 amdgpu: amdgpu_drv.c



details:   https://anonhg.NetBSD.org/src/rev/f6f87a7373b5
branches:  trunk
changeset: 1028788:f6f87a7373b5
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 12:01:48 2021 +0000

description:
amdgpu: amdgpu_drv.c

diffstat:

 sys/external/bsd/drm2/amdgpu/amdgpu_module.c               |  14 +++++++++++---
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_dma_buf.h |   6 +++---
 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_drv.c     |   9 +++++++--
 sys/external/bsd/drm2/include/linux/moduleparam.h          |   4 +++-
 4 files changed, 24 insertions(+), 9 deletions(-)

diffs (148 lines):

diff -r c559f5da2757 -r f6f87a7373b5 sys/external/bsd/drm2/amdgpu/amdgpu_module.c
--- a/sys/external/bsd/drm2/amdgpu/amdgpu_module.c      Sun Dec 19 12:01:40 2021 +0000
+++ b/sys/external/bsd/drm2/amdgpu/amdgpu_module.c      Sun Dec 19 12:01:48 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: amdgpu_module.c,v 1.5 2021/12/19 10:32:59 riastradh Exp $      */
+/*     $NetBSD: amdgpu_module.c,v 1.6 2021/12/19 12:01:48 riastradh Exp $      */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: amdgpu_module.c,v 1.5 2021/12/19 10:32:59 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amdgpu_module.c,v 1.6 2021/12/19 12:01:48 riastradh Exp $");
 
 #include <sys/types.h>
 #include <sys/module.h>
@@ -40,8 +40,12 @@
 #include <sys/systm.h>
 
 #include <drm/drm_device.h>
+#include <drm/drm_drv.h>
 #include <drm/drm_sysctl.h>
 
+#include <linux/mutex.h>
+
+#include "amdgpu.h"
 #include "amdgpu_amdkfd.h"
 #include "amdgpu_drv.h"
 
@@ -53,7 +57,7 @@
 
 /* XXX Kludge to get these from amdgpu_drv.c.  */
 extern struct drm_driver *const amdgpu_drm_driver;
-extern int amdgpu_max_kms_ioctl;
+extern struct amdgpu_mgpu_info mgpu_info;
 
 struct drm_sysctl_def amdgpu_def = DRM_SYSCTL_INIT();
 
@@ -69,6 +73,8 @@
        amdgpu_drm_driver->num_ioctls = amdgpu_max_kms_ioctl;
        amdgpu_drm_driver->driver_features |= DRIVER_MODESET;
 
+       linux_mutex_init(&mgpu_info.mutex);
+
 #if notyet                     /* XXX amdgpu acpi */
        amdgpu_register_atpx_handler();
 #endif
@@ -101,6 +107,8 @@
 #if notyet                     /* XXX amdgpu acpi */
        amdgpu_unregister_atpx_handler();
 #endif
+
+       linux_mutex_destroy(&mgpu_info.mutex);
 }
 
 static int
diff -r c559f5da2757 -r f6f87a7373b5 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_dma_buf.h
--- a/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_dma_buf.h        Sun Dec 19 12:01:40 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_dma_buf.h        Sun Dec 19 12:01:48 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: amdgpu_dma_buf.h,v 1.3 2021/12/19 10:59:01 riastradh Exp $     */
+/*     $NetBSD: amdgpu_dma_buf.h,v 1.4 2021/12/19 12:01:48 riastradh Exp $     */
 
 /*
  * Copyright 2019 Advanced Micro Devices, Inc.
@@ -34,8 +34,8 @@
 void *amdgpu_gem_prime_vmap(struct drm_gem_object *obj);
 void amdgpu_gem_prime_vunmap(struct drm_gem_object *obj, void *vaddr);
 #ifdef __NetBSD__
-int amdgpu_gem_prime_mmap_object(struct drm_gem_object *, off_t *, size_t, int,
-    int *, struct uvm_object **, int *);
+int amdgpu_gem_prime_mmap(struct drm_gem_object *, off_t *, size_t, int,
+    int *, int *, struct uvm_object **, int *);
 #else
 int amdgpu_gem_prime_mmap(struct drm_gem_object *obj,
                          struct vm_area_struct *vma);
diff -r c559f5da2757 -r f6f87a7373b5 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_drv.c
--- a/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_drv.c    Sun Dec 19 12:01:40 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_drv.c    Sun Dec 19 12:01:48 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: amdgpu_drv.c,v 1.6 2021/12/18 23:44:58 riastradh Exp $ */
+/*     $NetBSD: amdgpu_drv.c,v 1.7 2021/12/19 12:01:48 riastradh Exp $ */
 
 /*
  * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: amdgpu_drv.c,v 1.6 2021/12/18 23:44:58 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amdgpu_drv.c,v 1.7 2021/12/19 12:01:48 riastradh Exp $");
 
 #include <drm/amdgpu_drm.h>
 #include <drm/drm_drv.h>
@@ -33,6 +33,7 @@
 #include <drm/drm_vblank.h>
 #include "amdgpu_drv.h"
 
+#include <drm/drm_pci.h>
 #include <drm/drm_pciids.h>
 #include <linux/console.h>
 #include <linux/module.h>
@@ -151,7 +152,9 @@
 int amdgpu_force_asic_type = -1;
 
 struct amdgpu_mgpu_info mgpu_info = {
+#ifndef __NetBSD__
        .mutex = __MUTEX_INITIALIZER(mgpu_info.mutex),
+#endif
 };
 int amdgpu_ras_enable = -1;
 uint amdgpu_ras_mask = 0xffffffff;
@@ -1373,6 +1376,7 @@
 static const struct uvm_pagerops amdgpu_gem_uvm_ops;
 #endif
 
+#ifndef __NetBSD__
 int amdgpu_file_to_fpriv(struct file *filp, struct amdgpu_fpriv **fpriv)
 {
         struct drm_file *file;
@@ -1388,6 +1392,7 @@
        *fpriv = file->driver_priv;
        return 0;
 }
+#endif
 
 static bool
 amdgpu_get_crtc_scanout_position(struct drm_device *dev, unsigned int pipe,
diff -r c559f5da2757 -r f6f87a7373b5 sys/external/bsd/drm2/include/linux/moduleparam.h
--- a/sys/external/bsd/drm2/include/linux/moduleparam.h Sun Dec 19 12:01:40 2021 +0000
+++ b/sys/external/bsd/drm2/include/linux/moduleparam.h Sun Dec 19 12:01:48 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: moduleparam.h,v 1.10 2021/12/19 09:52:17 riastradh Exp $       */
+/*     $NetBSD: moduleparam.h,v 1.11 2021/12/19 12:01:48 riastradh Exp $       */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -66,6 +66,8 @@
 #define        module_param(VAR, TYPE, MODE)   module_param_named(VAR, VAR, TYPE, MODE)
 #define        module_param_unsafe             module_param
 #define        module_param_named_unsafe       module_param_named
+#define        module_param_string(VAR, TYPE, SIZE, MODE)                            \
+       CTASSERT(1)             /* XXX */
 
 struct linux_module_param_desc {
        const char *name;



Home | Main Index | Thread Index | Old Index