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 Convert dri1 gf...
details: https://anonhg.NetBSD.org/src/rev/ca96a98eaea7
branches: riastradh-drm2
changeset: 788289:ca96a98eaea7
user: riastradh <riastradh%NetBSD.org@localhost>
date: Wed Jul 24 03:05:24 2013 +0000
description:
Convert dri1 gfx_hws_cpu from ioremap to drm_ioremap.
diffstat:
sys/external/bsd/drm2/dist/drm/i915/i915_dma.c | 35 ++++++++++++++++++++++++++
sys/external/bsd/drm2/dist/drm/i915/i915_drv.h | 4 ++
2 files changed, 39 insertions(+), 0 deletions(-)
diffs (90 lines):
diff -r bdba65a3a43c -r ca96a98eaea7 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:07 2013 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_dma.c Wed Jul 24 03:05:24 2013 +0000
@@ -72,7 +72,11 @@
intel_read_legacy_status_page(struct drm_i915_private *dev_priv, int reg)
{
if (I915_NEED_GFX_HWS(dev_priv->dev))
+#ifdef __NetBSD__
+ return DRM_READ32(&dev_priv->dri1.gfx_hws_cpu_map, reg);
+#else
return ioread32(dev_priv->dri1.gfx_hws_cpu_addr + reg);
+#endif
else
return intel_read_status_page(LP_RING(dev_priv), reg);
}
@@ -121,7 +125,11 @@
if (ring->status_page.gfx_addr) {
ring->status_page.gfx_addr = 0;
+#ifdef __NetBSD__
+ drm_iounmap(dev, &dev_priv->dri1.gfx_hws_cpu_map);
+#else
iounmap(dev_priv->dri1.gfx_hws_cpu_addr);
+#endif
}
/* Need to rewrite hardware status page */
@@ -1049,6 +1057,10 @@
drm_i915_private_t *dev_priv = dev->dev_private;
drm_i915_hws_addr_t *hws = data;
struct intel_ring_buffer *ring;
+#ifdef __NetBSD__
+ struct drm_local_map *const gfx_hws_cpu_map =
+ &dev_priv->dri1.gfx_hws_cpu_map;
+#endif
if (drm_core_check_feature(dev, DRIVER_MODESET))
return -ENODEV;
@@ -1071,6 +1083,27 @@
ring = LP_RING(dev_priv);
ring->status_page.gfx_addr = hws->addr & (0x1ffff<<12);
+#ifdef __NetBSD__
+ gfx_hws_cpu_map->offset = (dev_priv->mm.gtt_base_addr +
+ hws->addr);
+ gfx_hws_cpu_map->size = 4096;
+ gfx_hws_cpu_map->flags = 0;
+ gfx_hws_cpu_map->flags |= _DRM_RESTRICTED;
+ gfx_hws_cpu_map->flags |= _DRM_KERNEL;
+ gfx_hws_cpu_map->flags |= _DRM_WRITE_COMBINING;
+ gfx_hws_cpu_map->flags |= _DRM_DRIVER;
+ if (drm_ioremap(dev, gfx_hws_cpu_map) == NULL) {
+ i915_dma_cleanup(dev);
+ ring->status_page.gfx_addr = 0;
+ DRM_ERROR("can not ioremap virtual address for"
+ " G33 hw status page\n");
+ return -ENOMEM;
+ }
+
+ /* XXX drm_local_map abstraction violation. Pooh. */
+ bus_space_set_region_1(gfx_hws_cpu_map->lm_data.bus_space.bst,
+ gfx_hws_cpu_map->lm_data.bus_space.bsh, 0, 0, PAGE_SIZE);
+#else
dev_priv->dri1.gfx_hws_cpu_addr =
ioremap_wc(dev_priv->mm.gtt_base_addr + hws->addr, 4096);
if (dev_priv->dri1.gfx_hws_cpu_addr == NULL) {
@@ -1082,6 +1115,8 @@
}
memset_io(dev_priv->dri1.gfx_hws_cpu_addr, 0, PAGE_SIZE);
+#endif
+
I915_WRITE(HWS_PGA, ring->status_page.gfx_addr);
DRM_DEBUG_DRIVER("load hws HWS_PGA with gfx mem 0x%x\n",
diff -r bdba65a3a43c -r ca96a98eaea7 sys/external/bsd/drm2/dist/drm/i915/i915_drv.h
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_drv.h Wed Jul 24 03:05:07 2013 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_drv.h Wed Jul 24 03:05:24 2013 +0000
@@ -606,7 +606,11 @@
struct i915_dri1_state {
unsigned allow_batchbuffer : 1;
+#ifdef __NetBSD__
+ struct drm_local_map gfx_hws_cpu_map;
+#else
u32 __iomem *gfx_hws_cpu_addr;
+#endif
unsigned int cpp;
int back_offset;
Home |
Main Index |
Thread Index |
Old Index