Source-Changes-HG archive

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

[src/trunk]: src/sys/external/bsd/drm2/dist/drm/radeon Fix up radeon.



details:   https://anonhg.NetBSD.org/src/rev/e420e78f75b1
branches:  trunk
changeset: 1028092:e420e78f75b1
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 01:50:00 2021 +0000

description:
Fix up radeon.

Enough to make it compile.  (Next up: make it link.)

diffstat:

 sys/external/bsd/drm2/dist/drm/radeon/radeon_fb.c     |  12 ++++++------
 sys/external/bsd/drm2/dist/drm/radeon/radeon_fence.c  |  14 +++++++-------
 sys/external/bsd/drm2/dist/drm/radeon/radeon_si_dpm.c |   6 ++++--
 sys/external/bsd/drm2/dist/drm/radeon/radeon_ttm.c    |   9 +++++++--
 4 files changed, 24 insertions(+), 17 deletions(-)

diffs (159 lines):

diff -r 70832fb98b4a -r e420e78f75b1 sys/external/bsd/drm2/dist/drm/radeon/radeon_fb.c
--- a/sys/external/bsd/drm2/dist/drm/radeon/radeon_fb.c Sun Dec 19 01:49:50 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/radeon/radeon_fb.c Sun Dec 19 01:50:00 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: radeon_fb.c,v 1.11 2021/12/18 23:45:43 riastradh Exp $ */
+/*     $NetBSD: radeon_fb.c,v 1.12 2021/12/19 01:50:00 riastradh Exp $ */
 
 /*
  * Copyright © 2007 David Airlie
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: radeon_fb.c,v 1.11 2021/12/18 23:45:43 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeon_fb.c,v 1.12 2021/12/19 01:50:00 riastradh Exp $");
 
 #include <linux/module.h>
 #include <linux/pci.h>
@@ -258,10 +258,10 @@
        rbo = gem_to_radeon_bo(gobj);
 
 #ifdef __NetBSD__
-       ret = radeon_framebuffer_init(rdev->ddev, &rfbdev->rfb, &mode_cmd, gobj);
+       ret = radeon_framebuffer_init(rdev->ddev, &rfbdev->fb, &mode_cmd, gobj);
        if (ret) {
                DRM_ERROR("failed to initialize framebuffer %d\n", ret);
-               goto out_unref;
+               goto out;
        }
 
        (void)memset(rbo->kptr, 0, radeon_bo_size(rbo));
@@ -279,10 +279,10 @@
            CFARGS(.iattr = "radeonfbbus"));
        if (helper->fbdev == NULL) {
                DRM_ERROR("failed to attach genfb\n");
-               goto out_unref;
+               goto out;
        }
     }
-       fb = &rfbdev->rfb.base;
+       fb = &rfbdev->fb;
        rfbdev->helper.fb = fb;
 #else
        /* okay we have an object now allocate the framebuffer */
diff -r 70832fb98b4a -r e420e78f75b1 sys/external/bsd/drm2/dist/drm/radeon/radeon_fence.c
--- a/sys/external/bsd/drm2/dist/drm/radeon/radeon_fence.c      Sun Dec 19 01:49:50 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/radeon/radeon_fence.c      Sun Dec 19 01:50:00 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: radeon_fence.c,v 1.17 2021/12/18 23:45:43 riastradh Exp $      */
+/*     $NetBSD: radeon_fence.c,v 1.18 2021/12/19 01:50:00 riastradh Exp $      */
 
 /*
  * Copyright 2009 Jerome Glisse.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: radeon_fence.c,v 1.17 2021/12/18 23:45:43 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeon_fence.c,v 1.18 2021/12/19 01:50:00 riastradh Exp $");
 
 #include <linux/atomic.h>
 #include <linux/firmware.h>
@@ -1188,7 +1188,7 @@
 #ifdef __NetBSD__
 
 static void
-radeon_fence_wakeup_cb(struct fence *fence, struct fence_cb *cb)
+radeon_fence_wakeup_cb(struct dma_fence *fence, struct dma_fence_cb *cb)
 {
        struct radeon_fence *rfence = to_radeon_fence(fence);
        struct radeon_device *rdev = rfence->rdev;
@@ -1198,14 +1198,14 @@
 }
 
 static signed long
-radeon_fence_default_wait(struct fence *f, bool intr, signed long timo)
+radeon_fence_default_wait(struct dma_fence *f, bool intr, signed long timo)
 {
-       struct fence_cb fcb;
+       struct dma_fence_cb fcb;
        struct radeon_fence *fence = to_radeon_fence(f);
        struct radeon_device *rdev = fence->rdev;
        int r;
 
-       r = fence_add_callback(f, &fcb, radeon_fence_wakeup_cb);
+       r = dma_fence_add_callback(f, &fcb, radeon_fence_wakeup_cb);
        if (r)                  /* fence is done already */
                return timo;
 
@@ -1221,7 +1221,7 @@
        }
        spin_unlock(&rdev->fence_lock);
 
-       (void)fence_remove_callback(f, &fcb);
+       (void)dma_fence_remove_callback(f, &fcb);
 
        return r;
 }
diff -r 70832fb98b4a -r e420e78f75b1 sys/external/bsd/drm2/dist/drm/radeon/radeon_si_dpm.c
--- a/sys/external/bsd/drm2/dist/drm/radeon/radeon_si_dpm.c     Sun Dec 19 01:49:50 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/radeon/radeon_si_dpm.c     Sun Dec 19 01:50:00 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: radeon_si_dpm.c,v 1.5 2021/12/18 23:45:43 riastradh Exp $      */
+/*     $NetBSD: radeon_si_dpm.c,v 1.6 2021/12/19 01:50:00 riastradh Exp $      */
 
 /*
  * Copyright 2013 Advanced Micro Devices, Inc.
@@ -24,7 +24,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: radeon_si_dpm.c,v 1.5 2021/12/18 23:45:43 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeon_si_dpm.c,v 1.6 2021/12/19 01:50:00 riastradh Exp $");
 
 #include <linux/math64.h>
 #include <linux/pci.h>
@@ -6907,8 +6907,10 @@
        struct ni_power_info *ni_pi;
        struct si_power_info *si_pi;
        struct atom_clock_dividers dividers;
+#ifndef __NetBSD__             /* XXX radeon pcie */
        enum pci_bus_speed speed_cap = PCI_SPEED_UNKNOWN;
        struct pci_dev *root = rdev->pdev->bus->self;
+#endif
        int ret;
 
        si_pi = kzalloc(sizeof(struct si_power_info), GFP_KERNEL);
diff -r 70832fb98b4a -r e420e78f75b1 sys/external/bsd/drm2/dist/drm/radeon/radeon_ttm.c
--- a/sys/external/bsd/drm2/dist/drm/radeon/radeon_ttm.c        Sun Dec 19 01:49:50 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/radeon/radeon_ttm.c        Sun Dec 19 01:50:00 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: radeon_ttm.c,v 1.18 2021/12/18 23:45:43 riastradh Exp $        */
+/*     $NetBSD: radeon_ttm.c,v 1.19 2021/12/19 01:50:00 riastradh Exp $        */
 
 /*
  * Copyright 2009 Jerome Glisse.
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: radeon_ttm.c,v 1.18 2021/12/18 23:45:43 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeon_ttm.c,v 1.19 2021/12/19 01:50:00 riastradh Exp $");
 
 #include <linux/dma-mapping.h>
 #include <linux/pagemap.h>
@@ -202,8 +202,13 @@
 
        if (radeon_ttm_tt_has_userptr(bo->ttm))
                return -EPERM;
+#ifdef __NetBSD__
+       struct drm_file *drm_file = filp->f_data;
+       return drm_vma_node_verify_access(&rbo->gem_base.vma_node, drm_file);
+#else
        return drm_vma_node_verify_access(&rbo->tbo.base.vma_node,
                                          filp->private_data);
+#endif
 }
 
 static void radeon_move_null(struct ttm_buffer_object *bo,



Home | Main Index | Thread Index | Old Index