summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--shared-core/i915_dma.c13
-rw-r--r--shared-core/i915_drv.h12
-rw-r--r--shared-core/i915_irq.c11
3 files changed, 26 insertions, 10 deletions
diff --git a/shared-core/i915_dma.c b/shared-core/i915_dma.c
index 77b4181c..5a69b1f3 100644
--- a/shared-core/i915_dma.c
+++ b/shared-core/i915_dma.c
@@ -63,7 +63,7 @@ int i915_wait_ring(struct drm_device * dev, int n, const char *caller)
last_head = ring->head;
last_acthd = acthd;
- msleep_interruptible (10);
+ DRM_UDELAY(10 * 1000);
}
return -EBUSY;
@@ -126,7 +126,9 @@ void i915_ring_validate(struct drm_device *dev, const char *func, int line)
DRM_ERROR("%s:%d head sw %x, hw %x. tail sw %x hw %x\n",
func, line,
ring->head, head, ring->tail, tail);
+#ifdef __linux__
BUG_ON(1);
+#endif
}
}
#endif
@@ -1070,9 +1072,9 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
ret = drm_addmap(dev, base, size, _DRM_REGISTERS,
_DRM_KERNEL | _DRM_DRIVER, &dev_priv->mmio_map);
-
+#ifdef I915_HAVE_GEM
i915_gem_load(dev);
-
+#endif
DRM_SPININIT(&dev_priv->swaps_lock, "swap");
DRM_SPININIT(&dev_priv->user_irq_lock, "userirq");
@@ -1138,8 +1140,9 @@ void i915_driver_lastclose(struct drm_device * dev)
dev_priv->val_bufs = NULL;
}
#endif
+#ifdef I915_HAVE_GEM
i915_gem_lastclose(dev);
-
+#endif
if (drm_getsarea(dev) && dev_priv->sarea_priv)
i915_do_cleanup_pageflip(dev);
if (dev_priv->sarea_priv)
@@ -1218,6 +1221,7 @@ struct drm_ioctl_desc i915_ioctls[] = {
#ifdef I915_HAVE_BUFFER
DRM_IOCTL_DEF(DRM_I915_EXECBUFFER, i915_execbuffer, DRM_AUTH),
#endif
+#ifdef I915_HAVE_GEM
DRM_IOCTL_DEF(DRM_I915_GEM_INIT, i915_gem_init_ioctl, DRM_AUTH),
DRM_IOCTL_DEF(DRM_I915_GEM_EXECBUFFER, i915_gem_execbuffer, DRM_AUTH),
DRM_IOCTL_DEF(DRM_I915_GEM_PIN, i915_gem_pin_ioctl, DRM_AUTH|DRM_ROOT_ONLY),
@@ -1234,6 +1238,7 @@ struct drm_ioctl_desc i915_ioctls[] = {
DRM_IOCTL_DEF(DRM_I915_GEM_SW_FINISH, i915_gem_sw_finish_ioctl, 0),
DRM_IOCTL_DEF(DRM_I915_GEM_SET_TILING, i915_gem_set_tiling, 0),
DRM_IOCTL_DEF(DRM_I915_GEM_GET_TILING, i915_gem_get_tiling, 0),
+#endif
};
int i915_max_ioctl = DRM_ARRAY_SIZE(i915_ioctls);
diff --git a/shared-core/i915_drv.h b/shared-core/i915_drv.h
index f84dcc25..48fd30d7 100644
--- a/shared-core/i915_drv.h
+++ b/shared-core/i915_drv.h
@@ -42,6 +42,7 @@
#if defined(__linux__)
#define I915_HAVE_FENCE
#define I915_HAVE_BUFFER
+#define I915_HAVE_GEM
#endif
/* Interface history:
@@ -277,8 +278,9 @@ typedef struct drm_i915_private {
u8 saveCR[37];
struct {
+#ifdef __linux__
struct drm_mm gtt_space;
-
+#endif
/**
* List of objects currently involved in rendering from the
* ringbuffer.
@@ -311,7 +313,7 @@ typedef struct drm_i915_private {
* outstanding.
*/
struct list_head request_list;
-
+#ifdef __linux__
/**
* We leave the user IRQ off as much as possible,
* but this means that requests will finish and never
@@ -320,7 +322,7 @@ typedef struct drm_i915_private {
* fires, go retire requests.
*/
struct delayed_work retire_work;
-
+#endif
uint32_t next_gem_seqno;
/**
@@ -473,6 +475,8 @@ extern int i915_driver_firstopen(struct drm_device *dev);
extern int i915_dispatch_batchbuffer(struct drm_device * dev,
drm_i915_batchbuffer_t * batch);
extern int i915_quiescent(struct drm_device *dev);
+extern int i915_init_hardware_status(struct drm_device *dev);
+extern void i915_free_hardware_status(struct drm_device *dev);
int i915_emit_box(struct drm_device * dev,
struct drm_clip_rect __user * boxes,
@@ -593,8 +597,6 @@ void i915_gem_clflush_object(struct drm_gem_object *obj);
void i915_gem_detect_bit_6_swizzle(struct drm_device *dev);
/* i915_gem_debug.c */
-void i915_gem_dump_object(struct drm_gem_object *obj, int len,
- const char *where, uint32_t mark);
#if WATCH_INACTIVE
void i915_verify_inactive(struct drm_device *dev, char *file, int line);
#else
diff --git a/shared-core/i915_irq.c b/shared-core/i915_irq.c
index 8bd2804f..693e9429 100644
--- a/shared-core/i915_irq.c
+++ b/shared-core/i915_irq.c
@@ -432,19 +432,22 @@ irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS)
u32 iir;
u32 pipea_stats = 0, pipeb_stats = 0;
int vblank = 0;
-
+#ifdef __linux__
if (dev->pdev->msi_enabled)
I915_WRITE(IMR, ~0);
+#endif
iir = I915_READ(IIR);
#if 0
DRM_DEBUG("flag=%08x\n", iir);
#endif
atomic_inc(&dev_priv->irq_received);
if (iir == 0) {
+#ifdef __linux__
if (dev->pdev->msi_enabled) {
I915_WRITE(IMR, dev_priv->irq_mask_reg);
(void) I915_READ(IMR);
}
+#endif
return IRQ_NONE;
}
@@ -499,12 +502,16 @@ irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS)
dev_priv->sarea_priv->last_dispatch = READ_BREADCRUMB(dev_priv);
I915_WRITE(IIR, iir);
+#ifdef __linux__
if (dev->pdev->msi_enabled)
I915_WRITE(IMR, dev_priv->irq_mask_reg);
+#endif
(void) I915_READ(IIR); /* Flush posted writes */
if (iir & I915_USER_INTERRUPT) {
+#ifdef I915_HAVE_GEM
dev_priv->mm.irq_gem_seqno = i915_get_gem_seqno(dev);
+#endif
DRM_WAKEUP(&dev_priv->irq_queue);
#ifdef I915_HAVE_FENCE
i915_fence_handler(dev);
@@ -549,7 +556,9 @@ void i915_user_irq_on(drm_i915_private_t *dev_priv)
void i915_user_irq_off(drm_i915_private_t *dev_priv)
{
DRM_SPINLOCK(&dev_priv->user_irq_lock);
+#ifdef __linux__
BUG_ON(dev_priv->irq_enabled && dev_priv->user_irq_refcount <= 0);
+#endif
if (dev_priv->irq_enabled && (--dev_priv->user_irq_refcount == 0))
i915_disable_irq(dev_priv, I915_USER_INTERRUPT);
DRM_SPINUNLOCK(&dev_priv->user_irq_lock);