summaryrefslogtreecommitdiff
path: root/shared-core
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2008-05-06 13:28:26 -0700
committerEric Anholt <eric@anholt.net>2008-05-06 13:28:26 -0700
commitd2373b2a341868882208bb4297ab4f2f51302031 (patch)
tree7fa06a025f4c7090281c7b43baea2ed8d3570ccf /shared-core
parentdd6976c56f9f14ea8aa630833e9cc9711157d74f (diff)
GEM: Use irq-based fencing rather than syncing and evicting every exec.
Diffstat (limited to 'shared-core')
-rw-r--r--shared-core/i915_dma.c2
-rw-r--r--shared-core/i915_drv.h10
-rw-r--r--shared-core/i915_irq.c2
3 files changed, 13 insertions, 1 deletions
diff --git a/shared-core/i915_dma.c b/shared-core/i915_dma.c
index d881a231..0601b89c 100644
--- a/shared-core/i915_dma.c
+++ b/shared-core/i915_dma.c
@@ -1051,6 +1051,8 @@ 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);
+ INIT_LIST_HEAD(&dev_priv->mm.gtt_lru);
+
#ifdef __linux__
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
intel_init_chipset_flush_compat(dev);
diff --git a/shared-core/i915_drv.h b/shared-core/i915_drv.h
index 6c06ff5c..bd6fa188 100644
--- a/shared-core/i915_drv.h
+++ b/shared-core/i915_drv.h
@@ -244,6 +244,8 @@ typedef struct drm_i915_private {
struct {
struct drm_memrange gtt_space;
+ /** LRU List of unpinned objects in the GTT. */
+ struct list_head gtt_lru;
} mm;
} drm_i915_private_t;
@@ -256,8 +258,12 @@ enum intel_chip_family {
/** driver private structure attached to each drm_gem_object */
struct drm_i915_gem_object {
+ struct drm_gem_object *obj;
+
/** Current space allocated to this object in the GTT, if any. */
struct drm_memrange_node *gtt_space;
+ /** This object's place on the GTT LRU list */
+ struct list_head gtt_lru_entry;
/** AGP memory structure for our GTT binding. */
DRM_AGP_MEM *agp_mem;
@@ -276,6 +282,9 @@ struct drm_i915_gem_object {
/** How many users have pinned this object in GTT space */
int pin_count;
+
+ /** Breadcrumb of last rendering to the buffer. */
+ uint32_t last_rendering_cookie;
};
extern struct drm_ioctl_desc i915_ioctls[];
@@ -318,6 +327,7 @@ extern int i915_vblank_pipe_set(struct drm_device *dev, void *data,
extern int i915_vblank_pipe_get(struct drm_device *dev, void *data,
struct drm_file *file_priv);
extern int i915_emit_irq(struct drm_device * dev);
+extern int i915_wait_irq(struct drm_device * dev, int irq_nr);
extern int i915_enable_vblank(struct drm_device *dev, int crtc);
extern void i915_disable_vblank(struct drm_device *dev, int crtc);
extern u32 i915_get_vblank_counter(struct drm_device *dev, int crtc);
diff --git a/shared-core/i915_irq.c b/shared-core/i915_irq.c
index 785008d4..b17e2408 100644
--- a/shared-core/i915_irq.c
+++ b/shared-core/i915_irq.c
@@ -545,7 +545,7 @@ void i915_user_irq_off(drm_i915_private_t *dev_priv)
}
-static int i915_wait_irq(struct drm_device * dev, int irq_nr)
+int i915_wait_irq(struct drm_device * dev, int irq_nr)
{
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
int ret = 0;