Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/riastradh-drm2]: src/sys/external/bsd/drm2/dist/drm/i915 Check that GEM ...
details: https://anonhg.NetBSD.org/src/rev/0a036d30f470
branches: riastradh-drm2
changeset: 788545:0a036d30f470
user: riastradh <riastradh%NetBSD.org@localhost>
date: Sun Sep 08 16:05:06 2013 +0000
description:
Check that GEM wired pages use at most 40 bits of physical addresses.
Can't express this constraint to uvm_obj_wirepages at the moment, so
at least fail early and noisily if we violate it.
diffstat:
sys/external/bsd/drm2/dist/drm/i915/i915_gem.c | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diffs (33 lines):
diff -r 606541e617a1 -r 0a036d30f470 sys/external/bsd/drm2/dist/drm/i915/i915_gem.c
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c Sun Sep 08 16:04:09 2013 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c Sun Sep 08 16:05:06 2013 +0000
@@ -2166,6 +2166,7 @@
i915_gem_object_get_pages_gtt(struct drm_i915_gem_object *obj)
{
struct drm_device *const dev = obj->base.dev;
+ struct vm_page *page;
int error;
/* XXX Cargo-culted from the Linux code. */
@@ -2191,6 +2192,21 @@
KASSERT(0 < obj->igo_nsegs);
KASSERT(obj->igo_nsegs <= (obj->base.size / PAGE_SIZE));
+ /*
+ * Check that the paddrs will fit in 40 bits.
+ *
+ * XXX This is wrong; we ought to pass this constraint to
+ * bus_dmamem_wire_uvm_object instead.
+ */
+ TAILQ_FOREACH(page, &obj->igo_pageq, pageq.queue) {
+ if (VM_PAGE_TO_PHYS(page) & ~0xffffffffffULL) {
+ DRM_ERROR("GEM physical address exceeds 40 bits"
+ ": %"PRIxMAX"\n",
+ (uintmax_t)VM_PAGE_TO_PHYS(page));
+ goto fail2;
+ }
+ }
+
/* XXX errno NetBSD->Linux */
error = -bus_dmamap_create(dev->dmat, obj->base.size, obj->igo_nsegs,
PAGE_SIZE, 0, BUS_DMA_NOWAIT, &obj->igo_dmamap);
Home |
Main Index |
Thread Index |
Old Index