diff options
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_notifier.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_notifier.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_notifier.c b/drivers/gpu/drm/nouveau/nouveau_notifier.c index a86f27655fc..7ba3fc0b30c 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 | } |