Rev 3243 | Rev 3260 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3243 | Rev 3255 | ||
---|---|---|---|
Line 136... | Line 136... | ||
136 | { |
136 | { |
137 | dev_priv->mm.object_count--; |
137 | dev_priv->mm.object_count--; |
138 | dev_priv->mm.object_memory -= size; |
138 | dev_priv->mm.object_memory -= size; |
139 | } |
139 | } |
Line 140... | Line -... | ||
140 | - | ||
Line 141... | Line 140... | ||
141 | #if 0 |
140 | |
142 | 141 | ||
143 | static int |
142 | static int |
144 | i915_gem_wait_for_error(struct drm_device *dev) |
143 | i915_gem_wait_for_error(struct drm_device *dev) |
Line 148... | Line 147... | ||
148 | unsigned long flags; |
147 | unsigned long flags; |
149 | int ret; |
148 | int ret; |
Line 150... | Line 149... | ||
150 | 149 | ||
151 | if (!atomic_read(&dev_priv->mm.wedged)) |
150 | if (!atomic_read(&dev_priv->mm.wedged)) |
152 | return 0; |
151 | return 0; |
153 | 152 | #if 0 |
|
154 | /* |
153 | /* |
155 | * Only wait 10 seconds for the gpu reset to complete to avoid hanging |
154 | * Only wait 10 seconds for the gpu reset to complete to avoid hanging |
156 | * userspace. If it takes that long something really bad is going on and |
155 | * userspace. If it takes that long something really bad is going on and |
157 | * we should simply try to bail out and fail as gracefully as possible. |
156 | * we should simply try to bail out and fail as gracefully as possible. |
Line 172... | Line 171... | ||
172 | */ |
171 | */ |
173 | spin_lock_irqsave(&x->wait.lock, flags); |
172 | spin_lock_irqsave(&x->wait.lock, flags); |
174 | x->done++; |
173 | x->done++; |
175 | spin_unlock_irqrestore(&x->wait.lock, flags); |
174 | spin_unlock_irqrestore(&x->wait.lock, flags); |
176 | } |
175 | } |
- | 176 | #endif |
|
- | 177 | ||
177 | return 0; |
178 | return 0; |
178 | } |
179 | } |
Line 179... | Line 180... | ||
179 | 180 | ||
180 | int i915_mutex_lock_interruptible(struct drm_device *dev) |
181 | int i915_mutex_lock_interruptible(struct drm_device *dev) |
Line 183... | Line 184... | ||
183 | 184 | ||
184 | ret = i915_gem_wait_for_error(dev); |
185 | ret = i915_gem_wait_for_error(dev); |
185 | if (ret) |
186 | if (ret) |
Line 186... | Line 187... | ||
186 | return ret; |
187 | return ret; |
187 | - | ||
188 | ret = mutex_lock_interruptible(&dev->struct_mutex); |
- | |
Line 189... | Line 188... | ||
189 | if (ret) |
188 | |
190 | return ret; |
189 | mutex_lock(&dev->struct_mutex); |
191 | 190 | ||
192 | WARN_ON(i915_verify_lists(dev)); |
- | |
Line 193... | Line 191... | ||
193 | return 0; |
191 | WARN_ON(i915_verify_lists(dev)); |
194 | } |
192 | return 0; |
195 | #endif |
193 | } |
196 | 194 | ||
Line 249... | Line 247... | ||
249 | args->aper_available_size = args->aper_size - pinned; |
247 | args->aper_available_size = args->aper_size - pinned; |
Line 250... | Line 248... | ||
250 | 248 | ||
251 | return 0; |
249 | return 0; |
Line 252... | Line -... | ||
252 | } |
- | |
253 | 250 | } |
|
254 | #if 0 |
251 | |
255 | static int |
252 | static int |
256 | i915_gem_create(struct drm_file *file, |
253 | i915_gem_create(struct drm_file *file, |
257 | struct drm_device *dev, |
254 | struct drm_device *dev, |
Line 282... | Line 279... | ||
282 | /* drop reference from allocate - handle holds it now */ |
279 | /* drop reference from allocate - handle holds it now */ |
283 | drm_gem_object_unreference(&obj->base); |
280 | drm_gem_object_unreference(&obj->base); |
284 | trace_i915_gem_object_create(obj); |
281 | trace_i915_gem_object_create(obj); |
Line 285... | Line 282... | ||
285 | 282 | ||
- | 283 | *handle_p = handle; |
|
286 | *handle_p = handle; |
284 | |
287 | return 0; |
285 | return 0; |
Line 288... | Line 286... | ||
288 | } |
286 | } |
289 | 287 | ||
Line 317... | Line 315... | ||
317 | 315 | ||
318 | return i915_gem_create(file, dev, |
316 | return i915_gem_create(file, dev, |
319 | args->size, &args->handle); |
317 | args->size, &args->handle); |
Line -... | Line 318... | ||
- | 318 | } |
|
- | 319 | ||
320 | } |
320 | #if 0 |
321 | 321 | ||
322 | static int i915_gem_object_needs_bit17_swizzle(struct drm_i915_gem_object *obj) |
322 | static int i915_gem_object_needs_bit17_swizzle(struct drm_i915_gem_object *obj) |
Line 323... | Line 323... | ||
323 | { |
323 | { |
Line 1471... | Line 1471... | ||
1471 | * at this point until we release them. |
1471 | * at this point until we release them. |
1472 | * |
1472 | * |
1473 | * Fail silently without starting the shrinker |
1473 | * Fail silently without starting the shrinker |
1474 | */ |
1474 | */ |
1475 | for_each_sg(st->sgl, sg, page_count, i) { |
1475 | for_each_sg(st->sgl, sg, page_count, i) { |
1476 | page = AllocPage(); // oh-oh |
1476 | page = (struct page *)AllocPage(); // oh-oh |
1477 | if ( page == 0 ) |
1477 | if ( page == 0 ) |
1478 | goto err_pages; |
1478 | goto err_pages; |
Line 1479... | Line 1479... | ||
1479 | 1479 | ||
1480 | sg_set_page(sg, page, PAGE_SIZE, 0); |
1480 | sg_set_page(sg, page, PAGE_SIZE, 0); |
Line 3052... | Line 3052... | ||
3052 | 3052 | ||
3053 | if (--obj->pin_count == 0) |
3053 | if (--obj->pin_count == 0) |
3054 | obj->pin_mappable = false; |
3054 | obj->pin_mappable = false; |
Line 3055... | Line -... | ||
3055 | } |
- | |
3056 | 3055 | } |
|
3057 | #if 0 |
3056 | |
3058 | int |
3057 | int |
3059 | i915_gem_pin_ioctl(struct drm_device *dev, void *data, |
3058 | i915_gem_pin_ioctl(struct drm_device *dev, void *data, |
3060 | struct drm_file *file) |
3059 | struct drm_file *file) |
Line 3105... | Line 3104... | ||
3105 | unlock: |
3104 | unlock: |
3106 | mutex_unlock(&dev->struct_mutex); |
3105 | mutex_unlock(&dev->struct_mutex); |
3107 | return ret; |
3106 | return ret; |
3108 | } |
3107 | } |
Line -... | Line 3108... | ||
- | 3108 | ||
- | 3109 | #if 0 |
|
3109 | 3110 | ||
3110 | int |
3111 | int |
3111 | i915_gem_unpin_ioctl(struct drm_device *dev, void *data, |
3112 | i915_gem_unpin_ioctl(struct drm_device *dev, void *data, |
3112 | struct drm_file *file) |
3113 | struct drm_file *file) |
3113 | { |
3114 | { |