diff options
author | Ben Skeggs <skeggsb@gmail.com> | 2007-11-05 02:20:35 +1100 |
---|---|---|
committer | Ben Skeggs <skeggsb@gmail.com> | 2007-11-05 02:20:35 +1100 |
commit | 173a5be28f4ed59e27d7a719f62bc275959b5b70 (patch) | |
tree | 6f0732e540f1027762fb352590c50817f455fc83 | |
parent | 9a999e57af4a3f5a863c21154dd3b9618888c1f7 (diff) |
nouveau: hook up an inital fence irq handler
-rw-r--r-- | linux-core/nouveau_buffer.c | 47 | ||||
-rw-r--r-- | shared-core/nouveau_irq.c | 7 |
2 files changed, 32 insertions, 22 deletions
diff --git a/linux-core/nouveau_buffer.c b/linux-core/nouveau_buffer.c index 799731a2..6771df85 100644 --- a/linux-core/nouveau_buffer.c +++ b/linux-core/nouveau_buffer.c @@ -32,7 +32,8 @@ #include "nouveau_drv.h" #include "nouveau_dma.h" -struct drm_ttm_backend *nouveau_create_ttm_backend_entry(struct drm_device * dev) +static struct drm_ttm_backend * +nouveau_bo_create_ttm_backend_entry(struct drm_device * dev) { struct drm_nouveau_private *dev_priv = dev->dev_private; @@ -49,9 +50,9 @@ struct drm_ttm_backend *nouveau_create_ttm_backend_entry(struct drm_device * dev return NULL; } -int nouveau_fence_types(struct drm_buffer_object *bo, - uint32_t *fclass, - uint32_t *type) +static int +nouveau_bo_fence_type(struct drm_buffer_object *bo, + uint32_t *fclass, uint32_t *type) { *fclass = 0; @@ -62,15 +63,17 @@ int nouveau_fence_types(struct drm_buffer_object *bo, return 0; } -int nouveau_invalidate_caches(struct drm_device *dev, uint64_t buffer_flags) + +static int +nouveau_bo_invalidate_caches(struct drm_device *dev, uint64_t buffer_flags) { /* We'll do this from user space. */ return 0; } -int nouveau_init_mem_type(struct drm_device *dev, - uint32_t type, - struct drm_mem_type_manager *man) +static int +nouveau_bo_init_mem_type(struct drm_device *dev, uint32_t type, + struct drm_mem_type_manager *man) { struct drm_nouveau_private *dev_priv = dev->dev_private; @@ -132,7 +135,8 @@ int nouveau_init_mem_type(struct drm_device *dev, return 0; } -uint32_t nouveau_evict_mask(struct drm_buffer_object *bo) +static uint32_t +nouveau_bo_evict_mask(struct drm_buffer_object *bo) { switch (bo->mem.mem_type) { case DRM_BO_MEM_LOCAL: @@ -197,10 +201,9 @@ nouveau_bo_move_m2mf(struct drm_buffer_object *bo, int evict, int no_wait, 0, new_mem); } -int nouveau_move(struct drm_buffer_object *bo, - int evict, - int no_wait, - struct drm_bo_mem_reg *new_mem) +static int +nouveau_bo_move(struct drm_buffer_object *bo, int evict, int no_wait, + struct drm_bo_mem_reg *new_mem) { struct drm_bo_mem_reg *old_mem = &bo->mem; @@ -225,9 +228,9 @@ int nouveau_move(struct drm_buffer_object *bo, return 0; } -void nouveau_flush_ttm(struct drm_ttm *ttm) +static void +nouveau_bo_flush_ttm(struct drm_ttm *ttm) { - } static uint32_t nouveau_mem_prios[] = { @@ -248,12 +251,12 @@ struct drm_bo_driver nouveau_bo_driver = { .mem_busy_prio = nouveau_busy_prios, .num_mem_type_prio = sizeof(nouveau_mem_prios)/sizeof(uint32_t), .num_mem_busy_prio = sizeof(nouveau_busy_prios)/sizeof(uint32_t), - .create_ttm_backend_entry = nouveau_create_ttm_backend_entry, - .fence_type = nouveau_fence_types, - .invalidate_caches = nouveau_invalidate_caches, - .init_mem_type = nouveau_init_mem_type, - .evict_mask = nouveau_evict_mask, - .move = nouveau_move, - .ttm_cache_flush= nouveau_flush_ttm + .create_ttm_backend_entry = nouveau_bo_create_ttm_backend_entry, + .fence_type = nouveau_bo_fence_type, + .invalidate_caches = nouveau_bo_invalidate_caches, + .init_mem_type = nouveau_bo_init_mem_type, + .evict_mask = nouveau_bo_evict_mask, + .move = nouveau_bo_move, + .ttm_cache_flush= nouveau_bo_flush_ttm }; diff --git a/shared-core/nouveau_irq.c b/shared-core/nouveau_irq.c index ac507299..ad9a6fcf 100644 --- a/shared-core/nouveau_irq.c +++ b/shared-core/nouveau_irq.c @@ -301,6 +301,13 @@ nouveau_pgraph_intr_notify(struct drm_device *dev, uint32_t nsource) int handled = 0; DRM_DEBUG("PGRAPH notify interrupt\n"); + + if (nsource & NV03_PGRAPH_NSOURCE_NOTIFICATION && dev_priv->ttm) { + int channel; + if (!nouveau_graph_trapped_channel(dev, &channel)) + nouveau_fence_handler(dev, channel); + } + if (dev_priv->card_type == NV_04 && (nsource & NV03_PGRAPH_NSOURCE_ILLEGAL_MTHD)) { uint32_t class, mthd; |