Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Make it build and boot on my test machines.
details: https://anonhg.NetBSD.org/src/rev/362d6815ff47
branches: trunk
changeset: 330643:362d6815ff47
user: riastradh <riastradh%NetBSD.org@localhost>
date: Wed Jul 16 20:56:24 2014 +0000
description:
Make it build and boot on my test machines.
Screen blanks on boot on the Ivy Bridge system with
DRM error in cpt_serr_int_handler: PCH transcoder A FIFO underrun
But after that everything is OK. Appears to be an upstream problem.
To investigate...
I think there's a cache flushing issue somewhere -- there are little
display artefacts on my T60.
diffstat:
sys/arch/amd64/conf/DRMKMS | 1 -
sys/external/bsd/common/include/linux/errno.h | 5 +-
sys/external/bsd/common/include/linux/kernel.h | 55 +-
sys/external/bsd/common/include/linux/list.h | 30 +-
sys/external/bsd/drm2/dist/drm/drm_agpsupport.c | 32 +-
sys/external/bsd/drm2/dist/drm/drm_bufs.c | 3 +-
sys/external/bsd/drm2/dist/drm/drm_crtc.c | 20 +-
sys/external/bsd/drm2/dist/drm/drm_crtc_helper.c | 1 +
sys/external/bsd/drm2/dist/drm/drm_dp_helper.c | 3 +
sys/external/bsd/drm2/dist/drm/drm_edid.c | 3 +-
sys/external/bsd/drm2/dist/drm/drm_fb_helper.c | 10 +-
sys/external/bsd/drm2/dist/drm/drm_flip_work.c | 1 +
sys/external/bsd/drm2/dist/drm/drm_gem.c | 76 +-
sys/external/bsd/drm2/dist/drm/drm_irq.c | 1 +
sys/external/bsd/drm2/dist/drm/drm_modes.c | 4 +
sys/external/bsd/drm2/dist/drm/drm_plane_helper.c | 4 +-
sys/external/bsd/drm2/dist/drm/drm_probe_helper.c | 1 +
sys/external/bsd/drm2/dist/drm/drm_stub.c | 56 +-
sys/external/bsd/drm2/dist/drm/i915/dvo_ch7xxx.c | 4 +-
sys/external/bsd/drm2/dist/drm/i915/i915_cmd_parser.c | 15 +
sys/external/bsd/drm2/dist/drm/i915/i915_dma.c | 101 +-
sys/external/bsd/drm2/dist/drm/i915/i915_drv.c | 3 +
sys/external/bsd/drm2/dist/drm/i915/i915_drv.h | 89 +-
sys/external/bsd/drm2/dist/drm/i915/i915_gem.c | 213 ++-
sys/external/bsd/drm2/dist/drm/i915/i915_gem_context.c | 2 +
sys/external/bsd/drm2/dist/drm/i915/i915_gem_execbuffer.c | 6 +-
sys/external/bsd/drm2/dist/drm/i915/i915_gem_gtt.c | 823 +++++++++++++-
sys/external/bsd/drm2/dist/drm/i915/i915_gem_stolen.c | 56 +
sys/external/bsd/drm2/dist/drm/i915/i915_gpu_error.c | 34 +-
sys/external/bsd/drm2/dist/drm/i915/i915_irq.c | 96 +-
sys/external/bsd/drm2/dist/drm/i915/i915_params.c | 2 +
sys/external/bsd/drm2/dist/drm/i915/intel_acpi.c | 4 +-
sys/external/bsd/drm2/dist/drm/i915/intel_display.c | 74 +-
sys/external/bsd/drm2/dist/drm/i915/intel_dp.c | 28 +-
sys/external/bsd/drm2/dist/drm/i915/intel_drv.h | 4 +
sys/external/bsd/drm2/dist/drm/i915/intel_dsi.c | 20 +
sys/external/bsd/drm2/dist/drm/i915/intel_fbdev.c | 62 +-
sys/external/bsd/drm2/dist/drm/i915/intel_hdmi.c | 1 +
sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c | 53 +
sys/external/bsd/drm2/dist/drm/i915/intel_lvds.c | 2 +-
sys/external/bsd/drm2/dist/drm/i915/intel_opregion.c | 1 +
sys/external/bsd/drm2/dist/drm/i915/intel_overlay.c | 10 +-
sys/external/bsd/drm2/dist/drm/i915/intel_panel.c | 7 +
sys/external/bsd/drm2/dist/drm/i915/intel_pm.c | 53 +-
sys/external/bsd/drm2/dist/drm/i915/intel_ringbuffer.c | 79 +-
sys/external/bsd/drm2/dist/drm/i915/intel_ringbuffer.h | 6 +-
sys/external/bsd/drm2/dist/drm/i915/intel_sdvo.c | 9 +-
sys/external/bsd/drm2/dist/drm/i915/intel_uncore.c | 30 +-
sys/external/bsd/drm2/dist/include/drm/drmP.h | 62 +-
sys/external/bsd/drm2/dist/include/drm/drm_agpsupport.h | 6 +
sys/external/bsd/drm2/dist/include/drm/drm_fb_helper.h | 19 +-
sys/external/bsd/drm2/dist/include/drm/drm_plane_helper.h | 2 +-
sys/external/bsd/drm2/dist/uapi/drm/drm.h | 20 +-
sys/external/bsd/drm2/drm/drm_cache.c | 16 +-
sys/external/bsd/drm2/drm/drm_drv.c | 596 ++-------
sys/external/bsd/drm2/drm/drm_fops.c | 202 +--
sys/external/bsd/drm2/drm/drm_gem_vm.c | 28 +-
sys/external/bsd/drm2/drm/drm_lock.c | 8 +-
sys/external/bsd/drm2/drm/drm_memory.c | 9 +-
sys/external/bsd/drm2/drm/drm_module.c | 95 +-
sys/external/bsd/drm2/drm/drm_scatter.c | 31 +-
sys/external/bsd/drm2/drm/drm_sysfs.c | 20 +-
sys/external/bsd/drm2/drm/drm_vm.c | 9 +-
sys/external/bsd/drm2/drm/drm_vma_manager.c | 311 +++++
sys/external/bsd/drm2/drm/files.drmkms | 21 +-
sys/external/bsd/drm2/i915drm/files.i915drmkms | 27 +-
sys/external/bsd/drm2/i915drm/i915_gem_gtt.c | 759 ------------
sys/external/bsd/drm2/i915drm/i915_module.c | 70 +-
sys/external/bsd/drm2/i915drm/i915_pci.c | 620 +++------
sys/external/bsd/drm2/i915drm/intel_fb.c | 68 -
sys/external/bsd/drm2/i915drm/intel_gtt.c | 141 ++-
sys/external/bsd/drm2/include/asm/div64.h | 49 +
sys/external/bsd/drm2/include/asm/io.h | 24 +-
sys/external/bsd/drm2/include/asm/mtrr.h | 49 +-
sys/external/bsd/drm2/include/asm/page.h | 53 +
sys/external/bsd/drm2/include/drm/bus_dma_hacks.h | 35 +-
sys/external/bsd/drm2/include/drm/drm_agp_netbsd.h | 23 +-
sys/external/bsd/drm2/include/drm/drm_vma_manager.h | 117 +
sys/external/bsd/drm2/include/drm/drm_wait_netbsd.h | 22 +-
sys/external/bsd/drm2/include/drm/intel-gtt.h | 72 +-
sys/external/bsd/drm2/include/i915_trace.h | 28 +-
sys/external/bsd/drm2/include/linux/atomic.h | 15 +-
sys/external/bsd/drm2/include/linux/bitops.h | 4 +-
sys/external/bsd/drm2/include/linux/bug.h | 7 +-
sys/external/bsd/drm2/include/linux/ctype.h | 43 +
sys/external/bsd/drm2/include/linux/delay.h | 15 +-
sys/external/bsd/drm2/include/linux/device.h | 4 +-
sys/external/bsd/drm2/include/linux/err.h | 15 +-
sys/external/bsd/drm2/include/linux/gfp.h | 7 +-
sys/external/bsd/drm2/include/linux/hdmi.h | 432 +++++++
sys/external/bsd/drm2/include/linux/idr.h | 67 +-
sys/external/bsd/drm2/include/linux/io.h | 13 +-
sys/external/bsd/drm2/include/linux/irqflags.h | 40 +
sys/external/bsd/drm2/include/linux/jiffies.h | 5 +-
sys/external/bsd/drm2/include/linux/kfifo.h | 61 +
sys/external/bsd/drm2/include/linux/kref.h | 11 +-
sys/external/bsd/drm2/include/linux/ktime.h | 51 +-
sys/external/bsd/drm2/include/linux/log2.h | 24 +-
sys/external/bsd/drm2/include/linux/mm_types.h | 4 +-
sys/external/bsd/drm2/include/linux/mount.h | 35 +
sys/external/bsd/drm2/include/linux/mutex.h | 12 +-
sys/external/bsd/drm2/include/linux/pci.h | 168 ++-
sys/external/bsd/drm2/include/linux/pm_qos.h | 58 +
sys/external/bsd/drm2/include/linux/pm_runtime.h | 73 +
sys/external/bsd/drm2/include/linux/printk.h | 5 +-
sys/external/bsd/drm2/include/linux/sched.h | 19 +-
sys/external/bsd/drm2/include/linux/shrinker.h | 12 +-
sys/external/bsd/drm2/include/linux/slab.h | 84 +-
sys/external/bsd/drm2/include/linux/string.h | 17 +-
sys/external/bsd/drm2/include/linux/time.h | 26 +-
sys/external/bsd/drm2/include/linux/timer.h | 10 +-
sys/external/bsd/drm2/include/linux/types.h | 12 +-
sys/external/bsd/drm2/include/linux/vmalloc.h | 30 +-
sys/external/bsd/drm2/include/linux/workqueue.h | 5 +-
sys/external/bsd/drm2/include/video/mipi_display.h | 53 +
sys/external/bsd/drm2/linux/files.drmkms_linux | 3 +-
sys/external/bsd/drm2/linux/linux_idr.c | 169 +-
sys/external/bsd/drm2/linux/linux_module.c | 107 +-
sys/external/bsd/drm2/linux/linux_work.c | 55 +-
sys/external/bsd/drm2/linux/linux_writecomb.c | 147 ++
sys/external/bsd/drm2/pci/drm_pci.c | 118 +-
sys/modules/drmkms/Makefile | 12 +-
sys/modules/drmkms/Makefile.inc | 7 +-
sys/modules/drmkms/drmkms.ioconf | 9 -
sys/modules/drmkms_linux/Makefile | 4 +-
sys/modules/i915drmkms/Makefile | 20 +-
126 files changed, 5184 insertions(+), 2709 deletions(-)
diffs (truncated from 13018 to 300 lines):
diff -r 4606fd8f8950 -r 362d6815ff47 sys/arch/amd64/conf/DRMKMS
--- a/sys/arch/amd64/conf/DRMKMS Wed Jul 16 20:09:00 2014 +0000
+++ b/sys/arch/amd64/conf/DRMKMS Wed Jul 16 20:56:24 2014 +0000
@@ -1,6 +1,5 @@
include "arch/amd64/conf/NO_DRM"
-drmkms* at drmkmsbus?
i915drmkms* at pci? dev ? function ?
no options DIAGNOSTIC
diff -r 4606fd8f8950 -r 362d6815ff47 sys/external/bsd/common/include/linux/errno.h
--- a/sys/external/bsd/common/include/linux/errno.h Wed Jul 16 20:09:00 2014 +0000
+++ b/sys/external/bsd/common/include/linux/errno.h Wed Jul 16 20:56:24 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: errno.h,v 1.2 2014/07/03 20:48:19 riastradh Exp $ */
+/* $NetBSD: errno.h,v 1.3 2014/07/16 20:56:24 riastradh Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -44,5 +44,8 @@
#include <sys/errno.h>
#define ERESTARTSYS ERESTART
+#define ENOTSUPP ENOTSUP /* XXX ??? */
+#define EREMOTEIO EIO /* XXX Urk... */
+#define ECHRNG ERANGE /* XXX ??? */
#endif /* _LINUX_ERRNO_H_ */
diff -r 4606fd8f8950 -r 362d6815ff47 sys/external/bsd/common/include/linux/kernel.h
--- a/sys/external/bsd/common/include/linux/kernel.h Wed Jul 16 20:09:00 2014 +0000
+++ b/sys/external/bsd/common/include/linux/kernel.h Wed Jul 16 20:56:24 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kernel.h,v 1.2 2014/04/01 14:57:58 riastradh Exp $ */
+/* $NetBSD: kernel.h,v 1.3 2014/07/16 20:56:24 riastradh Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -35,6 +35,11 @@
#include <sys/cdefs.h>
#include <sys/types.h>
#include <sys/param.h>
+#include <sys/systm.h>
+
+#define oops_in_progress (panicstr != NULL)
+
+#define IS_ENABLED(option) 0 /* XXX Hmm... */
#define __printf __printflike
#define __user
@@ -42,6 +47,7 @@
#define __always_unused __unused
#define barrier() __insn_barrier()
+#define likely(X) __predict_true(X)
#define unlikely(X) __predict_false(X)
/*
@@ -54,6 +60,8 @@
#define max_t(T, X, Y) MAX(X, Y)
#define min_t(T, X, Y) MIN(X, Y)
+#define clamp_t(T, X, MIN, MAX) min_t(T, max_t(T, X, MIN), MAX)
+
/*
* Rounding to nearest.
*/
@@ -65,6 +73,7 @@
* Rounding to what may or may not be powers of two.
*/
#define DIV_ROUND_UP(X, N) (((X) + (N) - 1) / (N))
+#define DIV_ROUND_UP_ULL(X, N) DIV_ROUND_UP((unsigned long long)(X), (N))
/*
* Rounding to powers of two -- carefully avoiding multiple evaluation
@@ -87,10 +96,10 @@
* the type of c.
*/
#define container_of(PTR, TYPE, FIELD) \
- ((void)sizeof((PTR) - \
+ ((TYPE *)(((char *)(PTR)) - offsetof(TYPE, FIELD) + \
+ 0*sizeof((PTR) - \
&((TYPE *)(((char *)(PTR)) - \
- offsetof(TYPE, FIELD)))->FIELD), \
- ((TYPE *)(((char *)(PTR)) - offsetof(TYPE, FIELD))))
+ offsetof(TYPE, FIELD)))->FIELD)))
#define ARRAY_SIZE(ARRAY) __arraycount(ARRAY)
@@ -113,6 +122,44 @@
return (x < 0? (-x) : x);
}
+static inline uintmax_t
+mult_frac(uintmax_t x, uintmax_t multiplier, uintmax_t divisor)
+{
+ uintmax_t q = (x / divisor);
+ uintmax_t r = (x % divisor);
+
+ return ((q * multiplier) + ((r * multiplier) / divisor));
+}
+
static int panic_timeout __unused = 0;
+static inline int
+vscnprintf(char *buf, size_t size, const char *fmt, va_list va)
+{
+ int ret;
+
+ ret = vsnprintf(buf, size, fmt, va);
+ if (__predict_false(ret < 0))
+ return ret;
+ if (__predict_false(size == 0))
+ return 0;
+ if (__predict_false(size <= ret))
+ return (size - 1);
+
+ return ret;
+}
+
+static inline int
+scnprintf(char *buf, size_t size, const char *fmt, ...)
+{
+ va_list va;
+ int ret;
+
+ va_start(va, fmt);
+ ret = vscnprintf(buf, size, fmt, va);
+ va_end(va);
+
+ return ret;
+}
+
#endif /* _LINUX_KERNEL_H_ */
diff -r 4606fd8f8950 -r 362d6815ff47 sys/external/bsd/common/include/linux/list.h
--- a/sys/external/bsd/common/include/linux/list.h Wed Jul 16 20:09:00 2014 +0000
+++ b/sys/external/bsd/common/include/linux/list.h Wed Jul 16 20:56:24 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: list.h,v 1.2 2014/07/03 20:48:19 riastradh Exp $ */
+/* $NetBSD: list.h,v 1.3 2014/07/16 20:56:24 riastradh Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -91,6 +91,17 @@
return (head->next == head);
}
+static inline int
+list_is_singular(const struct list_head *head)
+{
+
+ if (list_empty(head))
+ return false;
+ if (head->next != head->prev)
+ return false;
+ return true;
+}
+
static inline void
__list_add_between(struct list_head *prev, struct list_head *node,
struct list_head *next)
@@ -181,6 +192,8 @@
#define list_entry(PTR, TYPE, FIELD) container_of(PTR, TYPE, FIELD)
#define list_first_entry(PTR, TYPE, FIELD) \
list_entry(list_first((PTR)), TYPE, FIELD)
+#define list_next_entry(ENTRY, FIELD) \
+ list_entry(list_next(&(ENTRY)->FIELD), typeof(*(ENTRY)), FIELD)
#define list_for_each(VAR, HEAD) \
for ((VAR) = list_first((HEAD)); \
@@ -205,6 +218,11 @@
typeof(*(VAR)), FIELD), 1); \
(VAR) = (NEXT))
+#define list_for_each_entry_continue(VAR, HEAD, FIELD) \
+ for ((VAR) = list_next_entry((VAR), FIELD); \
+ &(VAR)->FIELD != (HEAD); \
+ (VAR) = list_next_entry((VAR), FIELD))
+
/*
* `H'ead-only/`H'ash-table doubly-linked lists.
*/
@@ -255,11 +273,11 @@
#define hlist_for_each_safe(VAR, NEXT, HEAD) \
LIST_FOREACH_SAFE(VAR, HEAD, hln_entry, NEXT)
-#define hlist_for_each_entry(VAR, HLIST, HEAD, FIELD) \
- for ((HLIST) = LIST_FIRST((HEAD)); \
- ((HLIST) != NULL) && \
- ((VAR) = hlist_entry((HLIST), typeof(*(VAR)), FIELD), 1); \
- (HLIST) = LIST_NEXT((HLIST), hln_entry))
+#define hlist_for_each_entry(VAR, HEAD, FIELD) \
+ for ((VAR) = hlist_entry(LIST_FIRST((HEAD)), typeof(*(VAR)), FIELD); \
+ &(VAR)->FIELD != NULL; \
+ (VAR) = hlist_entry(LIST_NEXT(&(VAR)->FIELD, hln_entry), \
+ typeof(*(VAR)), FIELD))
/*
* XXX The nominally RCU-safe APIs below lack dependent read barriers,
diff -r 4606fd8f8950 -r 362d6815ff47 sys/external/bsd/drm2/dist/drm/drm_agpsupport.c
--- a/sys/external/bsd/drm2/dist/drm/drm_agpsupport.c Wed Jul 16 20:09:00 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/drm_agpsupport.c Wed Jul 16 20:56:24 2014 +0000
@@ -64,13 +64,13 @@
#if __NetBSD__
info->agp_version_major = 1;
info->agp_version_minor = 0;
- info->mode = kern->ai_mode;
- info->aperture_base = kern->ai_aperture_base;
- info->aperture_size = kern->ai_aperture_size;
- info->memory_allowed = kern->ai_memory_allowed;
- info->memory_used = kern->ai_memory_used;
- info->id_vendor = PCI_VENDOR(kern->ai_devid);
- info->id_device = PCI_PRODUCT(kern->ai_devid);
+ info->mode = kern->aki_info.ai_mode;
+ info->aperture_base = kern->aki_info.ai_aperture_base;
+ info->aperture_size = kern->aki_info.ai_aperture_size;
+ info->memory_allowed = kern->aki_info.ai_memory_allowed;
+ info->memory_used = kern->aki_info.ai_memory_used;
+ info->id_vendor = PCI_VENDOR(kern->aki_info.ai_devid);
+ info->id_device = PCI_PRODUCT(kern->aki_info.ai_devid);
#else
info->agp_version_major = kern->version.major;
info->agp_version_minor = kern->version.minor;
@@ -465,8 +465,9 @@
#endif
INIT_LIST_HEAD(&head->memory);
#ifdef __NetBSD__
- /* Not sure what the other fields are used for... */
- head->base = head->agp_info.ai_aperture_base;
+ head->cant_use_aperture = false; /* XXX */
+ head->page_mask = ~0UL;
+ head->base = head->agp_info.aki_info.ai_aperture_base;
#else
head->cant_use_aperture = head->agp_info.cant_use_aperture;
head->page_mask = head->agp_info.page_mask;
@@ -475,8 +476,6 @@
return head;
}
-#ifndef __NetBSD__
-
/**
* drm_agp_clear - Clear AGP resource list
* @dev: DRM device
@@ -500,8 +499,14 @@
list_for_each_entry_safe(entry, tempe, &dev->agp->memory, head) {
if (entry->bound)
- drm_unbind_agp(entry->memory);
+#ifdef __NetBSD__
+ drm_unbind_agp(dev->agp->bridge, entry->memory);
+#endif
+#ifdef __NetBSD__
+ drm_free_agp(dev->agp->bridge, entry->memory, entry->pages);
+#else
drm_free_agp(entry->memory, entry->pages);
+#endif
kfree(entry);
}
INIT_LIST_HEAD(&dev->agp->memory);
@@ -513,6 +518,7 @@
dev->agp->enabled = 0;
}
+#ifndef __NetBSD__ /* XXX Dead code that doesn't make sense... */
/**
* Binds a collection of pages into AGP memory at the given offset, returning
* the AGP memory structure containing them.
@@ -556,6 +562,6 @@
}
EXPORT_SYMBOL(drm_agp_bind_pages);
-#endif /* __NetBSD__ */
+#endif
#endif /* __OS_HAS_AGP */
diff -r 4606fd8f8950 -r 362d6815ff47 sys/external/bsd/drm2/dist/drm/drm_bufs.c
--- a/sys/external/bsd/drm2/dist/drm/drm_bufs.c Wed Jul 16 20:09:00 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/drm_bufs.c Wed Jul 16 20:56:24 2014 +0000
@@ -40,6 +40,7 @@
#include <linux/export.h>
#include <linux/mm.h>
#include <asm/bug.h>
+#include <asm/io.h>
#include <asm/shmparam.h>
#include <drm/drmP.h>
@@ -282,7 +283,7 @@
#ifdef __NetBSD__
if (map->offset < dev->agp->base ||
map->offset > dev->agp->base +
- dev->agp->agp_info.ai_aperture_size - 1) {
+ dev->agp->agp_info.aki_info.ai_aperture_size - 1) {
map->offset += dev->agp->base;
}
#else
diff -r 4606fd8f8950 -r 362d6815ff47 sys/external/bsd/drm2/dist/drm/drm_crtc.c
--- a/sys/external/bsd/drm2/dist/drm/drm_crtc.c Wed Jul 16 20:09:00 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/drm_crtc.c Wed Jul 16 20:56:24 2014 +0000
@@ -35,6 +35,7 @@
#include <linux/list.h>
Home |
Main Index |
Thread Index |
Old Index