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/i915 Constrain addresses of p...
details: https://anonhg.NetBSD.org/src/rev/35031cd134fa
branches: trunk
changeset: 329874:35031cd134fa
user: riastradh <riastradh%NetBSD.org@localhost>
date: Thu Jun 12 19:10:33 2014 +0000
description:
Constrain addresses of pages backing i915 GEM objects.
Use the new uao_set_pgfl and x86_select_freelist for the purpose.
diffstat:
sys/external/bsd/drm2/dist/drm/i915/i915_gem.c | 24 ++++++++++++++++++++++--
1 files changed, 22 insertions(+), 2 deletions(-)
diffs (48 lines):
diff -r f9b89bc9ef14 -r 35031cd134fa sys/external/bsd/drm2/dist/drm/i915/i915_gem.c
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c Thu Jun 12 19:05:37 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c Thu Jun 12 19:10:33 2014 +0000
@@ -33,6 +33,8 @@
#include <sys/types.h>
#include <sys/param.h>
+#include <x86/machdep.h> /* x86_select_freelist */
+
#include <uvm/uvm.h>
#include <uvm/uvm_extern.h>
#include <uvm/uvm_fault.h>
@@ -4190,7 +4192,9 @@
size_t size)
{
struct drm_i915_gem_object *obj;
-#ifndef __NetBSD__ /* XXX >32bit dma? */
+#ifdef __NetBSD__
+ uint64_t maxaddr;
+#else
struct address_space *mapping;
u32 mask;
#endif
@@ -4204,7 +4208,23 @@
return NULL;
}
-#ifndef __NetBSD__ /* XXX >32bit dma? */
+#ifdef __NetBSD__
+ /*
+ * 965GM can't handle >32-bit paddrs; all other models can't
+ * handle >40-bit paddrs.
+ *
+ * XXX I think this table is incomplete. It should be
+ * synchronized with the other DMA address constraints
+ * scattered throughout DRM.
+ *
+ * XXX DMA limits
+ */
+ if (IS_CRESTLINE(dev) || IS_BROADWATER(dev))
+ maxaddr = 0xffffffffULL;
+ else
+ maxaddr = 0xffffffffffULL;
+ uao_set_pgfl(obj->base.gemo_shm_uao, x86_select_freelist(maxaddr));
+#else
mask = GFP_HIGHUSER | __GFP_RECLAIMABLE;
if (IS_CRESTLINE(dev) || IS_BROADWATER(dev)) {
/* 965gm cannot relocate objects above 4GiB. */
Home |
Main Index |
Thread Index |
Old Index