Subversion Repositories Kolibri OS

Rev

Rev 4280 | Rev 4560 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4280 Rev 4539
Line 326... Line 326...
326
 
326
 
327
void i915_gem_context_close(struct drm_device *dev, struct drm_file *file)
327
void i915_gem_context_close(struct drm_device *dev, struct drm_file *file)
328
{
328
{
Line 329... Line -...
329
	struct drm_i915_file_private *file_priv = file->driver_priv;
-
 
330
 
329
	struct drm_i915_file_private *file_priv = file->driver_priv;
331
	mutex_lock(&dev->struct_mutex);
330
 
332
	idr_for_each(&file_priv->context_idr, context_idr_cleanup, NULL);
-
 
333
	idr_destroy(&file_priv->context_idr);
331
	idr_for_each(&file_priv->context_idr, context_idr_cleanup, NULL);
Line 334... Line 332...
334
	mutex_unlock(&dev->struct_mutex);
332
	idr_destroy(&file_priv->context_idr);
335
}
333
}
336
 
334
 
Line 402... Line 400...
402
 
400
 
403
	ret = i915_gem_obj_ggtt_pin(to->obj, CONTEXT_ALIGN, false, false);
401
	ret = i915_gem_obj_ggtt_pin(to->obj, CONTEXT_ALIGN, false, false);
404
	if (ret)
402
	if (ret)
Line -... Line 403...
-
 
403
		return ret;
-
 
404
 
-
 
405
	/*
-
 
406
	 * Pin can switch back to the default context if we end up calling into
-
 
407
	 * evict_everything - as a last ditch gtt defrag effort that also
-
 
408
	 * switches to the default context. Hence we need to reload from here.
-
 
409
	 */
-
 
410
	from = ring->last_context;
405
		return ret;
411
 
406
 
412
	/*
407
	/* Clear this page out of any CPU caches for coherent swap-in/out. Note
413
	 * Clear this page out of any CPU caches for coherent swap-in/out. Note
408
	 * that thanks to write = false in this call and us not setting any gpu
414
	 * that thanks to write = false in this call and us not setting any gpu
-
 
415
	 * write domains when putting a context object onto the active list
409
	 * write domains when putting a context object onto the active list
416
	 * (when switching away from it), this won't block.
-
 
417
	 *
410
	 * (when switching away from it), this won't block.
418
	 * XXX: We need a real interface to do this instead of trickery.
411
	 * XXX: We need a real interface to do this instead of trickery. */
419
	 */
412
	ret = i915_gem_object_set_to_gtt_domain(to->obj, false);
420
	ret = i915_gem_object_set_to_gtt_domain(to->obj, false);
413
	if (ret) {
421
	if (ret) {
414
		i915_gem_object_unpin(to->obj);
422
		i915_gem_object_unpin(to->obj);