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 fe29d604b82..5ea167623a8 100644 --- a/drivers/gpu/drm/nouveau/nouveau_notifier.c +++ b/drivers/gpu/drm/nouveau/nouveau_notifier.c | |||
| @@ -96,7 +96,8 @@ nouveau_notifier_gpuobj_dtor(struct drm_device *dev, | |||
| 96 | 96 | ||
| 97 | int | 97 | int |
| 98 | nouveau_notifier_alloc(struct nouveau_channel *chan, uint32_t handle, | 98 | nouveau_notifier_alloc(struct nouveau_channel *chan, uint32_t handle, |
| 99 | int size, uint32_t *b_offset) | 99 | int size, uint32_t start, uint32_t end, |
| 100 | uint32_t *b_offset) | ||
| 100 | { | 101 | { |
| 101 | struct drm_device *dev = chan->dev; | 102 | struct drm_device *dev = chan->dev; |
| 102 | struct nouveau_gpuobj *nobj = NULL; | 103 | struct nouveau_gpuobj *nobj = NULL; |
| @@ -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; |
| @@ -177,7 +179,8 @@ nouveau_ioctl_notifier_alloc(struct drm_device *dev, void *data, | |||
| 177 | if (IS_ERR(chan)) | 179 | if (IS_ERR(chan)) |
| 178 | return PTR_ERR(chan); | 180 | return PTR_ERR(chan); |
| 179 | 181 | ||
| 180 | ret = nouveau_notifier_alloc(chan, na->handle, na->size, &na->offset); | 182 | ret = nouveau_notifier_alloc(chan, na->handle, na->size, 0, 0x1000, |
| 183 | &na->offset); | ||
| 181 | nouveau_channel_put(&chan); | 184 | nouveau_channel_put(&chan); |
| 182 | return ret; | 185 | return ret; |
| 183 | } | 186 | } |
