diff options
author | Dave Airlie <airlied@redhat.com> | 2011-03-15 21:34:41 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2011-03-15 21:34:41 -0400 |
commit | 38f1cff0863809587b5fd10ecd0c24c8b543a48c (patch) | |
tree | 7cf6eb88cdc938c3683209d38311e711a1119400 /drivers/gpu/drm/nouveau | |
parent | 4819d2e4310796c4e9eef674499af9b9caf36b5a (diff) | |
parent | 5359533801e3dd3abca5b7d3d985b0b33fd9fe8b (diff) |
Merge commit '5359533801e3dd3abca5b7d3d985b0b33fd9fe8b' into drm-core-next
This commit changed an internal radeon structure, that meant a new driver
in -next had to be fixed up, merge in the commit and fix up the driver.
Also fixes a trivial nouveau merge.
Conflicts:
drivers/gpu/drm/nouveau/nouveau_mem.c
Diffstat (limited to 'drivers/gpu/drm/nouveau')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_dma.c | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_drv.h | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_mem.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_mm.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_notifier.c | 11 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nv50_instmem.c | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nv50_vm.c | 4 |
7 files changed, 28 insertions, 9 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_dma.c b/drivers/gpu/drm/nouveau/nouveau_dma.c index 1ef39be996ed..ce38e97b9428 100644 --- a/drivers/gpu/drm/nouveau/nouveau_dma.c +++ b/drivers/gpu/drm/nouveau/nouveau_dma.c | |||
@@ -83,7 +83,8 @@ nouveau_dma_init(struct nouveau_channel *chan) | |||
83 | return ret; | 83 | return ret; |
84 | 84 | ||
85 | /* NV_MEMORY_TO_MEMORY_FORMAT requires a notifier object */ | 85 | /* NV_MEMORY_TO_MEMORY_FORMAT requires a notifier object */ |
86 | ret = nouveau_notifier_alloc(chan, NvNotify0, 32, &chan->m2mf_ntfy); | 86 | ret = nouveau_notifier_alloc(chan, NvNotify0, 32, 0xfd0, 0x1000, |
87 | &chan->m2mf_ntfy); | ||
87 | if (ret) | 88 | if (ret) |
88 | return ret; | 89 | return ret; |
89 | 90 | ||
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h index 8efefed58c15..06111887b789 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drv.h +++ b/drivers/gpu/drm/nouveau/nouveau_drv.h | |||
@@ -853,7 +853,8 @@ extern const struct ttm_mem_type_manager_func nouveau_gart_manager; | |||
853 | extern int nouveau_notifier_init_channel(struct nouveau_channel *); | 853 | extern int nouveau_notifier_init_channel(struct nouveau_channel *); |
854 | extern void nouveau_notifier_takedown_channel(struct nouveau_channel *); | 854 | extern void nouveau_notifier_takedown_channel(struct nouveau_channel *); |
855 | extern int nouveau_notifier_alloc(struct nouveau_channel *, uint32_t handle, | 855 | extern int nouveau_notifier_alloc(struct nouveau_channel *, uint32_t handle, |
856 | int cout, uint32_t *offset); | 856 | int cout, uint32_t start, uint32_t end, |
857 | uint32_t *offset); | ||
857 | extern int nouveau_notifier_offset(struct nouveau_gpuobj *, uint32_t *); | 858 | extern int nouveau_notifier_offset(struct nouveau_gpuobj *, uint32_t *); |
858 | extern int nouveau_ioctl_notifier_alloc(struct drm_device *, void *data, | 859 | extern int nouveau_ioctl_notifier_alloc(struct drm_device *, void *data, |
859 | struct drm_file *); | 860 | struct drm_file *); |
diff --git a/drivers/gpu/drm/nouveau/nouveau_mem.c b/drivers/gpu/drm/nouveau/nouveau_mem.c index 02b48d183f4a..2683377f4131 100644 --- a/drivers/gpu/drm/nouveau/nouveau_mem.c +++ b/drivers/gpu/drm/nouveau/nouveau_mem.c | |||
@@ -759,8 +759,10 @@ nouveau_vram_manager_new(struct ttm_mem_type_manager *man, | |||
759 | ret = vram->get(dev, mem->num_pages << PAGE_SHIFT, | 759 | ret = vram->get(dev, mem->num_pages << PAGE_SHIFT, |
760 | mem->page_alignment << PAGE_SHIFT, size_nc, | 760 | mem->page_alignment << PAGE_SHIFT, size_nc, |
761 | (nvbo->tile_flags >> 8) & 0x3ff, &node); | 761 | (nvbo->tile_flags >> 8) & 0x3ff, &node); |
762 | if (ret) | 762 | if (ret) { |
763 | return ret; | 763 | mem->mm_node = NULL; |
764 | return (ret == -ENOSPC) ? 0 : ret; | ||
765 | } | ||
764 | 766 | ||
765 | node->page_shift = 12; | 767 | node->page_shift = 12; |
766 | if (nvbo->vma.node) | 768 | if (nvbo->vma.node) |
diff --git a/drivers/gpu/drm/nouveau/nouveau_mm.c b/drivers/gpu/drm/nouveau/nouveau_mm.c index 8844b50c3e54..7609756b6faf 100644 --- a/drivers/gpu/drm/nouveau/nouveau_mm.c +++ b/drivers/gpu/drm/nouveau/nouveau_mm.c | |||
@@ -123,7 +123,7 @@ nouveau_mm_get(struct nouveau_mm *rmm, int type, u32 size, u32 size_nc, | |||
123 | return 0; | 123 | return 0; |
124 | } | 124 | } |
125 | 125 | ||
126 | return -ENOMEM; | 126 | return -ENOSPC; |
127 | } | 127 | } |
128 | 128 | ||
129 | int | 129 | int |
diff --git a/drivers/gpu/drm/nouveau/nouveau_notifier.c b/drivers/gpu/drm/nouveau/nouveau_notifier.c index a86f27655fc4..7ba3fc0b30c1 100644 --- a/drivers/gpu/drm/nouveau/nouveau_notifier.c +++ b/drivers/gpu/drm/nouveau/nouveau_notifier.c | |||
@@ -95,7 +95,8 @@ nouveau_notifier_gpuobj_dtor(struct drm_device *dev, | |||
95 | 95 | ||
96 | int | 96 | int |
97 | nouveau_notifier_alloc(struct nouveau_channel *chan, uint32_t handle, | 97 | nouveau_notifier_alloc(struct nouveau_channel *chan, uint32_t handle, |
98 | int size, uint32_t *b_offset) | 98 | int size, uint32_t start, uint32_t end, |
99 | uint32_t *b_offset) | ||
99 | { | 100 | { |
100 | struct drm_device *dev = chan->dev; | 101 | struct drm_device *dev = chan->dev; |
101 | struct drm_nouveau_private *dev_priv = dev->dev_private; | 102 | struct drm_nouveau_private *dev_priv = dev->dev_private; |
@@ -104,9 +105,10 @@ nouveau_notifier_alloc(struct nouveau_channel *chan, uint32_t handle, | |||
104 | uint32_t offset; | 105 | uint32_t offset; |
105 | int target, ret; | 106 | int target, ret; |
106 | 107 | ||
107 | mem = drm_mm_search_free(&chan->notifier_heap, size, 0, 0); | 108 | mem = drm_mm_search_free_in_range(&chan->notifier_heap, size, 0, |
109 | start, end, 0); | ||
108 | if (mem) | 110 | if (mem) |
109 | mem = drm_mm_get_block(mem, size, 0); | 111 | mem = drm_mm_get_block_range(mem, size, 0, start, end); |
110 | if (!mem) { | 112 | if (!mem) { |
111 | NV_ERROR(dev, "Channel %d notifier block full\n", chan->id); | 113 | NV_ERROR(dev, "Channel %d notifier block full\n", chan->id); |
112 | return -ENOMEM; | 114 | return -ENOMEM; |
@@ -182,7 +184,8 @@ nouveau_ioctl_notifier_alloc(struct drm_device *dev, void *data, | |||
182 | if (IS_ERR(chan)) | 184 | if (IS_ERR(chan)) |
183 | return PTR_ERR(chan); | 185 | return PTR_ERR(chan); |
184 | 186 | ||
185 | ret = nouveau_notifier_alloc(chan, na->handle, na->size, &na->offset); | 187 | ret = nouveau_notifier_alloc(chan, na->handle, na->size, 0, 0x1000, |
188 | &na->offset); | ||
186 | nouveau_channel_put(&chan); | 189 | nouveau_channel_put(&chan); |
187 | return ret; | 190 | return ret; |
188 | } | 191 | } |
diff --git a/drivers/gpu/drm/nouveau/nv50_instmem.c b/drivers/gpu/drm/nouveau/nv50_instmem.c index 306d4b1f585f..a6f8aa651fc6 100644 --- a/drivers/gpu/drm/nouveau/nv50_instmem.c +++ b/drivers/gpu/drm/nouveau/nv50_instmem.c | |||
@@ -403,16 +403,24 @@ nv50_instmem_unmap(struct nouveau_gpuobj *gpuobj) | |||
403 | void | 403 | void |
404 | nv50_instmem_flush(struct drm_device *dev) | 404 | nv50_instmem_flush(struct drm_device *dev) |
405 | { | 405 | { |
406 | struct drm_nouveau_private *dev_priv = dev->dev_private; | ||
407 | |||
408 | spin_lock(&dev_priv->ramin_lock); | ||
406 | nv_wr32(dev, 0x00330c, 0x00000001); | 409 | nv_wr32(dev, 0x00330c, 0x00000001); |
407 | if (!nv_wait(dev, 0x00330c, 0x00000002, 0x00000000)) | 410 | if (!nv_wait(dev, 0x00330c, 0x00000002, 0x00000000)) |
408 | NV_ERROR(dev, "PRAMIN flush timeout\n"); | 411 | NV_ERROR(dev, "PRAMIN flush timeout\n"); |
412 | spin_unlock(&dev_priv->ramin_lock); | ||
409 | } | 413 | } |
410 | 414 | ||
411 | void | 415 | void |
412 | nv84_instmem_flush(struct drm_device *dev) | 416 | nv84_instmem_flush(struct drm_device *dev) |
413 | { | 417 | { |
418 | struct drm_nouveau_private *dev_priv = dev->dev_private; | ||
419 | |||
420 | spin_lock(&dev_priv->ramin_lock); | ||
414 | nv_wr32(dev, 0x070000, 0x00000001); | 421 | nv_wr32(dev, 0x070000, 0x00000001); |
415 | if (!nv_wait(dev, 0x070000, 0x00000002, 0x00000000)) | 422 | if (!nv_wait(dev, 0x070000, 0x00000002, 0x00000000)) |
416 | NV_ERROR(dev, "PRAMIN flush timeout\n"); | 423 | NV_ERROR(dev, "PRAMIN flush timeout\n"); |
424 | spin_unlock(&dev_priv->ramin_lock); | ||
417 | } | 425 | } |
418 | 426 | ||
diff --git a/drivers/gpu/drm/nouveau/nv50_vm.c b/drivers/gpu/drm/nouveau/nv50_vm.c index b23794c8859b..4fd3432b5b8d 100644 --- a/drivers/gpu/drm/nouveau/nv50_vm.c +++ b/drivers/gpu/drm/nouveau/nv50_vm.c | |||
@@ -173,7 +173,11 @@ nv50_vm_flush(struct nouveau_vm *vm) | |||
173 | void | 173 | void |
174 | nv50_vm_flush_engine(struct drm_device *dev, int engine) | 174 | nv50_vm_flush_engine(struct drm_device *dev, int engine) |
175 | { | 175 | { |
176 | struct drm_nouveau_private *dev_priv = dev->dev_private; | ||
177 | |||
178 | spin_lock(&dev_priv->ramin_lock); | ||
176 | nv_wr32(dev, 0x100c80, (engine << 16) | 1); | 179 | nv_wr32(dev, 0x100c80, (engine << 16) | 1); |
177 | if (!nv_wait(dev, 0x100c80, 0x00000001, 0x00000000)) | 180 | if (!nv_wait(dev, 0x100c80, 0x00000001, 0x00000000)) |
178 | NV_ERROR(dev, "vm flush timeout: engine %d\n", engine); | 181 | NV_ERROR(dev, "vm flush timeout: engine %d\n", engine); |
182 | spin_unlock(&dev_priv->ramin_lock); | ||
179 | } | 183 | } |