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 Add bool virtua...
details: https://anonhg.NetBSD.org/src/rev/fd4cf94df0c5
branches: riastradh-drm2
changeset: 788290:fd4cf94df0c5
user: riastradh <riastradh%NetBSD.org@localhost>
date: Wed Jul 24 03:05:41 2013 +0000
description:
Add bool virtual_start_mapped to struct intel_ring_buffer.
The nullable pointer virtual_start was replaced by a struct
drm_local_map, which can't be null (well, perhaps we could abuse one
of the fields in it for that purpose, but this is cleaner), so
virtual_start_mapped will be maintained in the place of the
possibility of a null virtual_start to indicate whether the mapping
is present.
diffstat:
sys/external/bsd/drm2/dist/drm/i915/i915_dma.c | 15 +++++++++++++++
sys/external/bsd/drm2/dist/drm/i915/intel_ringbuffer.c | 4 ++++
sys/external/bsd/drm2/dist/drm/i915/intel_ringbuffer.h | 1 +
3 files changed, 20 insertions(+), 0 deletions(-)
diffs (87 lines):
diff -r ca96a98eaea7 -r fd4cf94df0c5 sys/external/bsd/drm2/dist/drm/i915/i915_dma.c
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_dma.c Wed Jul 24 03:05:24 2013 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_dma.c Wed Jul 24 03:05:41 2013 +0000
@@ -239,11 +239,19 @@
DRM_DEBUG_DRIVER("%s\n", __func__);
+#ifdef __NetBSD__
+ if (!ring->virtual_start_mapped) {
+ DRM_ERROR("can not ioremap virtual address for"
+ " ring buffer\n");
+ return -ENOMEM;
+ }
+#else
if (ring->virtual_start == NULL) {
DRM_ERROR("can not ioremap virtual address for"
" ring buffer\n");
return -ENOMEM;
}
+#endif
/* Program Hardware Status Page */
if (!ring->status_page.page_addr) {
@@ -820,10 +828,17 @@
if (drm_core_check_feature(dev, DRIVER_MODESET))
return -ENODEV;
+#ifdef __NetBSD__
+ if (!dev_priv || !LP_RING(dev_priv)->virtual_start_mapped) {
+ DRM_ERROR("called with no initialization\n");
+ return -EINVAL;
+ }
+#else
if (!dev_priv || !LP_RING(dev_priv)->virtual_start) {
DRM_ERROR("called with no initialization\n");
return -EINVAL;
}
+#endif
RING_LOCK_TEST_WITH_RETURN(dev, file_priv);
diff -r ca96a98eaea7 -r fd4cf94df0c5 sys/external/bsd/drm2/dist/drm/i915/intel_ringbuffer.c
--- a/sys/external/bsd/drm2/dist/drm/i915/intel_ringbuffer.c Wed Jul 24 03:05:24 2013 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/intel_ringbuffer.c Wed Jul 24 03:05:41 2013 +0000
@@ -1195,6 +1195,7 @@
DRM_ERROR("failed to map ring buffer\n");
goto err_unpin;
}
+ ring->virtual_start_mapped = true;
#else
ring->virtual_start =
ioremap_wc(dev_priv->mm.gtt->gma_bus_addr + obj->gtt_offset,
@@ -1223,6 +1224,7 @@
err_unmap:
#ifdef __NetBSD__
drm_iounmap(dev, &ring->virtual_start_map);
+ ring->virtual_start_mapped = false;
#else
iounmap(ring->virtual_start);
#endif
@@ -1255,6 +1257,7 @@
#ifdef __NetBSD__
drm_iounmap(dev, &ring->virtual_start_map);
+ ring->virtual_start_mapped = false;
#else
iounmap(ring->virtual_start);
#endif
@@ -1760,6 +1763,7 @@
DRM_ERROR("cannot ioremap virtual address for ring buffer\n");
return ret;
}
+ ring->virtual_start_mapped = true;
#else
ring->virtual_start = ioremap_wc(start, size);
if (ring->virtual_start == NULL) {
diff -r ca96a98eaea7 -r fd4cf94df0c5 sys/external/bsd/drm2/dist/drm/i915/intel_ringbuffer.h
--- a/sys/external/bsd/drm2/dist/drm/i915/intel_ringbuffer.h Wed Jul 24 03:05:24 2013 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/intel_ringbuffer.h Wed Jul 24 03:05:41 2013 +0000
@@ -50,6 +50,7 @@
u32 mmio_base;
#ifdef __NetBSD__
struct drm_local_map virtual_start_map;
+ bool virtual_start_mapped;
#else
void __iomem *virtual_start;
#endif
Home |
Main Index |
Thread Index |
Old Index