summaryrefslogtreecommitdiff
path: root/shared-core
diff options
context:
space:
mode:
authorThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2006-08-31 21:42:29 +0200
committerThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2006-08-31 21:42:29 +0200
commit44f6d08988a77a640bea40d09cb61eec7566a5ce (patch)
tree0ce4e08474993190dd3065edb96b8976b04242df /shared-core
parent03c137c5f8d44c374406efe19c01105fcf34d583 (diff)
Validation and fencing.
Diffstat (limited to 'shared-core')
-rw-r--r--shared-core/drm.h14
-rw-r--r--shared-core/i915_dma.c23
-rw-r--r--shared-core/i915_drv.h9
3 files changed, 44 insertions, 2 deletions
diff --git a/shared-core/drm.h b/shared-core/drm.h
index 9640855c..f76fd86f 100644
--- a/shared-core/drm.h
+++ b/shared-core/drm.h
@@ -723,7 +723,15 @@ typedef struct drm_ttm_arg {
/* When creating a buffer, Avoid system storage even if allowed */
#define DRM_BO_HINT_AVOID_LOCAL 0x00000001
/* Don't block on validate and map */
-#define DRM_BO_HINT_DONT_BLOCK 0x00000002
+#define DRM_BO_HINT_DONT_BLOCK 0x00000002
+/* Don't place this buffer on the unfenced list.*/
+#define DRM_BO_HINT_DONT_FENCE 0x00000004
+
+
+
+
+/* Driver specific flags. Could be for example rendering engine */
+#define DRM_BO_MASK_DRIVER 0x00F00000
typedef enum {
drm_bo_type_ttm,
@@ -779,7 +787,9 @@ typedef union drm_mm_init_arg{
enum {
mm_init,
mm_takedown,
- mm_query
+ mm_query,
+ mm_lock,
+ mm_unlock
} op;
drm_u64_t vr_p_offset;
drm_u64_t vr_p_size;
diff --git a/shared-core/i915_dma.c b/shared-core/i915_dma.c
index e661269b..baeab383 100644
--- a/shared-core/i915_dma.c
+++ b/shared-core/i915_dma.c
@@ -444,6 +444,28 @@ static void i915_emit_breadcrumb(drm_device_t *dev)
#endif
}
+
+int i915_emit_mi_flush(drm_device_t *dev, uint32_t flush)
+{
+ drm_i915_private_t *dev_priv = dev->dev_private;
+ uint32_t flush_cmd = CMD_MI_FLUSH;
+ RING_LOCALS;
+
+ flush_cmd |= flush;
+
+ i915_kernel_lost_context(dev);
+
+ BEGIN_LP_RING(4);
+ OUT_RING(flush_cmd);
+ OUT_RING(0);
+ OUT_RING(0);
+ OUT_RING(0);
+ ADVANCE_LP_RING();
+
+ return 0;
+}
+
+
static int i915_dispatch_cmdbuffer(drm_device_t * dev,
drm_i915_cmdbuffer_t * cmd)
{
@@ -680,6 +702,7 @@ static int i915_flip_bufs(DRM_IOCTL_ARGS)
return i915_dispatch_flip(dev);
}
+
static int i915_getparam(DRM_IOCTL_ARGS)
{
DRM_DEVICE;
diff --git a/shared-core/i915_drv.h b/shared-core/i915_drv.h
index 403124c9..8bf82ed8 100644
--- a/shared-core/i915_drv.h
+++ b/shared-core/i915_drv.h
@@ -124,6 +124,8 @@ extern void i915_driver_preclose(drm_device_t * dev, DRMFILE filp);
extern int i915_driver_device_is_agp(drm_device_t * dev);
extern long i915_compat_ioctl(struct file *filp, unsigned int cmd,
unsigned long arg);
+extern int i915_emit_mi_flush(drm_device_t *dev, uint32_t flush);
+
/* i915_irq.c */
extern int i915_irq_emit(DRM_IOCTL_ARGS);
@@ -158,6 +160,8 @@ extern void i915_sync_flush(drm_device_t *dev);
/* i915_buffer.c */
extern drm_ttm_backend_t *i915_create_ttm_backend_entry(drm_device_t *dev,
int cached);
+extern int i915_fence_types(uint32_t buffer_flags, uint32_t *class, uint32_t *type);
+extern int i915_invalidate_caches(drm_device_t *dev, uint32_t buffer_flags);
#endif
#define I915_READ(reg) DRM_READ32(dev_priv->mmio_map, (reg))
@@ -209,6 +213,11 @@ extern int i915_wait_ring(drm_device_t * dev, int n, const char *caller);
#define INST_OP_FLUSH 0x02000000
#define INST_FLUSH_MAP_CACHE 0x00000001
+#define CMD_MI_FLUSH (0x04 << 23)
+#define MI_NO_WRITE_FLUSH (1 << 2)
+#define MI_READ_FLUSH (1 << 0)
+#define MI_EXE_FLUSH (1 << 1)
+
#define BB1_START_ADDR_MASK (~0x7)
#define BB1_PROTECTED (1<<0)
#define BB1_UNPROTECTED (0<<0)