Source-Changes-HG archive

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

[src/trunk]: src/sys/external/bsd some more definitions necessary



details:   https://anonhg.NetBSD.org/src/rev/ab3ebe51ef28
branches:  trunk
changeset: 992405:ab3ebe51ef28
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Aug 27 06:08:25 2018 +0000

description:
some more definitions necessary

ifdef out all the i915 gtt virtual memory stuff that errors,
unless it looks exactly like the old code and then merge the
netbsd ifdefs for it.

we don't want to use their ALIGN(, which has more arguments,
use the old alt function.
merge in the old intel_acpi.c code.
don't duplicate DECLARE_BITMAP


Author: coypu <coypu%sdf.org@localhost>
Committer: Taylor R Campbell <riastradh%NetBSD.org@localhost>

diffstat:

 sys/external/bsd/common/include/linux/kernel.h        |   6 ++-
 sys/external/bsd/drm2/dist/drm/i915/i915_gem_gtt.c    |  18 ++++++-
 sys/external/bsd/drm2/dist/drm/i915/i915_gem_gtt.h    |  44 ++++++++++++++++++-
 sys/external/bsd/drm2/dist/drm/i915/i915_gem_stolen.c |  12 ++++-
 sys/external/bsd/drm2/dist/drm/i915/i915_gpu_error.c  |   6 +-
 sys/external/bsd/drm2/include/linux/hashtable.h       |   6 +--
 6 files changed, 76 insertions(+), 16 deletions(-)

diffs (278 lines):

diff -r 9229239f71af -r ab3ebe51ef28 sys/external/bsd/common/include/linux/kernel.h
--- a/sys/external/bsd/common/include/linux/kernel.h    Mon Aug 27 06:08:09 2018 +0000
+++ b/sys/external/bsd/common/include/linux/kernel.h    Mon Aug 27 06:08:25 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kernel.h,v 1.11 2018/08/27 06:07:20 riastradh Exp $    */
+/*     $NetBSD: kernel.h,v 1.12 2018/08/27 06:08:25 riastradh Exp $    */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -40,6 +40,10 @@
 #include <lib/libkern/libkern.h>
 #include <linux/printk.h>
 
+#define U16_MAX UINT16_MAX
+#define U32_MAX UINT32_MAX
+#define U64_MAX UINT64_MAX
+
 #define        oops_in_progress        (panicstr != NULL)
 
 #define        IS_ENABLED(option)      (option)
diff -r 9229239f71af -r ab3ebe51ef28 sys/external/bsd/drm2/dist/drm/i915/i915_gem_gtt.c
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_gem_gtt.c        Mon Aug 27 06:08:09 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_gem_gtt.c        Mon Aug 27 06:08:25 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i915_gem_gtt.c,v 1.5 2018/08/27 04:58:23 riastradh Exp $       */
+/*     $NetBSD: i915_gem_gtt.c,v 1.6 2018/08/27 06:08:25 riastradh Exp $       */
 
 /*
  * Copyright © 2010 Daniel Vetter
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i915_gem_gtt.c,v 1.5 2018/08/27 04:58:23 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_gem_gtt.c,v 1.6 2018/08/27 06:08:25 riastradh Exp $");
 
 #include <linux/err.h>
 #include <linux/seq_file.h>
@@ -1686,7 +1686,6 @@
 #else
        writel(pd_entry, ppgtt->pd_addr + pde);
 #endif
-
 }
 
 /* Write all the page tables found in the ppgtt structure to incrementing page
@@ -3321,7 +3320,6 @@
 
 static void gen6_gmch_remove(struct i915_address_space *vm)
 {
-
        struct i915_gtt *gtt = container_of(vm, struct i915_gtt, base);
 
 #ifdef __NetBSD__
@@ -3574,6 +3572,9 @@
             unsigned int width, unsigned int height,
             struct sg_table *st, struct scatterlist *sg)
 {
+#ifdef __NetBSD__
+       panic("XXX");
+#else
        unsigned int column, row;
        unsigned int src_idx;
 
@@ -3599,12 +3600,16 @@
        }
 
        return sg;
+#endif
 }
 
 static struct sg_table *
 intel_rotate_fb_obj_pages(struct i915_ggtt_view *ggtt_view,
                          struct drm_i915_gem_object *obj)
 {
+#ifdef __NetBSD__
+       panic("XXX");
+#else
        struct intel_rotation_info *rot_info = &ggtt_view->rotation_info;
        unsigned int size_pages = rot_info->size >> PAGE_SHIFT;
        unsigned int size_pages_uv;
@@ -3688,12 +3693,16 @@
                      rot_info->height_pages, size_pages + size_pages_uv,
                      size_pages);
        return ERR_PTR(ret);
+#endif
 }
 
 static struct sg_table *
 intel_partial_pages(const struct i915_ggtt_view *view,
                    struct drm_i915_gem_object *obj)
 {
+#ifdef __NetBSD__
+       panic("XXX");
+#else
        struct sg_table *st;
        struct scatterlist *sg;
        struct sg_page_iter obj_sg_iter;
@@ -3729,6 +3738,7 @@
        kfree(st);
 err_st_alloc:
        return ERR_PTR(ret);
+#endif
 }
 
 static int
diff -r 9229239f71af -r ab3ebe51ef28 sys/external/bsd/drm2/dist/drm/i915/i915_gem_gtt.h
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_gem_gtt.h        Mon Aug 27 06:08:09 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_gem_gtt.h        Mon Aug 27 06:08:25 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i915_gem_gtt.h,v 1.3 2018/08/27 05:35:11 riastradh Exp $       */
+/*     $NetBSD: i915_gem_gtt.h,v 1.4 2018/08/27 06:08:25 riastradh Exp $       */
 
 /*
  * Copyright © 2014 Intel Corporation
@@ -435,6 +435,16 @@
  *
  * XXX: temp is not actually needed, but it saves doing the ALIGN operation.
  */
+#ifdef __NetBSD__ /* ALIGN means something else */
+#define gen6_for_each_pde(pt, pd, start, length, temp, iter) \
+       for (iter = gen6_pde_index(start); \
+            length > 0 && iter < I915_PDES ? \
+                       (pt = (pd)->page_table[iter]), 1 : 0; \
+            iter++, \
+            temp = round_up(start+1, 1 << GEN6_PDE_SHIFT) - start, \
+            temp = min_t(unsigned, temp, length), \
+            start += temp, length -= temp)
+#else
 #define gen6_for_each_pde(pt, pd, start, length, temp, iter) \
        for (iter = gen6_pde_index(start); \
             length > 0 && iter < I915_PDES ? \
@@ -443,6 +453,7 @@
             temp = ALIGN(start+1, 1 << GEN6_PDE_SHIFT) - start, \
             temp = min_t(unsigned, temp, length), \
             start += temp, length -= temp)
+#endif
 
 #define gen6_for_all_pdes(pt, ppgtt, iter)  \
        for (iter = 0;          \
@@ -501,6 +512,36 @@
  * between from start until start + length. On gen8+ it simply iterates
  * over every page directory entry in a page directory.
  */
+#ifdef __NetBSD__ /* ALIGN means something else */
+
+#define gen8_for_each_pde(pt, pd, start, length, temp, iter)           \
+       for (iter = gen8_pde_index(start); \
+            length > 0 && iter < I915_PDES ? \
+                       (pt = (pd)->page_table[iter]), 1 : 0; \
+            iter++,                            \
+            temp = round_up(start+1, 1 << GEN8_PDE_SHIFT) - start,     \
+            temp = min(temp, length),                                  \
+            start += temp, length -= temp)
+#define gen8_for_each_pdpe(pd, pdp, start, length, temp, iter) \
+       for (iter = gen8_pdpe_index(start); \
+            length > 0 && (iter < I915_PDPES_PER_PDP(dev)) ? \
+                       (pd = (pdp)->page_directory[iter]), 1 : 0; \
+            iter++,                            \
+            temp = round_up(start+1, 1 << GEN8_PDPE_SHIFT) - start,    \
+            temp = min(temp, length),                                  \
+            start += temp, length -= temp)
+
+#define gen8_for_each_pml4e(pdp, pml4, start, length, temp, iter)      \
+       for (iter = gen8_pml4e_index(start);    \
+            length > 0 && iter < GEN8_PML4ES_PER_PML4 ? \
+                       (pdp = (pml4)->pdps[iter]), 1 : 0; \
+            iter++,                            \
+            temp = round_up(start+1, 1ULL << GEN8_PML4E_SHIFT) - start,        \
+            temp = min(temp, length),                                  \
+            start += temp, length -= temp)
+
+#else
+
 #define gen8_for_each_pde(pt, pd, start, length, temp, iter)           \
        for (iter = gen8_pde_index(start); \
             length > 0 && iter < I915_PDES ? \
@@ -527,6 +568,7 @@
             temp = ALIGN(start+1, 1ULL << GEN8_PML4E_SHIFT) - start,   \
             temp = min(temp, length),                                  \
             start += temp, length -= temp)
+#endif
 
 static inline uint32_t gen8_pte_index(uint64_t address)
 {
diff -r 9229239f71af -r ab3ebe51ef28 sys/external/bsd/drm2/dist/drm/i915/i915_gem_stolen.c
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_gem_stolen.c     Mon Aug 27 06:08:09 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_gem_stolen.c     Mon Aug 27 06:08:25 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i915_gem_stolen.c,v 1.5 2018/08/27 04:58:23 riastradh Exp $    */
+/*     $NetBSD: i915_gem_stolen.c,v 1.6 2018/08/27 06:08:25 riastradh Exp $    */
 
 /*
  * Copyright © 2008-2012 Intel Corporation
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i915_gem_stolen.c,v 1.5 2018/08/27 04:58:23 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_gem_stolen.c,v 1.6 2018/08/27 06:08:25 riastradh Exp $");
 
 #include <linux/printk.h>
 #include <linux/err.h>
@@ -416,7 +416,11 @@
        unsigned long reserved_total, reserved_base = 0, reserved_size;
        unsigned long stolen_top;
 
+#ifdef __NetBSD__
+       linux_mutex_init(&dev_priv->mm.stolen_lock);
+#else
        mutex_init(&dev_priv->mm.stolen_lock);
+#endif
 
 #ifdef CONFIG_INTEL_IOMMU
        if (intel_iommu_gfx_mapped && INTEL_INFO(dev)->gen < 8) {
@@ -513,6 +517,9 @@
 i915_pages_create_for_stolen(struct drm_device *dev,
                             u32 offset, u32 size)
 {
+#ifdef __NetBSD__
+       panic("XXX");
+#else
        struct drm_i915_private *dev_priv = dev->dev_private;
        struct sg_table *st;
        struct scatterlist *sg;
@@ -542,6 +549,7 @@
        sg_dma_len(sg) = size;
 
        return st;
+#endif
 }
 #endif
 
diff -r 9229239f71af -r ab3ebe51ef28 sys/external/bsd/drm2/dist/drm/i915/i915_gpu_error.c
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_gpu_error.c      Mon Aug 27 06:08:09 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_gpu_error.c      Mon Aug 27 06:08:25 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i915_gpu_error.c,v 1.6 2018/08/27 05:57:29 riastradh Exp $     */
+/*     $NetBSD: i915_gpu_error.c,v 1.7 2018/08/27 06:08:25 riastradh Exp $     */
 
 /*
  * Copyright (c) 2008 Intel Corporation
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i915_gpu_error.c,v 1.6 2018/08/27 05:57:29 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_gpu_error.c,v 1.7 2018/08/27 06:08:25 riastradh Exp $");
 
 #include <sys/param.h>
 
@@ -355,7 +355,7 @@
        err_printf(m, "%s\n", error->error_msg);
        err_printf(m, "Time: %"PRIdMAX" s %ld us\n", (intmax_t)error->time.tv_sec,
                   (long)error->time.tv_usec);
-       err_printf(m, "Kernel: " __NetBSD_Version__ "\n");
+       err_printf(m, "Kernel: %d\n", __NetBSD_Version__);
        err_printf(m, "Time: %ld s %ld us\n", error->time.tv_sec,
                   error->time.tv_usec);
        max_hangcheck_score = 0;
diff -r 9229239f71af -r ab3ebe51ef28 sys/external/bsd/drm2/include/linux/hashtable.h
--- a/sys/external/bsd/drm2/include/linux/hashtable.h   Mon Aug 27 06:08:09 2018 +0000
+++ b/sys/external/bsd/drm2/include/linux/hashtable.h   Mon Aug 27 06:08:25 2018 +0000
@@ -1,4 +1,4 @@
-/*     $OpenBSD: drm_linux.h,v 1.89 2018/06/25 22:29:16 kettenis Exp $ */
+/*     $OpenBSD$       */
 /*
  * Copyright (c) 2013, 2014, 2015 Mark Kettenis
  * Copyright (c) 2017 Martin Pieuchot
@@ -58,8 +58,4 @@
        for (i = 0; i < nitems(table); i++)             \
               list_for_each_entry_safe(obj, tmp, &table[i], member)
 
-#define DECLARE_HASHTABLE(__a,__b) \
-       uint64_t __a /* XXX */
-
-
 #endif /*_LINUX_HASHTABLE_H_*/



Home | Main Index | Thread Index | Old Index